provider task-runstaskstasks POST /api/projects/{project_id}/tasks/{task_id}/runs/
@utdk/posthog /api/projects/{project_id}/tasks/{task_id}/runs/
Create task run
Create a new run for a specific task without starting execution.
project_id path required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
string
task_id path required
string

Try it

Authentication
Configure credentials for PostHog API
tasksRunsCreate
POST/api/projects/{project_id}/tasks/{task_id}/runs/
Create a new run for a specific task without starting execution.

Parameters

required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

required

Input

Execution environment for the new run. Use 'cloud' for remote sandbox runs and 'local' for desktop sessions. * `local` - local * `cloud` - cloud

Execution mode: 'interactive' for user-connected runs, 'background' for autonomous runs * `interactive` - interactive * `background` - background

Git branch to checkout in the sandbox

Optional sandbox environment to apply for this cloud run.

Optional custom base image for this cloud run's sandbox (Modal VM runtime only); takes precedence over the environment's image.

Whether pull requests for this run should be authored by the user or the bot. * `user` - user * `bot` - bot

When true, the cloud run agent pushes its work and opens a draft pull request on completion without waiting for an explicit ask.

High-level source that triggered this run, used to distinguish manual and signal-based cloud runs. * `manual` - manual * `signal_report` - signal_report

Optional signal report identifier when this run was started from Inbox.

Agent runtime adapter to launch for this run. Use 'claude' for the Claude runtime or 'codex' for the Codex runtime. * `claude` - claude * `codex` - codex

LLM model identifier to run in the selected runtime.

Reasoning effort to request for models that expose an effort control. * `low` - low * `medium` - medium * `high` - high * `xhigh` - xhigh * `max` - max

Ephemeral GitHub user token from PostHog Code for user-authored cloud pull requests.

Initial permission mode for the agent session. Claude runtimes accept PostHog permission presets like 'plan'. Codex runtimes accept native Codex modes like 'plan', 'auto', and 'read-only'. * `default` - default * `acceptEdits` - acceptEdits * `plan` - plan * `bypassPermissions` - bypassPermissions * `auto` - auto * `read-only` - read-only * `full-access` - full-access

Whether rtk command-output compression is enabled for this run. Omitted or null follows the server-side default (enabled); false opts this run out.

Label of the Home-tab quick action that started this run (e.g. 'Fix CI'), surfaced on the workstream.

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.tasksRunsCreate({
  "environment": "local",
  "mode": "background"
})