Skip to content

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.

Get all todos.

GET /api/todo
ParameterTypeDescription
workspaceIdstringFilter by workspace (uses default if not provided)
noteIdstringFilter by note (optional)
completedbooleanFilter by completion status (optional)
isDeletedbooleanInclude deleted todos (default: false)
searchstringSearch in todo text (optional)
sortstringSort field and direction, e.g. createdAt:desc
pagenumberPage number (default: 1)
limitnumberResults per page (default: 50, max: 100)
{
"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
}
}
Terminal window
curl -X GET "https://sidvy.com/api/todo?completed=false&limit=10" \
-H "Authorization: Bearer sidvy_abc123..."

Create a new todo associated with a note.

POST /api/todo
{
"text": "Review pull request",
"noteId": "660e8400-e29b-41d4-a716-446655440001",
"lineNumber": 5,
"completed": false,
"workspaceId": "770e8400-e29b-41d4-a716-446655440002"
}
FieldTypeRequiredDescription
textstringYesTodo text
noteIdstringYesID of the note this todo belongs to
lineNumbernumberYesLine number in the note (must be >= 1)
completedbooleanNoInitial completion status (default: false)
workspaceIdstringNoTarget workspace (uses default if not provided)
{
"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
}
Terminal window
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 a todo’s text, completion status, or line number.

PUT /api/todo
{
"todoId": "550e8400-e29b-41d4-a716-446655440000",
"text": "Updated text",
"completed": true,
"lineNumber": 10
}
FieldTypeRequiredDescription
todoIdstringYesTodo ID to update
textstringNoNew todo text
completedbooleanNoCompletion status
lineNumbernumberNoNew line number (must be >= 1)

Returns the updated todo object in the same format as create.

Terminal window
curl -X PUT "https://sidvy.com/api/todo" \
-H "Authorization: Bearer sidvy_abc123..." \
-H "Content-Type: application/json" \
-d '{"todoId": "550e8400...", "completed": true}'

Delete a todo (soft delete).

DELETE /api/todo
{
"todoId": "550e8400-e29b-41d4-a716-446655440000"
}
FieldTypeRequiredDescription
todoIdstringYesTodo ID to delete
{
"data": {
"deleted": true,
"todoId": "550e8400-e29b-41d4-a716-446655440000",
"softDeleted": true
},
"count": 1
}
Terminal window
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"}'
{
"error": "NOT_FOUND",
"message": "Todo not found"
}
{
"error": "NOT_FOUND",
"message": "Note not found"
}
{
"error": "VALIDATION_ERROR",
"message": "text: Required field is missing, noteId: Required field is missing"
}

Todos can be managed in two ways:

  1. Via API: Create, update, and delete todos directly using these endpoints
  2. 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.