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

# Send a voice code

> Sends an outbound voice call verification code.



## OpenAPI

````yaml /openapi/endpoints/ycloud-api-v2.yaml post /voices
openapi: 3.0.0
info:
  description: >-
    The [YCloud](https://ycloud.com) API is organized around
    [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). Our
    API is designed to have predictable, resource-oriented URLs, return
    [JSON](https://www.json.org) responses, and use standard HTTP response codes
    and verbs.
  version: v2
  title: YCloud API
  termsOfService: https://ycloud.com/terms-service
  contact:
    email: service@ycloud.com
servers:
  - url: https://api.ycloud.com/v2
    description: Base URL
security:
  - api_key: []
tags:
  - name: Balance
  - name: Contacts
  - name: Custom Events
  - name: Emails
  - name: SMS
  - name: Unsubscribers
  - name: Verify
  - name: Voices
  - name: Webhook Endpoints
  - name: WhatsApp Business Accounts
  - name: WhatsApp Inbound Messages
  - name: WhatsApp Media
  - name: WhatsApp Messages
  - name: WhatsApp Blocked Users
  - name: WhatsApp Groups
  - name: WhatsApp Calling
  - name: WhatsApp Phone Numbers
  - name: WhatsApp Templates
  - name: WhatsApp Flows
  - name: Meta Business Agent
  - name: WhatsApp Group Messages
externalDocs:
  description: Homepage
  url: https://ycloud.com
paths:
  /voices:
    post:
      tags:
        - Voices
      summary: Send a voice code
      description: Sends an outbound voice call verification code.
      operationId: voice-send
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceSendRequest'
        description: Voice call request that needs to be sent.
        required: true
      responses:
        '200':
          description: The request is successfully accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice'
components:
  schemas:
    VoiceSendRequest:
      type: object
      required:
        - to
        - verificationCode
      properties:
        to:
          type: string
          description: >-
            The recipient's phone number in
            [E.164](https://en.wikipedia.org/wiki/E.164) format.
          example: '+16315551111'
        verificationCode:
          type: string
          description: The verification code to be sent, 4 to 6 digits.
          example: '123456'
        language:
          type: string
          description: >-
            [ISO 639 Language
            Code](https://www.iso.org/iso-639-language-codes.html). If not
            specified, language will be set as `en` by default. Notably, in
            certain countries or regions, language will be automatically set as
            the local language due to the regional restrictions.

            Applicable languages:

            `ar`: Arabic

            `de`: German

            `en`: English

            `es`: Spanish

            `fr`: French

            `id`: Indonesian

            `it`: Italian

            `pt`: Portuguese

            `ru`: Russian

            `tr`: Turkish

            `vi`: Vietnamese

            `zh`: Chinese
          example: en
        externalId:
          type: string
          description: >-
            A unique (recommended) string to reference the object. This can be
            an order number or similar, and can be used to reconcile the object
            with your internal systems.
        callbackUrl:
          type: string
          description: >-
            Delivery report URL. You can provide a URL, and we will push the
            updated status report to your server in time. e.g.,
            https://httpbin.org/anything?tag=api.

            Note: We recommend configuring Webhook Endpoints instead.
          example: https://httpbin.org/anything?tag=api-voice
    Voice:
      type: object
      required:
        - id
        - to
      properties:
        id:
          type: string
          description: Unique ID for the object.
          minLength: 6
          maxLength: 128
        to:
          type: string
          description: >-
            The recipient's phone number in
            [E.164](https://en.wikipedia.org/wiki/E.164) format.
          example: '+16315551111'
        verificationCode:
          type: string
          description: The verification code to be sent, 4 to 6 digits.
          example: '123456'
        language:
          type: string
          description: >-
            [ISO 639 Language
            Code](https://www.iso.org/iso-639-language-codes.html).
          example: en
        regionCode:
          type: string
          description: >-
            [ISO 3166-1 alpha-2 country
            code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
          example: US
        totalSegments:
          type: integer
          format: int32
          minimum: 1
          description: Number of message segments. It's always 1 for voice calls.
          example: 1
        totalPrice:
          type: number
          format: double
          description: Total price of this message.
          example: 0.05
        currency:
          type: string
          description: >-
            Price currency. [ISO 4217 currency
            code](https://en.wikipedia.org/wiki/ISO_4217).
          example: USD
        status:
          type: string
          description: >-
            Delivery status. One of `accepted`, `sent`, `delivered`,
            `undelivered`, or `failed`.

            - `accepted`: The messaging request is accepted by our system.

            - `failed`: The message failed to be sent from our system.

            - `sent`: The message has been sent from our system.

            - `delivered`: Our system has received a delivery receipt indicating
            that message is delivered.

            - `undelivered`: Our system has received a delivery receipt
            indicating that message is not delivered.
          example: sent
          enum:
            - accepted
            - failed
            - sent
            - delivered
            - undelivered
        errorCode:
          type: string
          description: Error code when the message is undeliverable.
        createTime:
          type: string
          format: date-time
          description: >-
            The time at which this message was created, formatted in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g.,
            `2022-03-01T12:00:00.000Z`.
          example: '2022-03-01T12:00:00.000Z'
        updateTime:
          type: string
          format: date-time
          description: >-
            The time at which the delivery report for this message was updated,
            formatted in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g.,
            `2022-03-01T12:00:00.000Z`.
          example: '2022-03-01T12:00:00.000Z'
        externalId:
          type: string
          description: >-
            A unique (recommended) string to reference the object. This can be
            an order number or similar, and can be used to reconcile the object
            with your internal systems.
        callbackUrl:
          type: string
          description: >-
            Delivery report URL. You can provide a URL, and we will push the
            updated status report to your server in time. e.g.,
            https://httpbin.org/anything?tag=api.

            Note: We recommend configuring Webhook Endpoints instead.
          example: https://httpbin.org/anything?tag=api-voice
        bizType:
          type: string
          description: >-
            This can be either empty or one of `voice`, or `verify`. Defaults to
            `voice`.

            - `voice`: Indicates that the message is sent via the **Voice**
            product.

            - `verify`: Indicates that the message is sent via **Verify**
            product.
          example: voice
        verificationId:
          type: string
          description: The verification ID. Included only when `bizType` is `verify`.
          example: VERIFICATION-ID
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.