PostHog tasks API

The tasks API from PostHog — 24 operation(s) for tasks.

OpenAPI Specification

posthog-tasks-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: PostHog actions tasks API
  version: 1.0.0
  description: ''
tags:
- name: tasks
paths:
  /api/projects/{project_id}/tasks/:
    get:
      operationId: tasks_list
      description: Get a list of tasks for the current project, with optional filtering by origin product, stage, organization, repository, and created_by.
      summary: List tasks
      parameters:
      - in: query
        name: created_by
        schema:
          type: integer
        description: Filter by creator user ID
      - in: query
        name: internal
        schema:
          type: boolean
        description: When true, list internal tasks instead of user-facing ones. Honored only in debug environments; ignored in production. Defaults to excluding internal tasks.
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: query
        name: organization
        schema:
          type: string
          minLength: 1
        description: Filter by repository organization
      - in: query
        name: origin_product
        schema:
          type: string
          minLength: 1
        description: Filter by origin product
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: query
        name: repository
        schema:
          type: string
          minLength: 1
        description: Filter by repository name (can include org/repo format)
      - in: query
        name: search
        schema:
          type: string
        description: Case-insensitive substring search over task title and description. A numeric value also matches the task number. An empty value disables the filter.
      - in: query
        name: stage
        schema:
          type: string
          minLength: 1
        description: Filter by task run stage
      - in: query
        name: status
        schema:
          enum:
          - not_started
          - queued
          - in_progress
          - completed
          - failed
          - cancelled
          type: string
          minLength: 1
        description: 'Filter tasks by the status of their most recent run.


          * `not_started` - not_started

          * `queued` - queued

          * `in_progress` - in_progress

          * `completed` - completed

          * `failed` - failed

          * `cancelled` - cancelled'
      tags:
      - tasks
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTaskList'
          description: List of tasks
      x-explicit-tags:
      - tasks
    post:
      operationId: tasks_create
      description: API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Task'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Task'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Task'
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
          description: ''
      x-explicit-tags:
      - tasks
  /api/projects/{project_id}/tasks/{id}/:
    get:
      operationId: tasks_retrieve
      description: API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
          description: ''
      x-explicit-tags:
      - tasks
    put:
      operationId: tasks_update
      description: API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Task'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Task'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Task'
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
          description: ''
      x-explicit-tags:
      - tasks
    patch:
      operationId: tasks_partial_update
      description: API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTask'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTask'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTask'
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
          description: ''
      x-explicit-tags:
      - tasks
    delete:
      operationId: tasks_destroy
      description: API for managing tasks within a project. Tasks represent units of work to be performed by an agent.
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '204':
          description: No response body
      x-explicit-tags:
      - tasks
  /api/projects/{project_id}/tasks/{id}/run/:
    post:
      operationId: tasks_run_create
      description: Create a new task run and kick off the workflow.
      summary: Run task
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunCreateRequestSchema'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunCreateRequestSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunCreateRequestSchema'
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
          description: Task with updated latest run
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunErrorResponse'
          description: Invalid task run payload
        '404':
          description: Task not found
      x-explicit-tags:
      - tasks
  /api/projects/{project_id}/tasks/{id}/staged_artifacts/finalize_upload/:
    post:
      operationId: tasks_staged_artifacts_finalize_upload_create
      description: Verify staged S3 uploads and cache their metadata so they can be attached to the next run created for this task.
      summary: Finalize staged direct uploads for task attachments
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskStagedArtifactsFinalizeUploadRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskStagedArtifactsFinalizeUploadRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskStagedArtifactsFinalizeUploadRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStagedArtifactsFinalizeUploadResponse'
          description: Finalized staged artifacts available for the next task run
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid artifact payload
        '404':
          description: Task not found
      x-explicit-tags:
      - tasks
  /api/projects/{project_id}/tasks/{id}/staged_artifacts/prepare_upload/:
    post:
      operationId: tasks_staged_artifacts_prepare_upload_create
      description: Reserve S3 object keys for task attachments before creating a new run and return presigned POST forms for direct uploads.
      summary: Prepare staged direct uploads for task attachments
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskStagedArtifactsPrepareUploadRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskStagedArtifactsPrepareUploadRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskStagedArtifactsPrepareUploadRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStagedArtifactsPrepareUploadResponse'
          description: Prepared staged uploads for the requested artifacts
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid artifact payload
        '404':
          description: Task not found
      x-explicit-tags:
      - tasks
  /api/projects/{project_id}/tasks/{task_id}/runs/:
    get:
      operationId: tasks_runs_list
      description: Get a list of runs for a specific task.
      summary: List task runs
      parameters:
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTaskRunDetailList'
          description: List of task runs
      x-explicit-tags:
      - task-runs
      - tasks
    post:
      operationId: tasks_runs_create
      description: Create a new run for a specific task without starting execution.
      summary: Create task run
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunBootstrapCreateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunBootstrapCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunBootstrapCreateRequest'
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunDetail'
          description: Created task run
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunErrorResponse'
          description: Invalid task run payload
      x-explicit-tags:
      - task-runs
      - tasks
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/:
    get:
      operationId: tasks_runs_retrieve
      description: API for managing task runs. Each run represents an execution of a task.
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunDetail'
          description: ''
      x-explicit-tags:
      - task-runs
    patch:
      operationId: tasks_runs_partial_update
      description: API for managing task runs. Each run represents an execution of a task.
      summary: Update task run
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTaskRunUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTaskRunUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTaskRunUpdate'
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunDetail'
          description: Updated task run
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid update data
        '404':
          description: Task run not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/append_log/:
    post:
      operationId: tasks_runs_append_log_create
      description: Append one or more log entries to the task run log array
      summary: Append log entries
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunAppendLogRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunAppendLogRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunAppendLogRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunDetail'
          description: Run with updated log
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid log entries
        '404':
          description: Run not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/:
    post:
      operationId: tasks_runs_artifacts_create
      description: Persist task artifacts to S3 and attach them to the run manifest.
      summary: Upload artifacts for a task run
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsUploadRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsUploadRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsUploadRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunArtifactsUploadResponse'
          description: Run with updated artifact manifest
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid artifact payload
        '404':
          description: Run not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/download/:
    post:
      operationId: tasks_runs_artifacts_download_create
      description: Streams artifact content for a task run artifact after validating that it belongs to the run.
      summary: Download an artifact through the backend
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactPresignRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactPresignRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactPresignRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          description: Artifact content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid request
        '404':
          description: Artifact not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/finalize_upload/:
    post:
      operationId: tasks_runs_artifacts_finalize_upload_create
      description: Verify directly uploaded S3 objects and attach them to the run artifact manifest.
      summary: Finalize direct uploads for task run artifacts
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsFinalizeUploadRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsFinalizeUploadRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsFinalizeUploadRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunArtifactsFinalizeUploadResponse'
          description: Run with updated artifact manifest
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid artifact payload
        '404':
          description: Run not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/prepare_upload/:
    post:
      operationId: tasks_runs_artifacts_prepare_upload_create
      description: Reserve S3 object keys for task artifacts and return presigned POST forms for direct uploads.
      summary: Prepare direct uploads for task run artifacts
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsPrepareUploadRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsPrepareUploadRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactsPrepareUploadRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunArtifactsPrepareUploadResponse'
          description: Prepared uploads for the requested artifacts
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid artifact payload
        '404':
          description: Run not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/artifacts/presign/:
    post:
      operationId: tasks_runs_artifacts_presign_create
      description: Returns a temporary, signed URL that can be used to download a specific artifact.
      summary: Generate presigned URL for an artifact
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactPresignRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactPresignRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunArtifactPresignRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunArtifactPresignResponse'
          description: Presigned URL for the requested artifact
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid request
        '404':
          description: Artifact not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/command/:
    post:
      operationId: tasks_runs_command_create
      description: Forward a JSON-RPC command to the agent server running in the sandbox. Supports user_message, cancel, close, permission_response, and set_config_option commands.
      summary: Send command to agent server
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRunCommandRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskRunCommandRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskRunCommandRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - task:write
      - PersonalAPIKeyAuth:
        - task:write
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskRunCommandResponse'
          description: Agent server response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid command or no active sandbox
        '404':
          description: Task run not found
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Agent server unreachable
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/connection_token/:
    get:
      operationId: tasks_runs_connection_token_retrieve
      description: Generate a JWT token for direct connection to the sandbox. Valid for 24 hours.
      summary: Get sandbox connection token
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionTokenResponse'
          description: Connection token for direct sandbox connection
        '404':
          description: Task run not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/logs/:
    get:
      operationId: tasks_runs_logs_retrieve
      description: Fetch the logs for a task run as JSONL. If the run resumes from another (state.resume_from_run_id), each ancestor's log is concatenated first (oldest ancestor → ... → this run) so resume consumers see a single continuous history and can find the most recent git_checkpoint event regardless of which run emitted it.
      summary: Get task run logs
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this task run.
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: task_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - tasks
      security:
      - PersonalAPIKeyAuth:
        - task:read
      - PersonalAPIKeyAuth:
        - task:read
      responses:
        '200':
          description: Log content in JSONL format
        '404':
          description: Task run not found
      x-explicit-tags:
      - task-runs
  /api/projects/{project_id}/tasks/{task_id}/runs/{id}/relay_message/:
    post:
      operationId: tasks_runs_relay_message_create
      description: Queue a Slack relay workflow to post a run message into the mapped Slack thread.
      summary: Relay run message to Slack
      parameters:
      - in: path
    

# --- truncated at 32 KB (95 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/posthog/refs/heads/main/openapi/posthog-tasks-api-openapi.yml