Skip to main content

Use Custom Fields

Add structured data to tasks — priority levels, departments, story points, and more.

curl

Create a custom field definition

# Create a "Priority" select field
curl -X POST https://your-server.com/todolist/custom-fields \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Priority",
"field_type": "select",
"options": ["Low", "Medium", "High", "Critical"]
}'

List all custom fields

curl -X GET https://your-server.com/todolist/custom-fields \
-H "Authorization: Bearer $TOKEN"

Update a task's custom field value

curl -X PATCH https://your-server.com/todolist/{taskId}/metadata \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"custom_fields": {
"priority": "High"
}
}'

Query by custom field

# CLI
ud task query "cf.priority = 'High' AND status != 'done'"

# curl
curl -X POST https://your-server.com/todolist/query \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "cf.priority = '\''High'\'' AND status != '\''done'\''"
}'

Custom field types

TypeExample useQuery example
textNotes, locationcf.location = 'NYC'
numberStory pointscf.points > 5
selectPriority dropdowncf.priority = 'High'
checkboxReviewed?cf.reviewed = 'true'
userAssigned tocf.assigned = 'alice'