To get an index of all todos on a list, see todolists.
GET /projects/1/todos/1.json
will return the specified todo.
{
"content": "Design it",
"completed": false,
"due_at": "2012-03-27",
"created_at": "2012-03-24T09:53:35-05:00",
"updated_at": "2012-03-24T10:56:33-05:00",
"position": 1,
"assignee": {
"id": 149087659,
"type": "Person",
"name": "Jason Fried"
},
"comments": [
{
"id": 1028592764,
"content": "+1",
"created_at": "2012-03-24T09:53:34-05:00",
"updated_at": "2012-03-24T09:53:34-05:00",
"creator": {
"id": 127326141,
"name": "David Heinemeier Hansson"
}
}
]
}
POST /projects/1/todolists/1/todos.json
will add a new todo to the specified todolist from the parameters passed. Thedue_at
parameter should be in ISO 8601 format (like "2012-03-27T16:00:00-05:00"). The assignee parameters need antype
field with eitherPerson
orGroup
specified. Theid
is then the id of that person or group.
{
"content": "This is my new thing!",
"due_at": "2012-03-27",
"assignee": {
"id": 149087659,
"type": "Person"
}
}
This will return 201 Created
, with the URL of the new todo in the Location
header along with the current JSON representation of the todo if the creation was a success. See the Get todo endpoint for more info. If the assignee type is unrecognized or the due_at
is in a wrong format, you'll see a 400 Bad Request
.
PUT /projects/1/todos/1.json
will update the todo from the parameters passed. Thecompleted
field can be set to eithertrue
orfalse
to check or uncheck the todo.
{
"content": "New content thing!",
"due_at": "2012-03-27",
"assignee": {
"id": 149087659,
"type": "Person"
},
"completed": true
}
This will return 200 OK
if the update was a success along with the current JSON representation of the todo in the response body. See the Get todo endpoint for more info. If the assignee type is unrecognized or the due_at
is in a wrong format, you'll see a 400 Bad Request
.
Updating the position
of a todo is also possible through this endpoint by passing an integer between 1
and n
, where n
is the number of todos in this list.
{
"position": 2
}
Note: If the position is out of bounds, the todo will be moved to the bottom.
DELETE /projects/1/todos/1.json
will delete the todo specified and return204 No Content
if that was successful. If the user does not have access to delete the todo, you'll see403 Forbidden
.