Skip to main content
Update an existing task by its unique identifier. You can update the task name, output content, status, and tags.

Update a Task

const API_KEY = process.env.TELA_API_KEY;
const taskId = 'task_uuid';

const updateData = {
  name: "Updated Task Name",
  status: "completed",
  outputContent: {
    summary: "Updated summary content",
    result: "Task completed successfully"
  },
  tags: ["updated", "completed"]
};

const response = await fetch(`https://api.tela.ai/task/${taskId}`, {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(updateData)
});

const data = await response.json();
console.log(data);

Parameters

NameTypeRequiredDescription
idstringYesThe UUID of the task to update

Request Body

The request body can include any of the following fields to update. Only include the fields you want to modify.
FieldTypeDescription
namestringName of the task
outputContentobject or nullOutput content for the task
statusstringTask status (only completed is allowed)
tagsstring[]Tags to associate with the task

Response

The response will contain the updated task with all fields reflecting the changes.

Example Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Updated Task Name",
  "status": "completed",
  "promptApplicationId": "550e8400-e29b-41d4-a716-446655440001",
  "inputContent": {
    "variables": {
      "document": "Sample document content"
    }
  },
  "outputContent": {
    "summary": "Updated summary content",
    "result": "Task completed successfully"
  },
  "tags": ["updated", "completed"],
  "createdAt": "2023-01-01T00:00:00.000Z",
  "updatedAt": "2023-01-02T00:00:00.000Z",
  "approvedAt": null
}