PostHog Task Runs API

The task-runs API from PostHog — 17 operation(s) for task-runs.

GitHub OpenAPI

Operations 19

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/projects/{project_id}/tasks/{task_id}/runs/ List runs of a task · List task runs #
Ask an LLM
“Which runs have been executed for a given task?”
“Can I page through a task's run history?”
Tell an agent
List runs of task {task_id} in project {project_id}.
Show {limit} runs for task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/ Create a task run without starting it · Create task run #
Ask an LLM
“How do I create a new run for a task without starting execution?”
“Can I choose the execution environment and model for a new run?”
Tell an agent
Create a run for task {task_id} in project {project_id}.
Create a {mode} run of task {task_id} in project {project_id} on model {model}.
GET /api/projects/{project_id}/tasks/{task_id}/runs/{id}/ Get a task run · Tasks runs retrieve #
Ask an LLM
“What is the status and output of a specific task run?”
“Can I look up one run of a task by its ID?”
Tell an agent
Get run {id} of task {task_id} in project {project_id}.
Show the status of task run {id} for task {task_id} in project {project_id}.
PATCH /api/projects/{project_id}/tasks/{task_id}/runs/{id}/ Update a task run · Update task run #
Ask an LLM
“Can I change the status or output of an existing task run?”
“Is it possible to set the error message on a failed run?”
Tell an agent
Set the status of run {id} of task {task_id} in project {project_id} to {status}.
Update the output of task run {id} for task {task_id} in project {project_id} to {output}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/append_log/ Append log entries to a task run · Append log entries #
Ask an LLM
“How do I add log entries to a task run after the fact?”
“Can I append several log lines to a run's log array?”
Tell an agent
Append log entries {entries} to run {id} of task {task_id} in project {project_id}.
Add these log lines to task run {id} for task {task_id} in project {project_id}: {entries}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/ Upload artifacts to a task run · Upload artifacts for a task run #
Ask an LLM
“How do I attach files to a task run?”
“Can I upload artifacts to a run so they show up in the manifest?”
Tell an agent
Upload artifacts {artifacts} to run {id} of task {task_id} in project {project_id}.
Attach these files to task run {id} for task {task_id} in project {project_id}: {artifacts}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/download/ Download an artifact from a task run · Download an artifact through the backend #
Ask an LLM
“How do I download an artifact that was saved in a task run?”
“Can I fetch a file from a run's artifact manifest by its storage path?”
Tell an agent
Download artifact {storage_path} from run {id} of task {task_id} in project {project_id}.
Fetch the saved file {storage_path} attached to task run {id} for task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/finalize_upload/ Finalize direct uploads of task run artifacts · Finalize direct uploads for task run artifacts #
Ask an LLM
“How do I confirm S3 objects I uploaded directly so they appear in a run's manifest?”
“Can I finalize a batch of directly uploaded artifacts for a task run?”
Tell an agent
Finalize uploaded artifacts {artifacts} for run {id} of task {task_id} in project {project_id}.
Confirm the direct uploads {artifacts} so they are attached to task run {id} for task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/prepare_upload/ Prepare S3 keys for task run artifacts · Prepare direct uploads for task run artifacts #
Ask an LLM
“How do I get presigned URLs to upload files directly to S3 for a task run?”
“Can I reserve S3 object keys before uploading artifacts to a run?”
Tell an agent
Prepare S3 keys for artifacts {artifacts} in run {id} of task {task_id} in project {project_id}.
Reserve storage keys for {artifacts} so I can upload them to task run {id} for task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/presign/ Get a presigned URL for a task run artifact · Generate presigned URL for an artifact #
Ask an LLM
“How do I get a temporary link to download an artifact from a task run?”
“Can I generate a signed URL for a file in a run's artifact manifest?”
Tell an agent
Generate a presigned URL for artifact {storage_path} in run {id} of task {task_id} in project {project_id}.
Give me a download link for {storage_path} saved in task run {id} for task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/command/ Send a command to the agent server of a run · Send command to agent server #
Ask an LLM
“How do I send a user message to the agent running in a task run?”
“Can I cancel or close a task run from the outside?”
Tell an agent
Send command {method} to the agent server of run {id} of task {task_id} in project {project_id}.
Forward a {method} JSON-RPC call to task run {id} for task {task_id} in project {project_id}.
GET /api/projects/{project_id}/tasks/{task_id}/runs/{id}/connection_token/ Get a JWT for connecting to a run's sandbox · Get sandbox connection token #
Ask an LLM
“How do I get a connection token to attach to the sandbox of a task run?”
“How long is the sandbox connection token valid?”
Tell an agent
Get a sandbox connection token for run {id} of task {task_id} in project {project_id}.
Generate a JWT to connect to the sandbox of task run {id} for task {task_id} in project {project_id}.
GET /api/projects/{project_id}/tasks/{task_id}/runs/{id}/logs/ Get the full log of a task run · Get task run logs #
Ask an LLM
“What did the agent say in a task run's full log?”
“Can I fetch the complete log history of a run, including its ancestors?”
Tell an agent
Get the full log of run {id} of task {task_id} in project {project_id}.
Fetch every log line from task run {id} for task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/relay_message/ Post a message from a run to Slack · Relay run message to Slack #
Ask an LLM
“How do I post a message from a task run into a Slack thread?”
“Can I queue a Slack relay workflow for a run's output?”
Tell an agent
Relay the message {text} from run {id} of task {task_id} in project {project_id} to Slack.
Queue Slack relay of {text} for task run {id} of task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/resume_in_cloud/ Resume a task run in the cloud sandbox · Resume task run in cloud #
Ask an LLM
“How do I move an existing task run back into a cloud sandbox?”
“Does resuming a run terminate the current workflow and start a new one?”
Tell an agent
Resume run {id} of task {task_id} in project {project_id} in the cloud.
Move task run {id} for task {task_id} in project {project_id} back into a cloud sandbox.
GET /api/projects/{project_id}/tasks/{task_id}/runs/{id}/session_logs/ Get filtered session logs of a task run · Get filtered task run session logs #
Ask an LLM
“Can I filter a task run's session logs by event type?”
“How do I see only the session log entries after a certain time?”
Tell an agent
Get session logs of run {id} of task {task_id} in project {project_id} after {after}.
Show {event_types} session log entries for task run {id} of task {task_id} in project {project_id}.
PATCH /api/projects/{project_id}/tasks/{task_id}/runs/{id}/set_output/ Set the output field of a task run · Set run output #
Ask an LLM
“How do I record the PR URL or commit SHA a task run produced?”
“Can I update a run's output field after it completes?”
Tell an agent
Set the output of run {id} of task {task_id} in project {project_id} to {output}.
Record {output} as the output of task run {id} for task {task_id} in project {project_id}.
POST /api/projects/{project_id}/tasks/{task_id}/runs/{id}/start/ Start a task run in the cloud sandbox · Start task run #
Ask an LLM
“How do I start a task run that was created but not yet executed?”
“Can I attach pending user messages and artifacts when starting a run?”
Tell an agent
Start run {id} of task {task_id} in project {project_id}.
Start task run {id} for task {task_id} in project {project_id} with pending message {pending_user_message}.
GET /api/projects/{project_id}/tasks/{task_id}/runs/{id}/stream/ Get the streaming output of a task run · Tasks runs stream retrieve #
Ask an LLM
“How do I stream the output of a running task run?”
“Can I follow a task run's output in real time?”
Tell an agent
Get the streaming output of run {id} of task {task_id} in project {project_id}.
Stream the output of task run {id} for task {task_id} in project {project_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/posthog:posthog-task-runs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

posthog-task-runs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PostHog Task Runs API
  version: 1.0.0
  description: ''
tags:


# --- truncated at 32 KB (60 KB total) ---
# Full source: https://artifacts.apis.io/posthog/openapi/posthog-task-runs-api-openapi.yml