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

# Send a code (V1 API)

> This page presents how to send a code with our Legacy API, V1.

<Warning>
  The V1 API is **deprecated**. Starting November 1st 2025, no support will be provided for the V1 API and it will be **removed by April 2026**. No new features nor functionality will be added to the V1 API. Please use the [V2 Verify API](/verify/v2/documentation/introduction) instead. For more information refer to the [V2 Migration Guide](/verify/v2/documentation/v2-migration-guide).
</Warning>

<Info>
  **V2 equivalent:** [Create or retry a verification](/verify/v2/api-reference/create-or-retry-a-verification).
</Info>


## OpenAPI

````yaml post /authentication
openapi: 3.1.0
info:
  title: Ding
  version: 1.0.0
  description: >-
    The OTP API allows you to send authentication codes to your users using
    their phone numbers. The V1 API is **deprecated**. Technical support will
    end by **October 2025** and will be **removed by April 2026**. No new
    features and functionality will be added to the V1 API.
  contact:
    email: support@prelude.so
servers:
  - url: https://api.ding.live/v1
    description: The production Ding API server
security:
  - APIKey: []
tags:
  - name: OTP
    description: Send OTP codes to your users using their phone numbers.
  - name: Lookup
    description: Retrieve up-to-date metadata about a specific phone number
paths:
  /authentication:
    post:
      tags:
        - OTP
      summary: Send a code
      description: Send an OTP code to a user's phone number.
      operationId: create-authentication
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAuthenticationRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAuthenticationResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: true
components:
  schemas:
    CreateAuthenticationRequest:
      type: object
      required:
        - customer_uuid
        - phone_number
      properties:
        customer_uuid:
          type: string
          format: uuid
          description: >-
            Your customer UUID, which can be found in the API settings in the
            dashboard.
        phone_number:
          type: string
          format: phone_number
          examples:
            - '+1234567890'
          description: An E.164 formatted phone number to send the OTP to.
        ip:
          type: string
          format: ipv4
          description: The IP address of the user's device.
        device_id:
          type: string
          description: >-
            Unique identifier for the user's device. For Android, this
            corresponds to the `ANDROID_ID` and for iOS, this corresponds to the
            `identifierForVendor`.
        device_type:
          type: string
          enum:
            - IOS
            - ANDROID
            - WEB
          description: The type of device the user is using.
        app_version:
          type: string
          description: The version of your application.
        sender_id:
          type: string
          description: The Sender ID to use when sending the message.
        callback_url:
          type: string
          format: url
          description: A webhook URL to which delivery statuses will be sent.
        app_realm:
          type: string
          description: >-
            The Android SMS Retriever API hash code that identifies your app.
            This allows you to automatically retrieve and fill the OTP code on
            Android devices.
        os_version:
          type: string
          description: The version of the user's device operating system.
        device_model:
          type: string
          description: The model of the user's device.
        is_returning_user:
          type: boolean
          description: >-
            This signal should do more than just confirm if a user is returning
            to your app; it should provide a higher level of trust, indicating
            that the user is genuine.
        template_id:
          type: string
          description: >-
            The template id associated with the message content variant to be
            sent.
        correlation_id:
          type: string
          description: >-
            A unique, user-defined identifier that will be included in webhook
            events
        locale:
          type: string
          format: BCP-47
          examples:
            - en-US
            - el-GR
            - fr-FR
          description: >-
            A BCP-47 locale indicating the language the SMS should be sent to;
            if this is not set, the SMS will be sent to the language specified
            by the country code of the message. If we don't support the language
            set, the message will be sent in US English (en-US).
    CreateAuthenticationResponse:
      type: object
      description: A successful response to an authentication creation request.
      properties:
        authentication_uuid:
          type: string
          format: uuid
          description: >-
            A unique identifier for the authentication that you can use on the
            /check and /retry endpoints.
        status:
          type: string
          description: |
            The status of the authentication. Possible values are:
              * `pending` - The OTP code is being sent.
              * `rate_limited` - This user is rate-limited and cannot receive another code.
              * `spam_detected` - This attempt is flagged as spam. Go to the dashboard for more details.
          enum:
            - pending
            - rate_limited
            - spam_detected
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          description: >-
            The time at which the authentication expires and can no longer be
            checked or retried.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          examples:
            - invalid_phone_number
          description: A machine-readable code that describes the error.
          enum:
            - account_invalid
            - app_realm_require_device_type
            - bad_request
            - blocked_number
            - internal_server_error
            - invalid_app_realm
            - invalid_app_version
            - invalid_auth_uuid
            - invalid_device_id
            - invalid_device_model
            - invalid_line
            - invalid_os_version
            - invalid_phone_number
            - invalid_sender_id
            - invalid_template_id
            - negative_balance
            - no_associated_auth_found
            - suspended_account
            - unauthorized_sender_id
            - unsupported_app_realm_device_type
            - unsupported_region
        message:
          type: string
          examples:
            - +0 is not a valid phone number
          description: A human-readable message that describes the error.
        doc_url:
          type: string
          description: A link to the documentation that describes the error.
          examples:
            - >-
              https://docs.prelude.so/verify/v1/documentation/errors#invalid_phone_number
  securitySchemes:
    APIKey:
      name: x-api-key
      type: apiKey
      in: header
      x-speakeasy-example: YOUR_API_KEY

````