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

# Rotate Access Token

> Issues a new access token and immediately invalidates the current one.

Use this when an access token may have been exposed. The user's EHR connection is unaffected and no re-link is required — store the returned token and continue. Requests made with the old token return `401`.

### Example Request

```bash theme={null}
curl -X POST https://api.usecobalt.com/v1/access-token/rotate \
-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,
  "message": "Access token rotated successfully. The old token has been invalidated immediately.",
  "access_token": "8f2b41c09e77d3a5f6b1a0c4e9d82f7a"
}
```


## OpenAPI

````yaml POST /access-token/rotate
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:
  /access-token/rotate:
    post:
      summary: Rotate Access Token
      description: Issues a new access token and immediately invalidates the current one.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  access_token:
                    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

````