Tasks
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
GET | |
POST | |
GET | |
PATCH | |
POST | |
POST | |
POST | |
POST | |
POST |
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
List all tasks runs
Get a list of runs for a specific task.
Required API key scopes
task:readPath parameters
- task_idstring
Query parameters
- limitintegerDefault:
50 - offsetintegerDefault:
0
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runsExample response
Status 200 List of task runs
List all tasks runs
Get a list of runs for a specific task.
Required API key scopes
task:readPath parameters
- task_idstring
Query parameters
- limitintegerDefault:
50 - offsetintegerDefault:
0
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runsExample response
Status 200 List of task runs
Create tasks runs
Create a new run for a specific task without starting execution.
Required API key scopes
task:writePath parameters
- task_idstring
Request parameters
- environmentDefault:
local - modeDefault:
background - branchstringnull
- sandbox_environment_idstring
- custom_image_idstring
- pr_authorship_mode
- auto_publishbooleannull
- run_source
- signal_report_idstring
- runtime_adapter
- modelstring
- reasoning_effort
- github_user_tokenstring
- initial_permission_mode
- rtk_enabledbooleannull
- home_quick_actionstring
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runsExample response
Status 201 Created task run
Status 400 Invalid task run payload
Status 429 Team is over its posthog_code usage limit
Create tasks runs
Create a new run for a specific task without starting execution.
Required API key scopes
task:writePath parameters
- task_idstring
Request parameters
- environmentDefault:
local - modeDefault:
background - branchstringnull
- sandbox_environment_idstring
- custom_image_idstring
- pr_authorship_mode
- auto_publishbooleannull
- run_source
- signal_report_idstring
- runtime_adapter
- modelstring
- reasoning_effort
- github_user_tokenstring
- initial_permission_mode
- rtk_enabledbooleannull
- home_quick_actionstring
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runsExample response
Status 201 Created task run
Status 400 Invalid task run payload
Status 429 Team is over its posthog_code usage limit
Retrieve tasks runs
Retrieve a single run for a specific task.
Required API key scopes
task:readPath parameters
- idstring
- task_idstring
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:idExample response
Status 200 Task run
Status 404 Task run not found
Retrieve tasks runs
Retrieve a single run for a specific task.
Required API key scopes
task:readPath parameters
- idstring
- task_idstring
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:idExample response
Status 200 Task run
Status 404 Task run not found
Update tasks runs
API for managing task runs. Each run represents an execution of a task.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- status
- branchstringnull
- stagestringnull
- output
- state
- state_remove_keysarray
- error_messagestringnull
- environment
Response
Example request
PATCH /api /projects /:project_id /tasks /:task_id /runs /:idExample response
Status 200 Updated task run
Status 400 Invalid update data
Status 404 Task run not found
Update tasks runs
API for managing task runs. Each run represents an execution of a task.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- status
- branchstringnull
- stagestringnull
- output
- state
- state_remove_keysarray
- error_messagestringnull
- environment
Response
Example request
PATCH /api /projects /:project_id /tasks /:task_id /runs /:idExample response
Status 200 Updated task run
Status 400 Invalid update data
Status 404 Task run not found
Create tasks runs append log
Append one or more log entries to the task run log array
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- entriesarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /append_logExample response
Status 200 Run with updated log
Status 400 Invalid log entries
Status 404 Run not found
Create tasks runs append log
Append one or more log entries to the task run log array
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- entriesarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /append_logExample response
Status 200 Run with updated log
Status 400 Invalid log entries
Status 404 Run not found
Create tasks runs artifacts
Persist task artifacts to S3 and attach them to the run manifest.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifactsExample response
Status 200 Run with updated artifact manifest
Status 400 Invalid artifact payload
Status 404 Run not found
Create tasks runs artifacts
Persist task artifacts to S3 and attach them to the run manifest.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifactsExample response
Status 200 Run with updated artifact manifest
Status 400 Invalid artifact payload
Status 404 Run not found
Create tasks runs artifacts download
Streams artifact content for a task run artifact after validating that it belongs to the run.
Required API key scopes
task:readPath parameters
- idstring
- task_idstring
Request parameters
- storage_pathstring
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /downloadExample response
Status 200 Artifact content
Status 400 Invalid request
Status 404 Artifact not found
Create tasks runs artifacts download
Streams artifact content for a task run artifact after validating that it belongs to the run.
Required API key scopes
task:readPath parameters
- idstring
- task_idstring
Request parameters
- storage_pathstring
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /downloadExample response
Status 200 Artifact content
Status 400 Invalid request
Status 404 Artifact not found
Create tasks runs artifacts finalize upload
Verify directly uploaded S3 objects and attach them to the run artifact manifest.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /finalize_uploadExample response
Status 200 Run with updated artifact manifest
Status 400 Invalid artifact payload
Status 404 Run not found
Create tasks runs artifacts finalize upload
Verify directly uploaded S3 objects and attach them to the run artifact manifest.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /finalize_uploadExample response
Status 200 Run with updated artifact manifest
Status 400 Invalid artifact payload
Status 404 Run not found
Create tasks runs artifacts prepare upload
Reserve S3 object keys for task artifacts and return presigned POST forms for direct uploads.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /prepare_uploadExample response
Status 200 Prepared uploads for the requested artifacts
Status 400 Invalid artifact payload
Status 404 Run not found
Create tasks runs artifacts prepare upload
Reserve S3 object keys for task artifacts and return presigned POST forms for direct uploads.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- artifactsarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /prepare_upload