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

# Create a credential

> Store one set of per-organization credentials. Admin only.

Supply the platform, the authentication method and the secret material — nothing else. When the platform can identify the account those credentials belong to, this call discovers it, verifies the credentials in the process, and files the credential under that account: you never look up or type a provider account id. When the platform has no such concept, or the credential is not tied to a vendor at all, supply `tenant_name` and the credential is filed under a name you choose.

A create therefore fails before anything is stored: 400 when the credentials could not be verified, and 409 when that provider account belongs to another GetDialed account or these credentials are already stored here.



## OpenAPI

````yaml /openapi.json post /credentials
openapi: 3.1.0
info:
  title: GetDialed API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/v1
    description: Production
security: []
paths:
  /credentials:
    post:
      tags:
        - credentials
      summary: Create a credential
      description: >-
        Store one set of per-organization credentials. Admin only.


        Supply the platform, the authentication method and the secret material —
        nothing else. When the platform can identify the account those
        credentials belong to, this call discovers it, verifies the credentials
        in the process, and files the credential under that account: you never
        look up or type a provider account id. When the platform has no such
        concept, or the credential is not tied to a vendor at all, supply
        `tenant_name` and the credential is filed under a name you choose.


        A create therefore fails before anything is stored: 400 when the
        credentials could not be verified, and 409 when that provider account
        belongs to another GetDialed account or these credentials are already
        stored here.
      operationId: create_credential_credentials_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponse'
        '400':
          description: >-
            The credential could not be verified against the platform, so the
            account it belongs to could not be identified (auth, network,
            timeout, permission or rate-limit failure)
          content:
            application/json:
              example:
                detail: >-
                  The platform rejected these credentials, so the account they
                  belong to could not be identified. Check the credentials and
                  try again.
        '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
        '409':
          description: >-
            A credential with the same identity already exists on the same
            provider tenant for this organization. One record per real
            credential set is the model invariant, so the duplicate is refused
            rather than merged.
          content:
            application/json:
              example:
                detail: >-
                  These credentials are already stored for this account under
                  the same provider account. Use the existing credential, or
                  supply a different set.
        '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:
    CredentialCreate:
      properties:
        name:
          type: string
          title: Name
        platform_id:
          type: string
          title: Platform Id
        auth_method:
          type: string
          enum:
            - basic_auth
            - api_key
            - jwt
            - oauth2
            - aws_access_key
          title: Auth Method
        credentials:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Credentials
        credentials_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Credentials Ref
        tenant_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tenant Name
        grant_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Grant Type
        token_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Token Url
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        audience:
          anyOf:
            - type: string
            - type: 'null'
          title: Audience
        api_key_placement:
          anyOf:
            - $ref: '#/components/schemas/ApiKeyPlacement'
            - type: 'null'
        aws_region:
          anyOf:
            - type: string
            - type: 'null'
          title: Aws Region
        aws_default_bucket:
          anyOf:
            - type: string
            - type: 'null'
          title: Aws Default Bucket
        aws_endpoint_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Aws Endpoint Url
        status:
          type: string
          enum:
            - active
            - expired
            - revoked
          title: Status
          default: active
      type: object
      required:
        - name
        - platform_id
        - auth_method
      title: CredentialCreate
      example:
        auth_method: basic_auth
        credentials:
          password: REPLACE_ME
          username: api_user@example
        name: Five9 Production
        platform_id: five9
        status: active
    CredentialResponse:
      properties:
        id:
          type: string
          title: Id
        org_id:
          type: string
          title: Org Id
        name:
          type: string
          title: Name
        platform_id:
          type: string
          title: Platform Id
        auth_method:
          type: string
          title: Auth Method
        credentials_ref:
          type: string
          title: Credentials Ref
        tenancy_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tenancy Id
        tenant:
          anyOf:
            - $ref: '#/components/schemas/CredentialTenantSummary'
            - type: 'null'
        grant_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Grant Type
        token_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Token Url
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        audience:
          anyOf:
            - type: string
            - type: 'null'
          title: Audience
        api_key_placement:
          anyOf:
            - $ref: '#/components/schemas/ApiKeyPlacement'
            - type: 'null'
        aws_region:
          anyOf:
            - type: string
            - type: 'null'
          title: Aws Region
        aws_default_bucket:
          anyOf:
            - type: string
            - type: 'null'
          title: Aws Default Bucket
        aws_endpoint_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Aws Endpoint Url
        telemetry:
          additionalProperties:
            $ref: '#/components/schemas/CredentialTelemetrySummary'
          type: object
          title: Telemetry
        status:
          type: string
          title: Status
        created_by:
          type: string
          title: Created By
        last_verified:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Verified
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
      type: object
      required:
        - id
        - org_id
        - name
        - platform_id
        - auth_method
        - credentials_ref
        - status
        - created_by
      title: CredentialResponse
      example:
        auth_method: basic_auth
        created_at: '2026-08-01T12:00:00Z'
        created_by: user_11223344
        credentials_ref: getdialed/acme/five9/cred_e5f6g7h8
        id: cred_e5f6g7h8
        last_verified: '2026-08-22T09:00:00Z'
        name: Five9 Production
        org_id: org_a1b2c3d4
        platform_id: five9
        scopes: []
        status: active
        telemetry:
          five9__configuration_service:
            last_stamped_at: '2026-08-22T09:00:00Z'
            last_succeeded_at: '2026-08-22T09:00:00Z'
            last_used_at: '2026-08-22T09:00:00Z'
        tenancy_id: ten_1a2b3c4d5e6f7890
        tenant:
          id: ten_1a2b3c4d5e6f7890
          is_manual: false
          label: Acme VCC
          platform_id: five9
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiKeyPlacement:
      properties:
        header_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Header Name
        scheme:
          anyOf:
            - type: string
            - type: 'null'
          title: Scheme
        query_param:
          anyOf:
            - type: string
            - type: 'null'
          title: Query Param
      type: object
      title: ApiKeyPlacement
      description: >-
        Where an API-key credential puts its key.


        This is presentation configuration, not secret material: it holds the
        header

        NAME (and optionally a scheme such as `Bearer` prefixed to the value),
        or the

        query-parameter NAME. A form renders straight from it.


        It is declared ONCE, on the credential, so every task that selects this

        credential injects the key identically and no task configuration ever

        mentions authentication. Exactly one of `header_name` or `query_param`
        is

        set; `scheme` is legal only alongside `header_name`.
    CredentialTenantSummary:
      properties:
        id:
          type: string
          title: Id
        label:
          type: string
          title: Label
        platform_id:
          type: string
          title: Platform Id
        is_manual:
          type: boolean
          title: Is Manual
      type: object
      required:
        - id
        - label
        - platform_id
        - is_manual
      title: CredentialTenantSummary
      description: >-
        The provider account or customer-named tenant this credential belongs
        to.
      example:
        id: ten_1a2b3c4d5e6f7890
        is_manual: false
        label: Acme VCC
        platform_id: five9
    CredentialTelemetrySummary:
      properties:
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        last_succeeded_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Succeeded At
        last_failed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Failed At
        last_error_class:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error Class
        last_stamped_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Stamped At
      type: object
      title: CredentialTelemetrySummary
      description: |-
        Observed use of one credential against one service.

        Read straight off the credential, so a client can show health without a
        second call.
      example:
        last_stamped_at: '2026-08-22T09:00:00Z'
        last_succeeded_at: '2026-08-22T09:00:00Z'
        last_used_at: '2026-08-22T09:00:00Z'
    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

````