Tasks
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
POST | |
DELETE | |
GET | |
POST | |
POST | |
POST | |
GET | |
POST |
Create tasks handoff
Transfer ownership of a task to another member of the project: they take over driving it (steering, archiving, running), and future runs resolve GitHub authorship and notification recipients from them. Only the task's current owner can hand it off. Every run must be finished or canceled, and every sandbox must be shut down first. A task in a private space moves into the recipient's private space; a task in a shared space stays there.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- userinteger
Response
Example request
POST /api /projects /:project_id /tasks /:id /handoffExample response
Status 200
Status 403 Only a user may hand off a task.
Create tasks handoff
Transfer ownership of a task to another member of the project: they take over driving it (steering, archiving, running), and future runs resolve GitHub authorship and notification recipients from them. Only the task's current owner can hand it off. Every run must be finished or canceled, and every sandbox must be shut down first. A task in a private space moves into the recipient's private space; a task in a shared space stays there.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- userinteger
Response
Example request
POST /api /projects /:project_id /tasks /:id /handoffExample response
Status 200
Status 403 Only a user may hand off a task.
Create tasks pin
API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- pinnedboolean
Response
Example request
POST /api /projects /:project_id /tasks /:id /pinExample response
Status 200
Create tasks pin
API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- pinnedboolean
Response
Example request
POST /api /projects /:project_id /tasks /:id /pinExample response
Status 200
Create tasks presence
Idempotent upsert: marks the calling user + device_id as actively watching this task for the next ~60 seconds. While at least one device for the user has a non-expired presence row for this task, the push fanout will skip ALL of that user's other registered devices for task notifications — the contract is 'if any device is demonstrably watching, suppress the others'. Clients call this every ~30s while the task screen is foregrounded. device_id is the UUID of the caller's UserPushToken row.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- device_idstring
Example request
POST /api /projects /:project_id /tasks /:id /presenceExample response
Status 204 Presence recorded for this device.
Status 404 `device_id` does not match a push token registered by the caller.
Create tasks presence
Idempotent upsert: marks the calling user + device_id as actively watching this task for the next ~60 seconds. While at least one device for the user has a non-expired presence row for this task, the push fanout will skip ALL of that user's other registered devices for task notifications — the contract is 'if any device is demonstrably watching, suppress the others'. Clients call this every ~30s while the task screen is foregrounded. device_id is the UUID of the caller's UserPushToken row.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- device_idstring
Example request
POST /api /projects /:project_id /tasks /:id /presenceExample response
Status 204 Presence recorded for this device.
Status 404 `device_id` does not match a push token registered by the caller.
Delete tasks presence
Idempotent upsert: marks the calling user + device_id as actively watching this task for the next ~60 seconds. While at least one device for the user has a non-expired presence row for this task, the push fanout will skip ALL of that user's other registered devices for task notifications — the contract is 'if any device is demonstrably watching, suppress the others'. Clients call this every ~30s while the task screen is foregrounded. device_id is the UUID of the caller's UserPushToken row.
Required API key scopes
task:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /tasks /:id /presenceExample response
Status 204 Presence recorded for this device.
Status 404 `device_id` does not match a push token registered by the caller.
Delete tasks presence
Idempotent upsert: marks the calling user + device_id as actively watching this task for the next ~60 seconds. While at least one device for the user has a non-expired presence row for this task, the push fanout will skip ALL of that user's other registered devices for task notifications — the contract is 'if any device is demonstrably watching, suppress the others'. Clients call this every ~30s while the task screen is foregrounded. device_id is the UUID of the caller's UserPushToken row.
Required API key scopes
task:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /tasks /:id /presenceExample response
Status 204 Presence recorded for this device.
Status 404 `device_id` does not match a push token registered by the caller.
Retrieve tasks review
API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
Required API key scopes
task:readPath parameters
- idstring
Query parameters
- pageintegerDefault:
1
Response
Example request
GET /api /projects /:project_id /tasks /:id /reviewExample response
Status 200
Retrieve tasks review
API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
Required API key scopes
task:readPath parameters
- idstring
Query parameters
- pageintegerDefault:
1
Response
Example request
GET /api /projects /:project_id /tasks /:id /reviewExample response
Status 200
Create tasks run
Create a new task run and kick off the workflow. The response is the refreshed task with the created run under the top-level run key: read run.id for anything run-scoped, such as the run's stream and command endpoints. The top-level id is the task's, and latest_run mirrors run only as long as nothing newer starts — reading either of those as the created run is deprecated.
Required API key scopes
task:writePath parameters
- idstring
Response
Example request
Example response
Status 200 The refreshed task, plus the created run under the top-level `run` key
Status 400 Invalid task run payload
Status 402 The organization is on a Self-driving free trial, so a report implementation opens no pull request (code `self_driving_free_trial`)
Status 403 PostHog Desktop access is required, or Pi cloud runtime is disabled
Status 404 Task not found
Status 429 Team is over its posthog_code usage limit, or the task's signal report has reached its task limit (code `signal_report_task_cap`)
Status 503 PostHog Desktop access could not be verified, or warm run activation is unavailable (code `warm_run_activation_unavailable`). After confirmed nondelivery, a retry_token permits retrying the same run and message with X-PostHog-Warm-Retry. Web retries for up to 20 seconds.
Create tasks run
Create a new task run and kick off the workflow. The response is the refreshed task with the created run under the top-level run key: read run.id for anything run-scoped, such as the run's stream and command endpoints. The top-level id is the task's, and latest_run mirrors run only as long as nothing newer starts — reading either of those as the created run is deprecated.
Required API key scopes
task:writePath parameters
- idstring
Response
Example request
Example response
Status 200 The refreshed task, plus the created run under the top-level `run` key
Status 400 Invalid task run payload
Status 402 The organization is on a Self-driving free trial, so a report implementation opens no pull request (code `self_driving_free_trial`)
Status 403 PostHog Desktop access is required, or Pi cloud runtime is disabled
Status 404 Task not found
Status 429 Team is over its posthog_code usage limit, or the task's signal report has reached its task limit (code `signal_report_task_cap`)
Status 503 PostHog Desktop access could not be verified, or warm run activation is unavailable (code `warm_run_activation_unavailable`). After confirmed nondelivery, a retry_token permits retrying the same run and message with X-PostHog-Warm-Retry. Web retries for up to 20 seconds.
Create tasks staged artifacts finalize upload
Verify staged S3 uploads and cache their metadata so they can be attached to the next run created for this task.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:id /staged_artifacts /finalize_uploadExample response
Status 200 Finalized staged artifacts available for the next task run
Status 400 Invalid artifact payload
Status 404 Task not found
Create tasks staged artifacts finalize upload
Verify staged S3 uploads and cache their metadata so they can be attached to the next run created for this task.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:id /staged_artifacts /finalize_uploadExample response
Status 200 Finalized staged artifacts available for the next task run
Status 400 Invalid artifact payload
Status 404 Task not found
Create tasks staged artifacts prepare upload
Reserve S3 object keys for task attachments before creating a new run and return presigned POST forms for direct uploads.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:id /staged_artifacts /prepare_uploadExample response
Status 200 Prepared staged uploads for the requested artifacts
Status 400 Invalid artifact payload
Status 404 Task not found
Create tasks staged artifacts prepare upload
Reserve S3 object keys for task attachments before creating a new run and return presigned POST forms for direct uploads.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:id /staged_artifacts /prepare_uploadExample response
Status 200 Prepared staged uploads for the requested artifacts
Status 400 Invalid artifact payload
Status 404 Task not found
Retrieve tasks usage
Return estimated model and cloud compute costs attributed to a task.
Required API key scopes
task:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /tasks /:id /usageExample response
Status 200
Retrieve tasks usage
Return estimated model and cloud compute costs attributed to a task.
Required API key scopes
task:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /tasks /:id /usageExample response
Status 200
Create tasks warm resume
Warm an idling successor for the task's latest terminal Run while the user composes the next message. The successor restores the prior snapshot when compatible and waits for the normal run endpoint to activate it. Best-effort: returns an empty body when warming is disabled, capped, or the task advanced to another Run.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- resume_from_run_idstring
- runtime_adapter
- modelstring
- reasoning_effort
- initial_permission_mode
Response
Example request
POST /api /projects /:project_id /tasks /:id /warmExample response
Status 200 Successor Run provisioned, or an empty body when warming is unavailable or the source run changed.
Status 403 PostHog Desktop access is required
Status 404 Task not found
Status 429 Team is over its posthog_code usage limit
Create tasks warm resume
Warm an idling successor for the task's latest terminal Run while the user composes the next message. The successor restores the prior snapshot when compatible and waits for the normal run endpoint to activate it. Best-effort: returns an empty body when warming is disabled, capped, or the task advanced to another Run.
Required API key scopes
task:writePath parameters
- idstring
Request parameters
- resume_from_run_idstring
- runtime_adapter
- modelstring
- reasoning_effort
- initial_permission_mode
Response
Example request
POST /api /projects /:project_id /tasks /:id /warm










