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

# Test credentials without saving them

> Check a set of credentials against its platform without storing anything — the test-before-save flow. Admin only.

**This is a liveness check.** It proves the credentials are real and that the platform is reachable with them. It does NOT prove what they are permitted to do: verifying permissions would mean performing the operations themselves against your live vendor account, which this API will not do. What a credential has actually been able to do is recorded on the credential as it gets used, and is readable from `GET /credentials/{credential_id}`.

Always returns 200 with a result — the `success` and `error` fields carry the outcome, including timeouts and a platform that offers no test. Nothing is written and no flow is started.



## OpenAPI

````yaml /openapi.json post /credentials/test
openapi: 3.1.0
info:
  title: GetDialed API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/v1
    description: Production
security: []
paths:
  /credentials/test:
    post:
      tags:
        - credentials
      summary: Test credentials without saving them
      description: >-
        Check a set of credentials against its platform without storing anything
        — the test-before-save flow. Admin only.


        **This is a liveness check.** It proves the credentials are real and
        that the platform is reachable with them. It does NOT prove what they
        are permitted to do: verifying permissions would mean performing the
        operations themselves against your live vendor account, which this API
        will not do. What a credential has actually been able to do is recorded
        on the credential as it gets used, and is readable from `GET
        /credentials/{credential_id}`.


        Always returns 200 with a result — the `success` and `error` fields
        carry the outcome, including timeouts and a platform that offers no
        test. Nothing is written and no flow is started.
      operationId: test_unsaved_credentials_credentials_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestResult'
        '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
        '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:
    CredentialTestRequest:
      properties:
        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:
          additionalProperties: true
          type: object
          title: Credentials
        service_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Id
      type: object
      required:
        - platform_id
        - auth_method
        - credentials
      title: CredentialTestRequest
      description: |-
        Ad-hoc credentials test request. Verifies a credentials payload against
        the target platform without saving a credential — the "test before save"
        flow posts this body, then persists via `POST /credentials` on success.
      example:
        auth_method: basic_auth
        credentials:
          password: REPLACE_ME
          username: api_user@example
        platform_id: five9
    TestResult:
      properties:
        success:
          type: boolean
          title: Success
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        details:
          type: string
          title: Details
        latency_ms:
          type: integer
          title: Latency Ms
        tested_at:
          type: string
          format: date-time
          title: Tested At
      type: object
      required:
        - success
        - error
        - details
        - latency_ms
        - tested_at
      title: TestResult
      description: |-
        Result of a credential test. Returned with HTTP 200 for every test
        outcome, including failures and timeouts — inspect `success` and `error`
        rather than the status code. When `success` is false, `error` is one of:
        AUTH_FAILED, NETWORK, TIMEOUT, RATE_LIMITED, PERMISSION_DENIED,
        INVALID_CREDENTIALS_SHAPE, UNKNOWN. `latency_ms` measures the platform
        round-trip only.
      example:
        details: Authenticated successfully; 3 lists visible
        latency_ms: 412
        success: true
        tested_at: '2026-07-09T18:00:00Z'
    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

````