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

# Delete Credential

> Removes a credential set from a connection.

Deletes a set of EHR credentials. Unlike [Disable Credential](/api-reference/account/disable-credential), this cannot be undone — the credential set cannot be re-enabled afterwards.

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

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

### Example Request

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

### Last Active Credential

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


## OpenAPI

````yaml DELETE /credentials/{credentialId}
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}:
    delete:
      tags:
        - Account
      summary: Delete a credential
      description: Deletes a credential set (the last active set cannot be deleted).
      operationId: deleteCredential
      parameters:
        - name: credentialId
          in: path
          description: Credential set ID (UUID).
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Credential deleted
          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

````