Skip to main content
POST
Assign a factory task to an agent, or unassign it
The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.

v2 compatibility notes

POST /api/v2/factories/assignTask assigns a task to an agent, or unassigns it, and answers the updated FactoryTaskDetail. The body is { id, assignee }. assignee is { "type": "agent", "workerId": "..." } or null. The workerId must be an active agent member of the task’s own factory, as listFactoryWorkers returns it; any other id is 400 bad_request. A person is never assigned over the API. Assigning moves a BACKLOG or READY task to ASSIGNED. Unassigning moves an ASSIGNED task back to READY; any other status is kept. The task must belong to a factory you may read; otherwise the answer is 404 resource_missing. You need projects:manage at the task’s home, the key Console’s assignment checks. Without it the answer is 403. Assigning an agent does not start it, and nothing is scheduled.

Authorizations

Authorization
string
header
required

An External App: the JWT it obtains from POST /oauth/token with OAuth2 client_credentials. Pass as Authorization: Bearer <jwt>. An app's static companion key also authenticates as the app, but is deprecated and is not protected by Idempotency-Key.

Headers

Idempotency-Key
string

Path Parameters

taskId
string
required
Minimum string length: 1

Body

application/json
assignee
object | null
required

Response

The task as written

data
object
required

A factory task with its description (null when it has none). Tasks are written with createTask, updateTask, assignTask and transitionTask; starting factory work is done by a person in Console.

meta
object
required