PATCH
/tasks/:taskIdUpdate Task
Updates an existing task. Only include the fields you want to change - all fields are optional. Returns the updated task.
Overview
This endpoint allows you to modify any aspect of an existing task. Send only the fields you want to change - omitted fields remain unchanged. This is the main way to keep tasks in sync between your system and StrikeOff. When you update the status to CLOSED, the closedDate is automatically set. When you archive a task, the archivedAt timestamp is recorded. Important: if a task created via your API was accidentally archived by a user in StrikeOff, any update you send will automatically unarchive it - this ensures your external system stays in sync and tasks don't get 'lost' in the archived state.
When to Use This
- Updating task status when the corresponding item changes in your system (e.g., ticket resolved)
- Syncing priority or due date changes from your project management tool
- Marking tasks as complete when work is finished in your external workflow
- Adding or updating hashtags to categorize tasks
- Archiving tasks that are no longer relevant without permanently deleting them
Path Parameters
| Parameter | Type | Description |
|---|---|---|
taskIdrequired | string | The unique identifier of the task to update |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | optional | New task title (max 500 characters) |
description | string | optional | New task description |
dueDate | ISO 8601 | optional | New due date (or null to remove) |
priority | enum | optional | HIGH, MEDIUM_HIGH, MEDIUM, LOW, FUTURE |
status | enum | optional | OPEN, DOING, CLOSED |
archived | boolean | optional | Archive or unarchive the task |
hashtags | string[] | optional | Replace all hashtags with this array. Use empty array [] to remove all hashtags. |
Request Example
cURL
curl -X PATCH "https://strikeoffapp.com/api/external/v1/tasks/cltask001" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"status": "CLOSED",
"priority": "MEDIUM",
"hashtags": ["completed", "finance"]
}'Response
JSON
{
"success": true,
"data": {
"task": {
"id": "cltask001...",
"title": "Review Q4 financial report",
"description": "Review and approve the quarterly report before Friday",
"status": "CLOSED",
"priority": "MEDIUM",
"dueDate": "2024-12-31T23:59:59Z",
"archived": false,
"archivedAt": null,
"createdAt": "2024-12-15T10:30:00Z",
"updatedAt": "2024-12-20T14:30:00Z",
"closedDate": "2024-12-20T14:30:00Z",
"list": {
"id": "cllist002...",
"name": "In Progress",
"board": {
"id": "clxxx123...",
"name": "Development"
}
},
"assignedTo": [...],
"hashtags": [
{ "id": "clhash004...", "name": "completed", "color": "#10B981" },
{ "id": "clhash001...", "name": "finance", "color": "#3B82F6" }
]
}
}
}Notes
- Only include fields you want to update.
- Setting status to CLOSED automatically sets closedDate.
- Setting status to OPEN or DOING clears closedDate.
- Setting archived to true/false automatically sets/clears archivedAt.
- Auto-unarchive: If a task created via API was archived by a user, any update will automatically unarchive it.
- Hashtags are replaced entirely - include all hashtags you want to keep.
- Pass an empty array [] to remove all hashtags from a task.