Update Task
This endpoint updates an existing task by ID. Only the fields you send are changed.
Endpoint
Section titled “Endpoint”PUT /v1/tasks/tasks/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”tasks:writePath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Task ID to update. |
Request Body
Section titled “Request Body”Send a JSON body. A request with no body returns 500. You cannot move a task to another project or client.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New task name. |
description | string | null | No | New task description. |
isArchived | boolean | No | New archive state. |
autoAssign | boolean | No | New auto-assign state. You can set it to true only when the parent project has autoAssign: true. Otherwise the API returns 400. |
billingCategory | "BILLABLE" | "NON_BILLABLE" | null | No | New billing category. Allowed only when the parent project’s billingCategory is null. Otherwise the task inherits the project’s value, and sending this field (even null) returns 400. Any other string returns 500. |
Example Request Body
Section titled “Example Request Body”{ "name": "Updated Task Name", "description": "Updated task description"}Example Request
Section titled “Example Request”curl -X PUT "https://api.crewsum.com/v1/tasks/tasks/task-pqr123stu4567890" \ -H "x-api-key: $CREWSUM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Updated Task Name", "description": "Updated task description" }'const response = await fetch( "https://api.crewsum.com/v1/tasks/tasks/task-pqr123stu4567890", { method: "PUT", headers: { "x-api-key": process.env.CREWSUM_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Updated Task Name", description: "Updated task description", }), },);const result = await response.json();PUT /v1/tasks/tasks/task-pqr123stu4567890 HTTP/1.1Host: api.crewsum.comx-api-key: <your-api-key>Content-Type: application/json
{ "name": "Updated Task Name", "description": "Updated task description"}Response
Section titled “Response”On success, the API returns HTTP 200 OK.
Example Response
Section titled “Example Response”{ "message": "Successfully updated task: task-pqr123stu4567890"}Behavior
Section titled “Behavior”- To change a task’s billing category while its project has one, update the project instead. A project’s
billingCategoryapplies to all of its tasks. See Update Project. - Setting
autoAssigntofalsedoes not remove existing user assignments. - If no task exists for the ID, the API returns
200and changes nothing, unless the request includesbillingCategoryorautoAssign: true. In that case it returns one of the400errors below. No webhook is sent for an unknown ID. - After the task is updated, Crewsum emits the
tasks.updatedwebhook event. A webhook delivery failure does not change the API response.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | The task ID was missing from the route. |
400 | Cannot set task billingCategory while project billingCategory is set: you sent billingCategory, and the parent project has a billing category (or the task does not exist). |
400 | Cannot auto assign task while project auto assign is disabled: you sent autoAssign: true, and the parent project has autoAssign: false (or the task does not exist). |
500 | Crewsum could not update the task. The message is Error updating task <id>. This includes an invalid billingCategory and a request with no JSON body. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks” tasks.updated View webhook event details.