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

# Update Location Status

> Updates the status of a location to active or inactive.

<Note>
  **Use the Cobalt `id` in the URL path.** The `{id}` parameter should be the Cobalt location ID (the `id` field from GET responses), not the `ehr_id`.
</Note>

### Example Request

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

### Example Response

```json theme={null}
{
    "success": true,
    "message": "Location status updated successfully.",
    "location_id": "abc123def4567890abcdef1234567890"
}
```

### Notes

* The status update is case-insensitive ("active", "Active", "ACTIVE" are all accepted)
* Only the `status` field can be updated through this endpoint
* The location must belong to your organization
* Invalid location IDs will return a 404 error


## OpenAPI

````yaml PATCH /locations/{id}
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/{id}:
    patch:
      summary: Update Location Status
      description: Updates the status of a location to active or inactive.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: The location's ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - active
                    - inactive
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  location_id:
                    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

````