naftiko: 1.0.0-alpha2 info: label: PostHog API — task-runs description: 'PostHog API — task-runs. 19 operations. Lead operation: List task runs. Self-contained Naftiko capability covering one Posthog business surface.' tags: - Posthog - task-runs created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: POSTHOG_API_KEY: POSTHOG_API_KEY capability: consumes: - type: http namespace: posthog-task-runs baseUri: '' description: PostHog API — task-runs business capability. Self-contained, no shared references. resources: - name: api-projects-project_id-tasks-task_id-runs path: /api/projects/{project_id}/tasks/{task_id}/runs/ operations: - name: tasksrunslist method: GET description: List task runs outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: limit in: query type: integer description: Number of results to return per page. - name: offset in: query type: integer description: The initial index from which to return the results. - name: task_id in: path type: string required: true - name: tasksrunscreate method: POST description: Create task run outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: api-projects-project_id-tasks-task_id-runs-id path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/ operations: - name: tasksrunsretrieve method: GET description: API for managing task runs. Each run represents an execution of a task. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: tasksrunspartialupdate method: PATCH description: Update task run outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: api-projects-project_id-tasks-task_id-runs-id-append_log path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/append_log/ operations: - name: tasksrunsappendlogcreate method: POST description: Append log entries outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-artifacts path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/ operations: - name: tasksrunsartifactscreate method: POST description: Upload artifacts for a task run outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-artifacts-download path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/download/ operations: - name: tasksrunsartifactsdownloadcreate method: POST description: Download an artifact through the backend outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-artifacts-finalize_upload path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/finalize_upload/ operations: - name: tasksrunsartifactsfinalizeuploadcreate method: POST description: Finalize direct uploads for task run artifacts outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-artifacts-prepare_upload path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/prepare_upload/ operations: - name: tasksrunsartifactsprepareuploadcreate method: POST description: Prepare direct uploads for task run artifacts outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-artifacts-presign path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/presign/ operations: - name: tasksrunsartifactspresigncreate method: POST description: Generate presigned URL for an artifact outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-command path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/command/ operations: - name: tasksrunscommandcreate method: POST description: Send command to agent server outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-connection_token path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/connection_token/ operations: - name: tasksrunsconnectiontokenretrieve method: GET description: Get sandbox connection token outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: api-projects-project_id-tasks-task_id-runs-id-logs path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/logs/ operations: - name: tasksrunslogsretrieve method: GET description: Get task run logs outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: api-projects-project_id-tasks-task_id-runs-id-relay_message path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/relay_message/ operations: - name: tasksrunsrelaymessagecreate method: POST description: Relay run message to Slack outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: true - name: api-projects-project_id-tasks-task_id-runs-id-resume_in_cloud path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/resume_in_cloud/ operations: - name: tasksrunsresumeincloudcreate method: POST description: Resume task run in cloud outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: api-projects-project_id-tasks-task_id-runs-id-session_logs path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/session_logs/ operations: - name: tasksrunssessionlogsretrieve method: GET description: Get filtered task run session logs outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: after in: query type: string description: Only return events after this ISO8601 timestamp - name: event_types in: query type: string description: Comma-separated list of event types to include - name: exclude_types in: query type: string description: Comma-separated list of event types to exclude - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: limit in: query type: integer description: Maximum number of entries to return (default 1000, max 5000) - name: offset in: query type: integer description: Zero-based offset into the filtered log entries - name: task_id in: path type: string required: true - name: api-projects-project_id-tasks-task_id-runs-id-set_output path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/set_output/ operations: - name: tasksrunssetoutputpartialupdate method: PATCH description: Set run output outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: api-projects-project_id-tasks-task_id-runs-id-start path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/start/ operations: - name: tasksrunsstartcreate method: POST description: Start task run outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: api-projects-project_id-tasks-task_id-runs-id-stream path: /api/projects/{project_id}/tasks/{task_id}/runs/{id}/stream/ operations: - name: tasksrunsstreamretrieve method: GET description: API for managing task runs. Each run represents an execution of a task. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: A UUID string identifying this task run. required: true - name: task_id in: path type: string required: true authentication: type: bearer token: '{{env.POSTHOG_API_KEY}}' exposes: - type: rest namespace: posthog-task-runs-rest port: 8080 description: REST adapter for PostHog API — task-runs. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs name: api-projects-project-id-tasks-task-id-runs description: REST surface for api-projects-project_id-tasks-task_id-runs. operations: - method: GET name: tasksrunslist description: List task runs call: posthog-task-runs.tasksrunslist with: limit: rest.limit offset: rest.offset task_id: rest.task_id outputParameters: - type: object mapping: $. - method: POST name: tasksrunscreate description: Create task run call: posthog-task-runs.tasksrunscreate with: task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id} name: api-projects-project-id-tasks-task-id-runs-id description: REST surface for api-projects-project_id-tasks-task_id-runs-id. operations: - method: GET name: tasksrunsretrieve description: API for managing task runs. Each run represents an execution of a task. call: posthog-task-runs.tasksrunsretrieve with: id: rest.id task_id: rest.task_id outputParameters: - type: object mapping: $. - method: PATCH name: tasksrunspartialupdate description: Update task run call: posthog-task-runs.tasksrunspartialupdate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/append-log name: api-projects-project-id-tasks-task-id-runs-id-append-log description: REST surface for api-projects-project_id-tasks-task_id-runs-id-append_log. operations: - method: POST name: tasksrunsappendlogcreate description: Append log entries call: posthog-task-runs.tasksrunsappendlogcreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/artifacts name: api-projects-project-id-tasks-task-id-runs-id-artifacts description: REST surface for api-projects-project_id-tasks-task_id-runs-id-artifacts. operations: - method: POST name: tasksrunsartifactscreate description: Upload artifacts for a task run call: posthog-task-runs.tasksrunsartifactscreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/artifacts/download name: api-projects-project-id-tasks-task-id-runs-id-artifacts-download description: REST surface for api-projects-project_id-tasks-task_id-runs-id-artifacts-download. operations: - method: POST name: tasksrunsartifactsdownloadcreate description: Download an artifact through the backend call: posthog-task-runs.tasksrunsartifactsdownloadcreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/artifacts/finalize-upload name: api-projects-project-id-tasks-task-id-runs-id-artifacts-finalize-upload description: REST surface for api-projects-project_id-tasks-task_id-runs-id-artifacts-finalize_upload. operations: - method: POST name: tasksrunsartifactsfinalizeuploadcreate description: Finalize direct uploads for task run artifacts call: posthog-task-runs.tasksrunsartifactsfinalizeuploadcreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/artifacts/prepare-upload name: api-projects-project-id-tasks-task-id-runs-id-artifacts-prepare-upload description: REST surface for api-projects-project_id-tasks-task_id-runs-id-artifacts-prepare_upload. operations: - method: POST name: tasksrunsartifactsprepareuploadcreate description: Prepare direct uploads for task run artifacts call: posthog-task-runs.tasksrunsartifactsprepareuploadcreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/artifacts/presign name: api-projects-project-id-tasks-task-id-runs-id-artifacts-presign description: REST surface for api-projects-project_id-tasks-task_id-runs-id-artifacts-presign. operations: - method: POST name: tasksrunsartifactspresigncreate description: Generate presigned URL for an artifact call: posthog-task-runs.tasksrunsartifactspresigncreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/command name: api-projects-project-id-tasks-task-id-runs-id-command description: REST surface for api-projects-project_id-tasks-task_id-runs-id-command. operations: - method: POST name: tasksrunscommandcreate description: Send command to agent server call: posthog-task-runs.tasksrunscommandcreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/connection-token name: api-projects-project-id-tasks-task-id-runs-id-connection-token description: REST surface for api-projects-project_id-tasks-task_id-runs-id-connection_token. operations: - method: GET name: tasksrunsconnectiontokenretrieve description: Get sandbox connection token call: posthog-task-runs.tasksrunsconnectiontokenretrieve with: id: rest.id task_id: rest.task_id outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/logs name: api-projects-project-id-tasks-task-id-runs-id-logs description: REST surface for api-projects-project_id-tasks-task_id-runs-id-logs. operations: - method: GET name: tasksrunslogsretrieve description: Get task run logs call: posthog-task-runs.tasksrunslogsretrieve with: id: rest.id task_id: rest.task_id outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/relay-message name: api-projects-project-id-tasks-task-id-runs-id-relay-message description: REST surface for api-projects-project_id-tasks-task_id-runs-id-relay_message. operations: - method: POST name: tasksrunsrelaymessagecreate description: Relay run message to Slack call: posthog-task-runs.tasksrunsrelaymessagecreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/resume-in-cloud name: api-projects-project-id-tasks-task-id-runs-id-resume-in-cloud description: REST surface for api-projects-project_id-tasks-task_id-runs-id-resume_in_cloud. operations: - method: POST name: tasksrunsresumeincloudcreate description: Resume task run in cloud call: posthog-task-runs.tasksrunsresumeincloudcreate with: id: rest.id task_id: rest.task_id outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/session-logs name: api-projects-project-id-tasks-task-id-runs-id-session-logs description: REST surface for api-projects-project_id-tasks-task_id-runs-id-session_logs. operations: - method: GET name: tasksrunssessionlogsretrieve description: Get filtered task run session logs call: posthog-task-runs.tasksrunssessionlogsretrieve with: after: rest.after event_types: rest.event_types exclude_types: rest.exclude_types id: rest.id limit: rest.limit offset: rest.offset task_id: rest.task_id outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/set-output name: api-projects-project-id-tasks-task-id-runs-id-set-output description: REST surface for api-projects-project_id-tasks-task_id-runs-id-set_output. operations: - method: PATCH name: tasksrunssetoutputpartialupdate description: Set run output call: posthog-task-runs.tasksrunssetoutputpartialupdate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/start name: api-projects-project-id-tasks-task-id-runs-id-start description: REST surface for api-projects-project_id-tasks-task_id-runs-id-start. operations: - method: POST name: tasksrunsstartcreate description: Start task run call: posthog-task-runs.tasksrunsstartcreate with: id: rest.id task_id: rest.task_id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/api/projects/{project-id}/tasks/{task-id}/runs/{id}/stream name: api-projects-project-id-tasks-task-id-runs-id-stream description: REST surface for api-projects-project_id-tasks-task_id-runs-id-stream. operations: - method: GET name: tasksrunsstreamretrieve description: API for managing task runs. Each run represents an execution of a task. call: posthog-task-runs.tasksrunsstreamretrieve with: id: rest.id task_id: rest.task_id outputParameters: - type: object mapping: $. - type: mcp namespace: posthog-task-runs-mcp port: 9090 transport: http description: MCP adapter for PostHog API — task-runs. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: list-task-runs description: List task runs hints: readOnly: true destructive: false idempotent: true call: posthog-task-runs.tasksrunslist with: limit: tools.limit offset: tools.offset task_id: tools.task_id outputParameters: - type: object mapping: $. - name: create-task-run description: Create task run hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunscreate with: task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: api-managing-task-runs-each description: API for managing task runs. Each run represents an execution of a task. hints: readOnly: true destructive: false idempotent: true call: posthog-task-runs.tasksrunsretrieve with: id: tools.id task_id: tools.task_id outputParameters: - type: object mapping: $. - name: update-task-run description: Update task run hints: readOnly: false destructive: false idempotent: true call: posthog-task-runs.tasksrunspartialupdate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: append-log-entries description: Append log entries hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsappendlogcreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: upload-artifacts-task-run description: Upload artifacts for a task run hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsartifactscreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: download-artifact-through-backend description: Download an artifact through the backend hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsartifactsdownloadcreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: finalize-direct-uploads-task-run description: Finalize direct uploads for task run artifacts hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsartifactsfinalizeuploadcreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: prepare-direct-uploads-task-run description: Prepare direct uploads for task run artifacts hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsartifactsprepareuploadcreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: generate-presigned-url-artifact description: Generate presigned URL for an artifact hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsartifactspresigncreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: send-command-agent-server description: Send command to agent server hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunscommandcreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: get-sandbox-connection-token description: Get sandbox connection token hints: readOnly: true destructive: false idempotent: true call: posthog-task-runs.tasksrunsconnectiontokenretrieve with: id: tools.id task_id: tools.task_id outputParameters: - type: object mapping: $. - name: get-task-run-logs description: Get task run logs hints: readOnly: true destructive: false idempotent: true call: posthog-task-runs.tasksrunslogsretrieve with: id: tools.id task_id: tools.task_id outputParameters: - type: object mapping: $. - name: relay-run-message-slack description: Relay run message to Slack hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsrelaymessagecreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: resume-task-run-cloud description: Resume task run in cloud hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsresumeincloudcreate with: id: tools.id task_id: tools.task_id outputParameters: - type: object mapping: $. - name: get-filtered-task-run-session description: Get filtered task run session logs hints: readOnly: true destructive: false idempotent: true call: posthog-task-runs.tasksrunssessionlogsretrieve with: after: tools.after event_types: tools.event_types exclude_types: tools.exclude_types id: tools.id limit: tools.limit offset: tools.offset task_id: tools.task_id outputParameters: - type: object mapping: $. - name: set-run-output description: Set run output hints: readOnly: false destructive: false idempotent: true call: posthog-task-runs.tasksrunssetoutputpartialupdate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: start-task-run description: Start task run hints: readOnly: false destructive: false idempotent: false call: posthog-task-runs.tasksrunsstartcreate with: id: tools.id task_id: tools.task_id body: tools.body outputParameters: - type: object mapping: $. - name: api-managing-task-runs-each-2 description: API for managing task runs. Each run represents an execution of a task. hints: readOnly: true destructive: false idempotent: true call: posthog-task-runs.tasksrunsstreamretrieve with: id: tools.id task_id: tools.task_id outputParameters: - type: object mapping: $.