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

# List companies

> List company profiles for the API-key tenant (requires companies:read scope).

Requires scope **`companies:read`** (granted by Super Admin when your key is approved).

Use each company’s `id` when creating/updating an inbound agent (`companyId`).

Responses never include SMTP passwords, WhatsApp tokens, or `omniChannelSettings`.

```json theme={"system"}
{
  "companies": [
    {
      "id": "507f1f77bcf86cd799439011",
      "name": "Acme Clinic",
      "mobile": "+919876543210",
      "industry": "Healthcare",
      "timezone": "(UTC+5:30) Chennai, Kolkata, Mumbai, New Delhi (IST)",
      "createdAt": "2026-01-15T10:00:00.000Z",
      "updatedAt": "2026-01-15T10:00:00.000Z"
    }
  ]
}
```

Missing scope → `403` with `reasonCode: "forbidden"` and `missing: ["companies:read"]`.


## OpenAPI

````yaml openapi.json GET /api/v1/companies
openapi: 3.0.3
info:
  title: Ondial Public API
  version: 1.0.0
  description: >-
    Tenant API-key surface for lead ingest, contacts (including dial
    conversation + analysis), events, inbound agents, company profiles, and
    knowledge-base documents.


    **Campaign definition is UI-only** — create and start an API-ingest campaign
    in the dashboard, then push leads here.


    **Auth:** `Authorization: Bearer ond_live_…` or `ond_test_…` (or
    `X-API-Key`). Keys are requested in **API Access** with a friendly **key
    name**, then approved by Super Admin (not self-serve). Tenants can rename
    keys later without rotating the secret.


    **Scopes:** Company and knowledge-base routes require opt-in scopes
    (`companies:read`, `companies:write`, `knowledge:read`, `knowledge:write`)
    granted at key approval. Missing scope → `403 forbidden`.


    **Sandbox** keys never place PSTN dials or live WhatsApp/email and do not
    burn credits (KB upload skips debit).


    **Security:** Company responses never include SMTP/WhatsApp credentials. KB
    v1 is metadata-only — no file download.


    **Kill switch:** Super Admin can disable all `/api/v1/*` (`503` /
    `api_globally_disabled`) without stopping UI CSV campaigns.


    **Compliance:** Call channel requires `consent.outboundCall: true` and phone
    not on tenant/platform DNC.
servers:
  - url: https://dashboard.ondial.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security:
  - BearerAuth: []
tags:
  - name: Core
    description: Auth check and lead ingest
  - name: Contacts
    description: Status, dials/conversation/analysis, cancel, delete, follow-ups, list
  - name: Events
    description: ERP event bus slice — eventType → campaign
  - name: Outbound
    description: >-
      Read-only campaign lookup for API / Custom CRM. Create and start campaigns
      in the dashboard.
  - name: Inbound agents
    description: Configure inbound agents; list/buy pool numbers; read credits
  - name: Companies
    description: >-
      Company profile CRUD (requires companies:read / companies:write scopes).
      Never returns SMTP or WhatsApp credentials.
  - name: Knowledge bases
    description: >-
      Knowledge document upload/list/delete (requires knowledge:read /
      knowledge:write scopes). Metadata only — no file download via API.
paths:
  /api/v1/companies:
    get:
      tags:
        - Companies
      summary: List company profiles
      description: >-
        Lists all company profiles owned by the API-key tenant. Requires scope
        `companies:read`. Never returns `omniChannelSettings` or credentials.
      operationId: listCompanies
      responses:
        '200':
          description: Company list
          content:
            application/json:
              schema:
                type: object
                properties:
                  companies:
                    type: array
                    items:
                      $ref: '#/components/schemas/CompanyProfile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Missing companies:read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              example:
                error: Insufficient scope
                reasonCode: forbidden
                missing:
                  - companies:read
components:
  schemas:
    CompanyProfile:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        mobile:
          type: string
          nullable: true
        countryCode:
          type: string
          nullable: true
        countryIso:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        industry:
          type: string
          nullable: true
        website:
          type: string
          nullable: true
        businessHours:
          type: object
          nullable: true
        timezone:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
    ErrorBody:
      type: object
      properties:
        error:
          type: string
        reasonCode:
          type: string
        missing:
          type: array
          items:
            type: string
  responses:
    Unauthorized:
      description: Missing, invalid, or inactive API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            error: Invalid or inactive API key
            reasonCode: unauthorized
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ond_live | ond_test
      description: >-
        Paste only your API key (`ond_live_…` or `ond_test_…`). Do not type the
        word Bearer — the playground adds it.

````