{"openapi":"3.1.0","info":{"title":"Trellis API","version":"1.0.0","description":"The Trellis JSON API lets you read and manage your tasks and notes\nprogrammatically.\n\n## Authentication\nAll endpoints require an API key. Create one at `/api_keys` while\nsigned in. Send it as `Authorization: Bearer tk_...`.\n\n## Pagination\nList endpoints use opaque cursor-based pagination, ordered by\n`created_at DESC`. Pass the `next_cursor` from a response back as\nthe `cursor` query parameter to fetch the next page. When\n`next_cursor` is `null`, you've reached the end.\n","contact":{"name":"Trellis","url":"https://toadstool.tech"}},"servers":[{"url":"https://trytrellis.net"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"tk_\u003ctoken\u003e"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"unauthorized"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"Task":{"type":"object","required":["id","title","created_at","updated_at","tags"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":["string","null"]},"due_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"repeating_interval":{"type":["string","null"],"enum":[null,"daily","every_other_day","weekly","monthly","yearly","weekday"]},"tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"TaskInput":{"type":"object","required":["task"],"properties":{"task":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"due_at":{"type":"string","format":"date-time"},"repeating_interval":{"type":"string","enum":["daily","every_other_day","weekly","monthly","yearly","weekday"]},"tags":{"type":"array","items":{"type":"string"}}}}}},"TaskList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"next_cursor":{"type":["string","null"]}}},"Note":{"type":"object","required":["id","body","created_at","updated_at","tags"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":["string","null"]},"body":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"NoteInput":{"type":"object","required":["note"],"properties":{"note":{"type":"object","required":["body"],"properties":{"title":{"type":"string"},"body":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"Unauthorized":{"description":"Missing or invalid API token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ValidationError":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/tasks":{"get":{"summary":"List tasks","description":"Returns the most recently created tasks first.","parameters":[{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from a previous next_cursor."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Page of tasks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"}}}},"400":{"description":"Invalid cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"summary":"Create a task","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/api/v1/tasks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"summary":"Get a task","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"summary":"Edit a task","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/api/v1/tasks/{id}/complete":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"summary":"Mark a task as done","description":"Idempotent — already-completed tasks are returned unchanged.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/notes":{"post":{"summary":"Create a note","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/api/v1/notes/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"summary":"Get a note","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"summary":"Edit a note","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Note"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"}}}}}}