> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unpod.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Detailed Tasks for a Specific Run

> Retrieve all tasks with full execution details for a specific run

<ResponseExample>
  ```json Success Response (200) theme={null}
  {
    "count": 9,
    "status_code": 200,
    "message": "Tasks Fetched Successfully",
    "data": [
      {
        "_id": "697debb84c27faa892bfa0cc",
        "thread_id": "thread_9xkL2mQpR7vNwY4sZ3cJ8hF1",
        "user_info": {
          "email": "user@example.com",
          "full_name": "John Doe"
        },
        "task_id": "T8ff2ccdffe9a11f0878d43cd8a99e069",
        "run_id": "Recac64fe03e911f1878d43cd8a99e069",
        "task": {
          "objective": "Call the lead and discuss the project requirements."
        },
        "input": {
          "name": "John Doe",
          "contact_number": "1234567890",
          "email": "john@example.com",
          "context": "Follow up on proposal"
        },
        "output": {
          "call_id": "CALL_7dAb3kR9mXvQ2pLw",
          "start_time": "2026-02-07T05:57:45Z",
          "end_time": "2026-02-07T06:02:30Z",
          "duration": 285,
          "recording_url": "https://cdn.unpod.ai/recordings/CALL_7dAb3kR9mXvQ2pLw.mp3",
          "transcript": [
            {
              "role": "agent",
              "content": "Hello, this is an AI assistant calling on behalf of Unpod. Am I speaking with John Doe?"
            },
            {
              "role": "user",
              "content": "Yes, this is John."
            }
          ],
          "post_call_data": {
            "summary": "The agent successfully connected with John Doe and discussed project requirements.",
            "outcome": "interested",
            "sentiment": "positive"
          },
          "call_type": "outbound",
          "call_status": "completed"
        },
        "assignee": "space-agent-8qmk42nslp91wrh3dz7btxc4",
        "status": "completed",
        "execution_type": "call",
        "created": "2026-02-07T05:57:45Z",
        "modified": "2026-02-07T06:02:35Z"
      }
    ]
  }
  ```

  ```json Error Response (206) theme={null}
  {
    "message": "Error retrieving run tasks",
    "errors": "Detailed error description"
  }
  ```
</ResponseExample>

# Get Detailed Tasks for a Specific Run

Fetch all tasks for a specific run, including complete input, output, call transcript, costs, analysis, artifacts, and provider metadata. This endpoint is used when you need deep inspection of how a run executed each task.

<Note>
  **Prerequisites:** Make sure you have your API Token ready. See [Authentication](/api/get-started/authentication) for details.
</Note>

***

### Path Parameters

| Name         | Type   | Required | Description                        |
| ------------ | ------ | -------- | ---------------------------------- |
| space\_token | string | Yes      | Public token of the space          |
| run\_id      | string | Yes      | The run ID whose tasks to retrieve |

<Note>
  You can get the `space_token` from the [Get All Spaces](/api/space/get-all-spaces) API. The `run_id` can be obtained from the [Get All Runs](/api/execution/get-all-runs) API response.
</Note>

### Headers

| Name          | Type   | Required | Description                     |
| ------------- | ------ | -------- | ------------------------------- |
| Authorization | string | Yes      | API Key format: `Token <token>` |
| Content-Type  | string | Yes      | `application/json`              |

### Response Fields

| Field        | Type    | Description           |
| ------------ | ------- | --------------------- |
| count        | integer | Total number of tasks |
| status\_code | integer | HTTP status code      |
| message      | string  | Response message      |
| data         | array   | Array of task objects |

### Task Object Fields

| Field           | Type   | Description                                   |
| --------------- | ------ | --------------------------------------------- |
| \_id            | string | Internal task document ID                     |
| thread\_id      | string | Thread identifier                             |
| user\_info      | object | User details (email, full\_name)              |
| task\_id        | string | Unique task identifier                        |
| run\_id         | string | Parent run identifier                         |
| task            | object | Task definition with objective                |
| input           | object | Input data for the task                       |
| output          | object | Task output including call details            |
| assignee        | string | Agent handle assigned to the task             |
| status          | string | Task status: `pending`, `completed`, `failed` |
| execution\_type | string | Type of execution: `call`, `email`, etc.      |
| created         | string | Task creation timestamp                       |
| modified        | string | Last modified timestamp                       |

### Output Object Fields

| Field            | Type   | Description                      |
| ---------------- | ------ | -------------------------------- |
| call\_id         | string | Unique call identifier           |
| start\_time      | string | Call start timestamp             |
| end\_time        | string | Call end timestamp               |
| duration         | number | Call duration in seconds         |
| recording\_url   | string | URL to call recording            |
| transcript       | array  | Array of conversation messages   |
| post\_call\_data | object | Post-call analysis data          |
| call\_type       | string | Direction: `outbound`, `inbound` |
| call\_status     | string | Status of the call               |

***

## Common Error Codes

| Status Code | Description                                     |
| ----------- | ----------------------------------------------- |
| 200         | Success - Data fetched successfully             |
| 206         | Partial Content - Business logic error occurred |
| 400         | Bad Request - Invalid parameters provided       |
| 401         | Unauthorized - Invalid or missing API token     |
| 403         | Forbidden - Access denied to the resource       |
| 404         | Not Found - Space or Run not found              |
| 500         | Internal Server Error - Server-side error       |

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const axios = require('axios');

  const headers = {
    'Authorization': 'Token your-api-token',
    'Content-Type': 'application/json'
  };

  // Get tasks for a specific run
  const getRunTasks = async (spaceToken, runId) => {
    const response = await axios.get(
      `https://unpod.ai/api/v2/platform/spaces/${spaceToken}/runs/${runId}/tasks/`,
      { headers }
    );
    console.log(`Total tasks: ${response.data.count}`);
    response.data.data.forEach(task => {
      console.log(`Task ${task.task_id}: ${task.status}`);
      if (task.output?.duration) {
        console.log(`  Duration: ${task.output.duration}s`);
      }
    });
    return response.data.data;
  };

  // Example usage
  getRunTasks('8KZAMRAHSXXXXXXMAYNASMJC', 'Recac64fe03e911f1878d43cd8a99e069');
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'Authorization': 'Token your-api-token',
      'Content-Type': 'application/json'
  }

  def get_run_tasks(space_token: str, run_id: str):
      """Get all tasks for a specific run"""
      url = f'https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/{run_id}/tasks/'
      response = requests.get(url, headers=headers)
      data = response.json()
      print(f"Total tasks: {data['count']}")
      for task in data['data']:
          print(f"Task {task['task_id']}: {task['status']}")
          if task.get('output', {}).get('duration'):
              print(f"  Duration: {task['output']['duration']}s")
      return data['data']

  # Example usage
  get_run_tasks('8KZAMRAHSXXXXXXMAYNASMJC', 'Recac64fe03e911f1878d43cd8a99e069')
  ```

  ```bash cURL theme={null}
  # Get tasks for a specific run
  curl -X GET "https://unpod.ai/api/v2/platform/spaces/8KZAMRAHSXXXXXXMAYNASMJC/runs/Recac64fe03e911f1878d43cd8a99e069/tasks/" \
    -H "Authorization: Token your-api-token" \
    -H "Content-Type: application/json"
  ```
</CodeGroup>

## Best Practices

1. **Run ID**: Always retrieve the `run_id` from the [Get All Runs](/api/execution/get-all-runs) endpoint first
2. **Transcript Review**: Use the `transcript` array in output for conversation quality analysis
3. **Recording Access**: Store `recording_url` for compliance, QA, and playback
4. **Post-call Data**: Check `post_call_data.summary` for AI-generated call summaries and outcomes
5. **Error Handling**: Always handle potential errors and edge cases
6. **Security**: Keep API tokens secure and rotate them regularly


## OpenAPI

````yaml GET /api/v2/platform/spaces/{space_token}/runs/{run_id}/tasks/
openapi: 3.0.3
info:
  title: Unpod API
  description: REST API for Unpod Voice AI Platform
  version: 2.0.0
servers:
  - url: https://unpod.ai/
    description: QA
  - url: https://unpod.ai/
    description: Production
security: []
tags:
  - name: Organisation
  - name: Spaces
  - name: Agents
  - name: Tasks
  - name: Runs
  - name: Call Logs
  - name: Analytics
  - name: Providers
  - name: Bridges
  - name: Numbers
  - name: Trunks
  - name: Telephony
  - name: Billing
paths:
  /api/v2/platform/spaces/{space_token}/runs/{run_id}/tasks/:
    get:
      tags:
        - Runs
      summary: Get Detailed Tasks for a Specific Run
      operationId: getRunTasks
      parameters:
        - name: space_token
          in: path
          required: true
          schema:
            type: string
            example: 8KZAMRAHSXXXXXXMAYNASMJC
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            example: Recac64fe03e911f1878d43cd8a99e069
        - $ref: '#/components/parameters/OrgHandle'
      responses:
        '200':
          description: List of tasks for the run
          content:
            application/json:
              example:
                count: 9
                status_code: 200
                message: Tasks Fetched Successfully
                data:
                  - _id: 697debb84c27faa892bfa0cc
                    thread_id: thread_9xkL2mQpR7vNwY4sZ3cJ8hF1
                    user_info:
                      email: user@example.com
                      full_name: John Doe
                    task_id: T8ff2ccdffe9a11f0878d43cd8a99e069
                    run_id: Recac64fe03e911f1878d43cd8a99e069
                    task:
                      objective: Call the lead and discuss the project requirements.
                    input:
                      name: John Doe
                      contact_number: '1234567890'
                      email: john@example.com
                      context: Follow up on proposal
                    output:
                      call_id: CALL_7dAb3kR9mXvQ2pLw
                      start_time: '2026-02-07T05:57:45Z'
                      end_time: '2026-02-07T06:02:30Z'
                      duration: 285
                      recording_url: >-
                        https://cdn.unpod.dev/recordings/CALL_7dAb3kR9mXvQ2pLw.mp3
                      transcript:
                        - role: agent
                          content: >-
                            Hello, this is an AI assistant. Am I speaking with
                            John Doe?
                        - role: user
                          content: Yes, this is John.
                      post_call_data:
                        summary: >-
                          Agent connected with John Doe and discussed project
                          requirements.
                        outcome: interested
                        sentiment: positive
                      call_type: outbound
                      call_status: completed
                    assignee: space-agent-8qmk42nslp91wrh3dz7btxc4
                    status: completed
                    execution_type: call
                    created: '2026-02-07T05:57:45Z'
                    modified: '2026-02-07T06:02:35Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - TokenAuth: []
components:
  parameters:
    OrgHandle:
      name: Org-Handle
      in: header
      required: true
      schema:
        type: string
        example: unpod.tv
      description: Organization domain handle
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API token
      content:
        application/json:
          example:
            status_code: 401
            message: Authentication credentials were not provided.
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Format: Token <your-api-key>'

````