Tasks
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
POST | |
POST | |
POST | |
POST | |
GET | |
GET |
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
- imported_mcp_serversarray | null
- relayed_mcp_serversarray | null
- rtk_enabledboolean | null
- benjamin_enabledboolean | null
- claude_model_access
- codex_model_access
- environmentDefault:
local - modeDefault:
background - branchstring | null
- sandbox_environment_idstring
- custom_image_idstring
- pr_authorship_mode
- auto_publishboolean | null
- run_source
- signal_report_idstring
- runtime_adapter
- modelstring
- reasoning_effort
- context_window
- fast_modeboolean | null
- github_user_tokenstring
- initial_permission_mode
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 403 PostHog Desktop access is required, or Pi cloud runtime is disabled
Status 429 Team is over its posthog_code usage limit
Status 503 PostHog Desktop access could not be verified
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
- imported_mcp_serversarray | null
- relayed_mcp_serversarray | null
- rtk_enabledboolean | null
- benjamin_enabledboolean | null
- claude_model_access
- codex_model_access
- environmentDefault:
local - modeDefault:
background - branchstring | null
- sandbox_environment_idstring
- custom_image_idstring
- pr_authorship_mode
- auto_publishboolean | null
- run_source
- signal_report_idstring
- runtime_adapter
- modelstring
- reasoning_effort
- context_window
- fast_modeboolean | null
- github_user_tokenstring
- initial_permission_mode
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 403 PostHog Desktop access is required, or Pi cloud runtime is disabled
Status 429 Team is over its posthog_code usage limit
Status 503 PostHog Desktop access could not be verified
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
- branchstring | null
- stagestring | null
- output
- stateobject
- state_remove_keysarray
- state_appendobject
- error_messagestring | null
- error_type
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
- branchstring | null
- stagestring | null
- output
- stateobject
- state_remove_keysarray
- state_appendobject
- error_messagestring | null
- error_type
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 analysis activity
Store one activity record on a task-analysis run. Only the run's own task-bound sandbox agent may call it, and only on a task-analysis run. Activities arrive in log order and do not overlap. An exact repeat of a stored activity returns its index without storing it again. The activities list is server-owned: it is not writable through the run update endpoint.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- goal_kind
- goalstring
- outcome
- blocker_kind
- blocker_namestring | null
- repairstring | null
- evidencestring
- start_lineinteger
- end_lineinteger
- tool_callsinteger
- failed_callsinteger
- secondsinteger
- idle_secondsinteger
- commandsarray
- guidance_readarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /analysis-activityExample response
Status 201 Activity stored on the run, or the index of the identical activity already stored
Status 400 The activity is invalid, overlaps a stored activity, or the run already holds the maximum
Status 403 Only the run's own analysis sandbox may report activities
Status 404 Run not found
Create tasks runs analysis activity
Store one activity record on a task-analysis run. Only the run's own task-bound sandbox agent may call it, and only on a task-analysis run. Activities arrive in log order and do not overlap. An exact repeat of a stored activity returns its index without storing it again. The activities list is server-owned: it is not writable through the run update endpoint.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Request parameters
- goal_kind
- goalstring
- outcome
- blocker_kind
- blocker_namestring | null
- repairstring | null
- evidencestring
- start_lineinteger
- end_lineinteger
- tool_callsinteger
- failed_callsinteger
- secondsinteger
- idle_secondsinteger
- commandsarray
- guidance_readarray
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /analysis-activityExample response
Status 201 Activity stored on the run, or the index of the identical activity already stored
Status 400 The activity is invalid, overlaps a stored activity, or the run already holds the maximum
Status 403 Only the run's own analysis sandbox may report activities
Status 404 Run not found
Create tasks runs analyze
Create a PostHog-funded analysis task that reviews this run's transcript for inefficiencies and reports findings. Idempotent per run: if an analysis task already exists for this run, it is returned instead of creating another. The analysis is not billed to the customer.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /analyzeExample response
Status 200 An analysis task already exists for this run
Status 201 Analysis task created
Status 400 The run cannot be analyzed (for example, it has no log yet)
Status 403 AI data processing is not approved for this organization
Status 404 Run not found
Create tasks runs analyze
Create a PostHog-funded analysis task that reviews this run's transcript for inefficiencies and reports findings. Idempotent per run: if an analysis task already exists for this run, it is returned instead of creating another. The analysis is not billed to the customer.
Required API key scopes
task:writePath parameters
- idstring
- task_idstring
Response
Example request
POST /api /projects /:project_id /tasks /:task_id /runs /:id /analyzeExample response
Status 200 An analysis task already exists for this run
Status 201 Analysis task created
Status 400 The run cannot be analyzed (for example, it has no log yet)
Status 403 AI data processing is not approved for this organization
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
Status 503 Log is locked by another append; retry
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
Status 503 Log is locked by another append; retry
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
Retrieve tasks runs artifacts download
Redirects to a short-lived presigned URL for the artifact, so callers can share a stable link instead of a raw presigned URL.
Required API key scopes
task:readPath parameters
- artifact_idstring
- idstring
- task_idstring
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /:artifact_id /downloadExample response
Status 302 Redirect to a short-lived presigned download URL
Status 400 Unable to generate download URL
Status 404 Artifact not found
Retrieve tasks runs artifacts download
Redirects to a short-lived presigned URL for the artifact, so callers can share a stable link instead of a raw presigned URL.
Required API key scopes
task:readPath parameters
- artifact_idstring
- idstring
- task_idstring
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /:artifact_id /downloadExample response
Status 302 Redirect to a short-lived presigned download URL
Status 400 Unable to generate download URL
Status 404 Artifact not found
Retrieve tasks runs artifacts preview
Returns a short-lived URL for one HTML artifact version on the artifact origin. The page runs its scripts only when scripts=true.
Required API key scopes
task:readPath parameters
- artifact_idstring
- idstring
- task_idstring
Query parameters
- scriptsboolean
- versioninteger
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /:artifact_id /previewExample response
Status 200
Status 400 Invalid version or scripts value
Status 403 Scripts or analytics data are not available to the caller
Status 404 HTML artifact not found
Status 503 Artifact preview origin unavailable
Retrieve tasks runs artifacts preview
Returns a short-lived URL for one HTML artifact version on the artifact origin. The page runs its scripts only when scripts=true.
Required API key scopes
task:readPath parameters
- artifact_idstring
- idstring
- task_idstring
Query parameters
- scriptsboolean
- versioninteger
Response
Example request
GET /api /projects /:project_id /tasks /:task_id /runs /:id /artifacts /:artifact_id /preview










