> ## 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 Locations

> Returns a list of locations associated with an account.

### Understanding Location IDs

Each location has two identifiers:

* **`id`**: Cobalt's internal identifier (32-character UUID without hyphens)
  * Use when updating location settings like status
  * Operations: `PATCH /v1/locations/{id}`

* **`ehr_id`**: Your EMR system's location identifier
  * Use when creating appointments or other EMR operations
  * Operations: `POST /v1/appointments` (`location` field)

**Why two IDs?** Different operations work in different contexts. Location management (updating status) modifies Cobalt's cached configuration, while appointment creation communicates directly with your EMR. Cobalt uses its own IDs to manage location settings independently of EMR constraints, then maps to EMR IDs when interacting with your EMR system.

<Note>
  **Quick Reference:**

  * Updating location settings → Use `id`
  * Creating appointments → Use `ehr_id`
</Note>

### Example Request

```bash theme={null}
curl -X GET https://api.usecobalt.com/v1/locations \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH'
```

### Example Response

```json theme={null}
{
    "success": true,
    "locations": [
        {
            "id": "abc123def4567890abcdef1234567890",
            "ehr_id": "2452",
            "name": "Happy Clinic",
            "address": {
                "address1": "1234 Main St",
                "address2": "",
                "city": "Sunnyland",
                "state": "CA",
                "zip": "23423"
            },
            "phone": "2223334444",
            "fax": "5556667777",
            "status": "active"
        }
    ]
}
```


## OpenAPI

````yaml GET /locations
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:
  /locations:
    get:
      summary: Get Locations
      description: Returns a list of locations associated with an account.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  locations:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The unique identifier for the location
                        ehr_id:
                          type: string
                          description: The EHR system's identifier for the location
                        name:
                          type: string
                        status:
                          type: string
                          enum:
                            - active
                            - inactive
                          description: The current status of the location
                        address:
                          type: object
                          properties:
                            address1:
                              type: string
                            address2:
                              type: string
                            city:
                              type: string
                            state:
                              type: string
                            zip:
                              type: string
                        phone:
                          type: string
                        fax:
                          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

````