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

# Disable Credential

> Stops Cobalt using a credential set for EHR sessions, leaving it in place.

A connection can hold several sets of EHR credentials. Disabling one takes it out of rotation without removing it, so you can re-enable it later. Sessions already running on that credential are not interrupted.

`credentialId` is the UUID of the credential set. Account events carry it as `credential_id`, so you can disable the exact credential an event reports on — see [Account Events](/docs/webhooks/account-events).

A connection must always keep one active credential set, so disabling the last one returns `409`.

### Example Request

```bash theme={null}
curl -X PATCH https://api.usecobalt.com/v1/credentials/550e8400-e29b-41d4-a716-446655440010/disable \
-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": "Credential disabled"
}
```

### Last Active Credential

```json theme={null}
{
    "success": false,
    "message": "Cannot disable the last active credential set. Add or enable another credential first."
}
```


## OpenAPI

````yaml PATCH /credentials/{credentialId}/disable
openapi: 3.1.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
    description: Production
security:
  - ClientCredentials: []
    ClientSecret: []
    AccessToken: []
paths:
  /credentials/{credentialId}/disable:
    patch:
      tags:
        - Account
      summary: Disable a credential
      description: >-
        Disables a credential set so it is no longer used for EMR sessions (the
        last active set cannot be disabled).
      operationId: disableCredential
      parameters:
        - name: credentialId
          in: path
          description: Credential set ID (UUID).
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Credential disabled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                required:
                  - success
                  - message
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    BadRequest:
      description: Bad request — missing or invalid parameters
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
    Unauthorized:
      description: Unauthorized — missing or invalid credentials
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              message:
                type: string
            required:
              - success
              - message
  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

````