> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getdialed.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a credential

> Delete a credential and the secret it stores. Admin only.

Returns 409 when the stored secret is still used by other credentials in this account: one secret can serve several credentials, so deleting one of them must not take the others down. The record is left intact, so the delete can be retried once the other references are detached.

A secret this API did not create is never destroyed — the credential record is removed and the secret is left for whoever provisioned it. A secret that IS destroyed keeps a recovery window. Deleting the last credential bound to a provider account frees that account, so any organization may then connect it. Cross-tenant access returns 404.



## OpenAPI

````yaml /openapi.json delete /credentials/{credential_id}
openapi: 3.1.0
info:
  title: GetDialed API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/v1
    description: Production
security: []
paths:
  /credentials/{credential_id}:
    delete:
      tags:
        - credentials
      summary: Delete a credential
      description: >-
        Delete a credential and the secret it stores. Admin only.


        Returns 409 when the stored secret is still used by other credentials in
        this account: one secret can serve several credentials, so deleting one
        of them must not take the others down. The record is left intact, so the
        delete can be retried once the other references are detached.


        A secret this API did not create is never destroyed — the credential
        record is removed and the secret is left for whoever provisioned it. A
        secret that IS destroyed keeps a recovery window. Deleting the last
        credential bound to a provider account frees that account, so any
        organization may then connect it. Cross-tenant access returns 404.
      operationId: delete_credential_credentials__credential_id__delete
      parameters:
        - name: credential_id
          in: path
          required: true
          schema:
            type: string
            title: Credential Id
      responses:
        '204':
          description: Successful Response
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '403':
          description: Caller is authenticated but not an admin
          content:
            application/json:
              example:
                detail: Admin role required
        '404':
          description: >-
            No such credential for this organization (cross-tenant access also
            returns 404)
          content:
            application/json:
              example:
                detail: Credential not found
        '409':
          description: >-
            Shared-secret protection: other credentials in this account still
            reference this credential's stored secret, so destroying it would
            break them. The record is left intact — retry after pointing the
            others at their own stored secret.
          content:
            application/json:
              example:
                detail: >-
                  This credential's stored secret is still used by 2 other
                  credential(s) in this account. Point those at their own stored
                  secret first, then delete this one.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded — retry after the Retry-After header
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
          content:
            application/json:
              example:
                detail: 'Rate limit exceeded: 100 per 1 minute'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````