RESTful API for the Codi Personal Assistant. Supports both session-based authentication (for web/mobile clients) and API key authentication (for programmatic/agent access).
The API supports two authentication methods:
Used by the web and mobile apps. Authenticate via Google OAuth at /api/auth/google.
Create API keys in Settings. Include the key in the Authorization header:
Authorization: Bearer pa_your_api_key_here
Endpoints marked with session-or-api-key accept either method.
Check authentication status
Returns the current authentication state, user email if logged in, and available auth methods.
{
"authenticated": boolean,
"user_email": "string (if authenticated)",
"auth_provider": "google|dev",
"dev_mode": boolean,
"auth_url": "string (Google OAuth URL if not authenticated)"
}
Log out current session
Invalidates the current session. Does not affect API keys.
List all todos
Returns all todos for the authenticated user, including completed and backlogged items. Todos shared with others include sharing info.
[{
"id": "string",
"description": "string",
"completed": boolean,
"frequency": "one-time|daily|weekly|monthly",
"sharedWith": ["email@example.com"],
"listItems": [{"id": "string", "text": "string", "completed": boolean}],
"workoutExercises": [...],
"linkedNoteId": "string (optional)",
"linkedNoteTitle": "string (optional)",
"createdAt": "ISO8601 timestamp",
"completedAt": "ISO8601 timestamp (if completed)",
"deletedAt": "ISO8601 timestamp (if deleted)",
"isBacklogged": boolean,
"remindAt": "ISO8601 timestamp (if scheduled)"
}]
Create a new todo
Creates a new todo. Use @email in description to auto-share with other users. Supports hashtags like #urgent, #important, #list, #workout.
{
"description": "string (required) - supports @mentions and #hashtags",
"frequency": "one-time|daily|weekly|monthly (default: one-time)"
}
{
"id": "string",
"description": "string",
"completed": false,
"frequency": "string",
"createdAt": "ISO8601 timestamp"
}
Get a specific todo
Returns a single todo by ID.
| Name | Type | Description |
|---|---|---|
| id (required) | string | Todo ID |
Update a todo
Updates a todo's properties. Only include fields you want to change.
| Name | Type | Description |
|---|---|---|
| id (required) | string | Todo ID |
{
"completed": boolean,
"description": "string",
"frequency": "string",
"sharedWith": ["email@example.com"],
"listItems": [...],
"workoutExercises": [...],
"linkedNoteId": "string",
"linkedNoteTitle": "string"
}
Delete a todo
Soft-deletes a todo. Can be restored later.
| Name | Type | Description |
|---|---|---|
| id (required) | string | Todo ID |
Restore a deleted todo
Restores a previously deleted todo.
Move todo to backlog
Moves a todo to the backlog, optionally with a reminder date.
{
"remind_at": "ISO8601 timestamp (optional)"
}
Move todo from backlog
Moves a todo back from the backlog to active.
List todos shared with me
Returns todos that other users have shared with the current user.
[{
"id": "string",
"description": "string",
"ownerEmail": "string",
"ownerName": "string",
"ownerAvatar": "base64 (optional)",
...todo fields
}]
List all notes
Returns all notes for the user, including shared notes. Shared notes include owner info and 'isNew' status.
[{
"id": "string",
"title": "string",
"content": "string (markdown)",
"isDraft": boolean,
"isNew": boolean,
"tags": ["string"],
"linkedTaskId": "string (optional)",
"linkedTaskName": "string (optional)",
"userEmail": "string (owner)",
"ownerName": "string (for shared notes)",
"createdAt": "ISO8601",
"updatedAt": "ISO8601"
}]
Create a new note
Creates a new note. Can optionally link to a task.
{
"title": "string (required)",
"content": "string (markdown)",
"isDraft": boolean (default: false),
"tags": ["string"],
"linkedTaskId": "string (optional)",
"linkedTaskName": "string (optional)",
"linkedTaskData": "string (optional - serialized task data)"
}
Get a specific note
Returns a single note by ID.
Update a note
Updates a note. Supports optimistic concurrency via version field.
{
"title": "string",
"content": "string",
"isDraft": boolean,
"tags": ["string"],
"version": number (for conflict detection)
}
Delete a note
Soft-deletes a note. Can be restored later.
Restore a deleted note
Restores a previously deleted note.
Search notes
Full-text search across note titles and content.
| Name | Type | Description |
|---|---|---|
| q (required) | string | Search query |
Share a note
Updates the list of users a note is shared with.
{
"sharedWith": ["email@example.com"]
}
Get user profile
Returns the current user's profile including display name, avatar, and timezone.
{
"display_name": "string",
"avatar_data": "base64 (optional)",
"timezone": "string (e.g., America/New_York)"
}
Update user profile
Updates the current user's profile.
{
"display_name": "string",
"timezone": "string"
}
List connections
Returns all connections (friends/collaborators) for sharing tasks and notes.
[{
"email": "string",
"displayName": "string",
"avatarData": "base64 (optional)",
"status": "pending|accepted|rejected"
}]
Send connection invite
Sends a connection invitation to another user.
{
"email": "string (required)"
}
Accept or reject connection
Responds to a connection invitation.
{
"action": "accept|reject"
}
Remove connection
Removes a connection or cancels a pending invitation.
Get hashtag configurations
Returns configured hashtags and their settings (priority, type, form fields).
Update hashtag configurations
Updates the hashtag configurations.
List API keys
Returns all API keys for the user (keys are masked, only prefix shown).
[{
"id": "string",
"name": "string",
"key_prefix": "pa_xxxx...",
"created_at": "ISO8601",
"last_used_at": "ISO8601 (optional)"
}]
Create API key
Creates a new API key. The full key is only shown once in the response.
{
"name": "string (required)"
}
{
"id": "string",
"name": "string",
"key": "pa_... (SAVE THIS - only shown once!)",
"key_prefix": "pa_xxxx...",
"created_at": "ISO8601"
}
Revoke API key
Permanently revokes an API key.
Get exercise history
Returns the user's exercise/workout history.
Get workout summaries
Returns summarized workout data.
Get workout analytics
Returns analytics for a specific exercise.
| Name | Type | Description |
|---|---|---|
| name (required) | string | Exercise name |
| mode (required) | string | duration|volume|max |
Get task completion stats
Returns task completion statistics over time.
| Name | Type | Description |
|---|---|---|
| filter | string | all|important|urgent|both |