Todos API
The Todos API lets you manage todos programmatically. Todos are typically extracted from checkbox syntax in notes (- [ ] and - [x]), but can also be created directly via the API.
List Todos
Section titled “List Todos”Get all todos.
GET /api/todoQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Description |
|---|---|---|
workspaceId | string | Filter by workspace (uses default if not provided) |
noteId | string | Filter by note (optional) |
completed | boolean | Filter by completion status (optional) |
isDeleted | boolean | Include deleted todos (default: false) |
search | string | Search in todo text (optional) |
sort | string | Sort field and direction, e.g. createdAt:desc |
page | number | Page number (default: 1) |
limit | number | Results per page (default: 50, max: 100) |
Response
Section titled “Response”{ "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "text": "Review pull request", "completed": false, "completedAt": null, "noteId": "660e8400-e29b-41d4-a716-446655440001", "lineNumber": 5, "workspaceId": "770e8400-e29b-41d4-a716-446655440002", "userId": "880e8400-e29b-41d4-a716-446655440003", "isDeleted": false, "deletedAt": null, "deletedBy": null, "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z" } ], "pagination": { "page": 1, "limit": 50, "total": 100, "totalPages": 2 }, "count": 100, "filters": { "workspaceId": "770e8400-e29b-41d4-a716-446655440002", "noteId": null, "completed": null, "isDeleted": false, "search": null }}Example
Section titled “Example”curl -X GET "https://sidvy.com/api/todo?completed=false&limit=10" \ -H "Authorization: Bearer sidvy_abc123..."Create Todo
Section titled “Create Todo”Create a new todo associated with a note.
POST /api/todoRequest Body
Section titled “Request Body”{ "text": "Review pull request", "noteId": "660e8400-e29b-41d4-a716-446655440001", "lineNumber": 5, "completed": false, "workspaceId": "770e8400-e29b-41d4-a716-446655440002"}| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Todo text |
noteId | string | Yes | ID of the note this todo belongs to |
lineNumber | number | Yes | Line number in the note (must be >= 1) |
completed | boolean | No | Initial completion status (default: false) |
workspaceId | string | No | Target workspace (uses default if not provided) |
Response
Section titled “Response”{ "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "text": "Review pull request", "completed": false, "completedAt": null, "noteId": "660e8400-e29b-41d4-a716-446655440001", "lineNumber": 5, "workspaceId": "770e8400-e29b-41d4-a716-446655440002", "userId": "880e8400-e29b-41d4-a716-446655440003", "isDeleted": false, "deletedAt": null, "deletedBy": null, "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z" }, "count": 1}Example
Section titled “Example”curl -X POST "https://sidvy.com/api/todo" \ -H "Authorization: Bearer sidvy_abc123..." \ -H "Content-Type: application/json" \ -d '{"text": "Review PR", "noteId": "660e8400...", "lineNumber": 5}'Update Todo
Section titled “Update Todo”Update a todo’s text, completion status, or line number.
PUT /api/todoRequest Body
Section titled “Request Body”{ "todoId": "550e8400-e29b-41d4-a716-446655440000", "text": "Updated text", "completed": true, "lineNumber": 10}| Field | Type | Required | Description |
|---|---|---|---|
todoId | string | Yes | Todo ID to update |
text | string | No | New todo text |
completed | boolean | No | Completion status |
lineNumber | number | No | New line number (must be >= 1) |
Response
Section titled “Response”Returns the updated todo object in the same format as create.
Example
Section titled “Example”curl -X PUT "https://sidvy.com/api/todo" \ -H "Authorization: Bearer sidvy_abc123..." \ -H "Content-Type: application/json" \ -d '{"todoId": "550e8400...", "completed": true}'Delete Todo
Section titled “Delete Todo”Delete a todo (soft delete).
DELETE /api/todoRequest Body
Section titled “Request Body”{ "todoId": "550e8400-e29b-41d4-a716-446655440000"}| Field | Type | Required | Description |
|---|---|---|---|
todoId | string | Yes | Todo ID to delete |
Response
Section titled “Response”{ "data": { "deleted": true, "todoId": "550e8400-e29b-41d4-a716-446655440000", "softDeleted": true }, "count": 1}Example
Section titled “Example”curl -X DELETE "https://sidvy.com/api/todo" \ -H "Authorization: Bearer sidvy_abc123..." \ -H "Content-Type: application/json" \ -d '{"todoId": "550e8400-e29b-41d4-a716-446655440000"}'Errors
Section titled “Errors”404 Not Found
Section titled “404 Not Found”{ "error": "NOT_FOUND", "message": "Todo not found"}404 Note Not Found
Section titled “404 Note Not Found”{ "error": "NOT_FOUND", "message": "Note not found"}400 Validation Error
Section titled “400 Validation Error”{ "error": "VALIDATION_ERROR", "message": "text: Required field is missing, noteId: Required field is missing"}Syncing with Note Content
Section titled “Syncing with Note Content”Todos can be managed in two ways:
- Via API: Create, update, and delete todos directly using these endpoints
- Via Note Content: Add checkbox syntax (
- [ ]or- [x]) to notes
When editing note content in the Sidvy app, todos are automatically synced:
- New checkboxes create todo records
- Removed checkboxes delete todo records
- Modified checkbox text updates todo records
The lineNumber field tracks which line in the note the todo corresponds to.