> ## 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 all Organizations

<ResponseExample>
  ```json Success Response (200) theme={null}
  {
    "count": 3,
    "status_code": 200,
    "message": "Organizations fetched successfully",
    "data": [
      {
        "id": 1,
        "name": "Unpod TV",
        "domain_handle": "unpod.tv",
        "created_at": "2024-01-15T10:30:00Z"
      },
      {
        "id": 2,
        "name": "Recalll",
        "domain_handle": "recalll.co",
        "created_at": "2024-03-20T08:00:00Z"
      }
    ]
  }
  ```

  ```json Error Response (401) theme={null}
  {
    "status_code": 401,
    "message": "Authentication credentials were not provided."
  }
  ```
</ResponseExample>

## Organizations API

Retrieve a list of all organizations associated with your API token. The `domain_handle` field in the response is used as the `Org-Handle` header in subsequent API requests.

### Response Fields

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

### Organization Object Fields

| Field          | Type    | Description                                        |
| -------------- | ------- | -------------------------------------------------- |
| id             | integer | Unique organization identifier                     |
| name           | string  | Organization display name                          |
| domain\_handle | string  | Domain handle used as `Org-Handle` in API requests |
| created\_at    | string  | Organization creation timestamp (ISO 8601)         |

***

## Common Error Codes

| Status Code | Description                                 |
| ----------- | ------------------------------------------- |
| 200         | Success - Request completed successfully    |
| 400         | Bad Request - Invalid parameters provided   |
| 401         | Unauthorized - Invalid or missing API token |
| 403         | Forbidden - Access denied to the resource   |
| 404         | Not Found - Organization 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',
    'Org-Handle': 'your-org-handle'
  };

  // Get all organizations
  const getOrganizations = async () => {
    const response = await axios.get(
      'https://unpod.ai/api/v2/platform/organizations/',
      { headers }
    );
    console.log(`Total organizations: ${response.data.count}`);
    response.data.data.forEach(org => {
      console.log(`${org.name} - Handle: ${org.domain_handle}`);
    });
    return response.data.data;
  };

  // Example usage
  getOrganizations();
  ```

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

  headers = {
      'Authorization': 'Token your-api-token',
      'Org-Handle': 'your-org-handle'
  }

  def get_organizations():
      """Get all organizations"""
      url = 'https://unpod.ai/api/v2/platform/organizations/'
      response = requests.get(url, headers=headers)
      data = response.json()
      print(f"Total organizations: {data['count']}")
      for org in data['data']:
          print(f"{org['name']} - Handle: {org['domain_handle']}")
      return data['data']

  # Example usage
  get_organizations()
  ```

  ```bash cURL theme={null}
  # Get all organizations
  curl -X GET "https://unpod.ai/api/v2/platform/organizations/" \
    -H "Authorization: Token your-api-token" \
    -H "Org-Handle: your-org-handle"
  ```
</CodeGroup>

## Best Practices

1. **Org-Handle**: Use the `domain_handle` from the response as the `Org-Handle` header in all subsequent requests
2. **Caching**: Cache organization data locally to reduce API calls since organizations change infrequently
3. **Error Handling**: Always handle potential errors and edge cases
4. **Security**: Keep API tokens secure and rotate them regularly
5. **Multiple Orgs**: If you have access to multiple organizations, store all handles and switch between them as needed


## OpenAPI

````yaml GET /api/v2/platform/organizations/
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/organizations/:
    get:
      tags:
        - Organisation
      summary: Get Organizations
      operationId: getOrganizations
      parameters:
        - $ref: '#/components/parameters/OrgHandle'
      responses:
        '200':
          description: List of organizations
          content:
            application/json:
              example:
                count: 3
                status_code: 200
                message: Organizations fetched successfully
                data:
                  - id: 1
                    name: Unpod TV
                    domain_handle: unpod.tv
                    created_at: '2024-01-15T10:30:00Z'
                  - id: 2
                    name: Recalll
                    domain_handle: recalll.co
                    created_at: '2024-03-20T08:00:00Z'
        '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>'

````