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

# Get Insurance Providers

> Retrieve insurance providers from the EMR system.

## Use Cases

* Get the correct `insurance_provider_id` before adding patient insurance
* Search providers by name for autocomplete functionality
* Display paginated lists of insurance options to end users
* Filter providers by active status

## Query Parameters

* **name** (string, optional): Filter by provider name (case-insensitive partial match)
* **page** (integer, optional): Page number (default: 1, min: 1)
* **page\_size** (integer, optional): Items per page (default: 100, max: 100)
* **active** (boolean, optional): Filter by active status (true/false)
* **ehr\_id** (string): Filter by EMR system's identifier.

## Example Requests

### Get First Page

```bash theme={null}
curl -X GET "https://api.usecobalt.com/v1/insurance-providers" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"
```

### Search by Name

```bash theme={null}
curl -X GET "https://api.usecobalt.com/v1/insurance-providers?name=blue%20cross" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"
```

### Get Page 2 with 50 Items

```bash theme={null}
curl -X GET "https://api.usecobalt.com/v1/insurance-providers?page=2&page_size=50" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"
```

### Filter Active Providers

```bash theme={null}
curl -X GET "https://api.usecobalt.com/v1/insurance-providers?active=true" \
  -H "client_id: your_client_id" \
  -H "client_secret: your_client_secret" \
  -H "access_token: your_access_token"
```

## Example Response

```json theme={null}
{
  "success": true,
  "insurance_providers": [
    {
      "id": "abc123def456",
      "name": "AHMC Health",
      "payer_id": "98999",
      "active": true,
      "created_at": "2025-01-01T10:00:00.000Z"
    },
    {
      "id": "xyz789ghi012",
      "name": "Blue Cross Blue Shield",
      "payer_id": "12345",
      "active": true,
      "created_at": "2025-01-01T10:00:00.000Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 5,
    "total_count": 450,
    "page_size": 100
  }
}
```

## Response Fields

### Top-Level Fields

* **success** (boolean): Whether the request was successful
* **insurance\_providers** (array): Array of insurance provider objects
* **pagination** (object): Pagination metadata

### Insurance Provider Object

* **id** (string): Cobalt insurance provider ID - use this value in `POST /v1/patients/:patient_mrn/insurances`
* **name** (string): Insurance provider name as it appears in the EMR system
* **payer\_id** (string): Insurance payer ID
* **active** (boolean): Whether the provider is currently active
* **created\_at** (string): ISO 8601 timestamp of when the provider was added

### Pagination Object

* **current\_page** (integer): Current page number
* **total\_pages** (integer): Total number of pages
* **total\_count** (integer): Total number of providers matching the filter
* **page\_size** (integer): Number of items per page

<Note>
  When adding patient insurance, using the `insurance_provider_id` from this endpoint is the most reliable method for identifying the insurance provider.
</Note>


## OpenAPI

````yaml GET /insurance-providers
openapi: 3.0.0
info:
  title: Cobalt API
  version: 1.0.1
  description: API for interacting with Cobalt's EHR integration services
servers:
  - url: https://api.usecobalt.com/v1
security:
  - ClientCredentials: []
    ClientSecret: []
    AccessToken: []
paths:
  /insurance-providers:
    get:
      tags:
        - Insurance
      summary: List insurance providers
      description: Retrieve insurance providers from the EMR system.
      operationId: getInsuranceProviders
      parameters:
        - in: query
          name: name
          schema:
            type: string
          description: Filter by provider name (case-insensitive partial match)
        - in: query
          name: page
          schema:
            type: integer
            default: 1
            minimum: 1
          description: 'Page number (default: 1, min: 1)'
        - in: query
          name: page_size
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 100
          description: 'Items per page (default: 100, max: 100)'
        - in: query
          name: ehr_id
          schema:
            type: string
          description: >-
            Filter by the EMR's internal identifier for the insurance provider
            (exact match)
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status (true/false)
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  insurance_providers:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            Cobalt insurance provider ID (use this in POST
                            /v1/patients/:patient_mrn/insurances)
                        name:
                          type: string
                          description: Insurance provider name as it appears in EMR
                        payer_id:
                          type: string
                          description: Insurance payer ID
                        active:
                          type: boolean
                          description: Whether the provider is currently active
                        created_at:
                          type: string
                          format: date-time
                          description: ISO 8601 timestamp of when provider was added
                  pagination:
                    type: object
                    properties:
                      current_page:
                        type: integer
                        description: Current page number
                        example: 1
                      total_pages:
                        type: integer
                        description: Total number of pages
                        example: 2
                      total_count:
                        type: integer
                        description: Total number of items
                        example: 151
                      page_size:
                        type: integer
                        description: Number of items per page
                        example: 100
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '404':
          description: User not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
components:
  securitySchemes:
    ClientCredentials:
      type: apiKey
      in: header
      name: client_id
    ClientSecret:
      type: apiKey
      in: header
      name: client_secret
    AccessToken:
      type: apiKey
      in: header
      name: access_token

````