Tasks-2
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
GET | |
GET | |
POST | |
GET | |
PATCH | |
GET | |
GET |
Create tasks runs artifacts presign
Returns a temporary, signed URL that can be used to download a specific artifact.
Required API key scopes
task:readPath parameters
- idstring
- project_idstring
- task_idstring
Request parameters
- storage_pathstring
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /presignExample response
Status 200 Presigned URL for the requested artifact
Status 400 Invalid request
Status 404 Artifact not found
Create tasks runs command
Forward a JSON-RPC command to the agent server running in the sandbox. Supports user_message, cancel, and close commands.
Required API key scopes
task:writePath parameters
- idstring
- project_idstring
- task_idstring
Request parameters
- jsonrpc
- method
- paramsobject
- id
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /commandExample response
Status 200 Agent server response
Status 400 Invalid command or no active sandbox
Status 404 Task run not found
Status 502 Agent server unreachable
Retrieve tasks runs connection token
Generate a JWT token for direct connection to the sandbox. Valid for 24 hours.
Required API key scopes
task:readPath parameters
- idstring
- project_idstring
- task_idstring
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /connection_tokenExample response
Status 200 Connection token for direct sandbox connection
Status 404 Task run not found
Retrieve tasks runs logs
Fetch the logs for a task run. Returns JSONL formatted log entries.
Required API key scopes
task:readPath parameters
- idstring
- project_idstring
- task_idstring
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /logsExample response
Status 200 Log content in JSONL format
Status 404 Task run not found
Create tasks runs relay message
Queue a Slack relay workflow to post a run message into the mapped Slack thread.
Required API key scopes
task:writePath parameters
- idstring
- project_idstring
- task_idstring
Request parameters
- textstring
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /relay_messageExample response
Status 200 Relay accepted
Status 404 Run not found
Retrieve tasks runs session logs
Fetch session log entries for a task run with optional filtering by timestamp, event type, and limit.
Required API key scopes
task:readPath parameters
- idstring
- project_idstring
- task_idstring
Query parameters
- afterstring
- event_typesstring
- exclude_typesstring
- limitintegerDefault:
1000
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /session_logsExample response
Status 200 Filtered log events as JSON array
Status 404 Task run not found
Update tasks runs set output
Update the output field for a task run (e.g., PR URL, commit SHA, etc.)
Required API key scopes
task:writePath parameters
- idstring
- project_idstring
- task_idstring
Response
Example request
PATCH /api /projects /:project_id /tasks /:task_id /runs /:id /set_outputExample response
Status 200 Run with updated output
Status 404 Run not found
Retrieve tasks runs stream
API for managing task runs. Each run represents an execution of a task.
Required API key scopes
task:readPath parameters
- idstring
- project_idstring
- task_idstring
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /streamExample response
Status 200
Retrieve tasks repository readiness
Get autonomy readiness details for a specific repository in the current project.
Required API key scopes
task:readPath parameters
- project_idstring
Query parameters
- refreshbooleanDefault:
false - repositorystring
- window_daysintegerDefault:
7
Response
Example request
GET /api /projects /:project_id /tasks /repository_readinessExample response
Status 200 Repository readiness status
Retrieve tasks repository readiness
Get autonomy readiness details for a specific repository in the current project.
Required API key scopes
task:readPath parameters
- project_idstring
Query parameters
- refreshbooleanDefault:
false - repositorystring
- window_daysintegerDefault:
7
Response
Example request
GET /api /projects /:project_id /tasks /repository_readiness