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

# Start a verification

> Starts a verification by sending an SMS, voice, or email message to the recipient.
This verification is charged once the message is sent successfully.



## OpenAPI

````yaml /openapi/endpoints/ycloud-api-v2.yaml post /verify/verifications
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:
  /verify/verifications:
    post:
      tags:
        - Verify
      summary: Start a verification
      description: >-
        Starts a verification by sending an SMS, voice, or email message to the
        recipient.

        This verification is charged once the message is sent successfully.
      operationId: verification-send
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerificationSendRequest'
        description: Verification request that needs to be sent.
        required: true
      responses:
        '200':
          description: The request is successfully accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verification'
components:
  schemas:
    VerificationSendRequest:
      type: object
      required:
        - channel
        - to
      properties:
        channel:
          $ref: '#/components/schemas/VerificationChannel'
          description: >-
            The channel through which the verification code will be sent.
            Supported channels are `sms` (text message), `voice` (phone call),
            `email_code` (email), and `whatsapp` (WhatsApp message).
        to:
          type: string
          description: >-
            The recipient's phone number or email address depending on
            `channel`.

            - Phone number: In [E.164](https://en.wikipedia.org/wiki/E.164)
            format. Applicable when `channel` is `sms` or `voice`.

            - Email address: For example, `tom@example.com`. Applicable when
            `channel` is `email_code`.
          example: '+16315551111'
        code:
          type: string
          description: >-
            Verification code to be sent. This field is optional. If not
            provided, we will automatically generate a code.
          maxLength: 8
          minLength: 4
          example: '123456'
        senderId:
          type: string
          description: >-
            [Sender
            ID](https://helpdocs.ycloud.com/help-center/integrations/channels/global-sms/sms-features/sender-id)
            to be used.
          example: Brand
        signature:
          type: string
          description: >-
            This parameter is only required for Chinese mainland SMS messages.
            You must specify an approved signature such as `Brand`. It will be
            added to the beginning of SMS body and wrapped with `【】`, e.g.
            `【Brand】Your verification code is 123456`.
          example: Brand
        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_BR`: Portuguese

            `ru`: Russian

            `tr`: Turkish

            `vi`: Vietnamese

            `zh_CN`: Simplified Chinese

            `zh_HK`: Traditional 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.

            If present, this value will also be attached to the `externalId` of
            message objects.
    Verification:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: ID of the verification.
          example: ve6j7n8i
        status:
          $ref: '#/components/schemas/VerificationStatus'
        to:
          type: string
          description: Recipient of the verification.
          example: '+16315551111'
        channel:
          $ref: '#/components/schemas/VerificationChannel'
        sendTime:
          type: string
          format: date-time
          description: >-
            The time at which this verification was sent, formatted in [RFC
            3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g.,
            `2022-06-01T12:00:00.000Z`.
          example: '2022-06-01T12:00:00.000Z'
        totalPrice:
          type: number
          format: double
          description: Total price of this verification.
          example: 0.0085
        currency:
          type: string
          description: >-
            Price currency. [ISO 4217 currency
            code](https://en.wikipedia.org/wiki/ISO_4217).
          example: USD
        smsFallbackEnabled:
          type: boolean
          description: >-
            Whether sms fallback is enabled or not.

            Applicable when `channel` is `whatsapp`. If enabled, we will try to
            send the verification code via sms when the WhatsApp message is
            failed.
        smsFallback:
          $ref: '#/components/schemas/VerificationFallback'
          description: Included when `smsFallbackEnabled` is `true`.
        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.
    VerificationChannel:
      type: string
      description: |-
        Supports several independent channels for verification:
        - `sms`: Sends an SMS message with a verification code.
        - `voice`: Makes a voice call with a verification code.
        - `email_code`: Sends an email with a verification code.
        - `whatsapp`: Sends a WhatsApp message with a verification code.
      enum:
        - sms
        - voice
        - email_code
        - whatsapp
      example: sms
    VerificationStatus:
      type: string
      description: >-
        Status of the verification.

        - `pending`: The verification message (SMS, Voice, etc.) is sent,
        waiting to be checked. This happens when you call the 'Start a
        verification' API successfully.

        - `approved`: The verification has been successfully checked. A
        `pending` verification status changes to `approved` when you call the
        'Check a verification' API and receive a response with the `valid`
        parameter is `true`. An approved verification cannot be checked anymore.

        - `blocked`: The verification is blocked by user-defined rules such as
        denylist, and geographical permission restrictions. A blocked
        verification cannot be checked.

        - `expired`: The verification has expired and cannot be checked anymore.

        - `undelivered`: Our system has received a delivery receipt indicating
        that the verification message was not delivered. An undelivered
        verification cannot be checked anymore.
      enum:
        - pending
        - approved
        - blocked
        - expired
        - undelivered
    VerificationFallback:
      type: object
      description: >-
        Contains information about verification fallback. For example, you can
        enable sms fallback for WhatsApp verification messages.
      properties:
        supported:
          type: boolean
          description: >-
            Whether this fallback you requested is supported. If `false` is
            returned, it means that there are errors for this fallback, and this
            fallback will not be triggered.
        unsupportedReason:
          type: string
          description: >-
            The reason why the fallback is unsupported, e.g, `PARAM_INVALID`,
            `SMS_SIGNATURE_UNAVAILABLE`, `SENDER_ID_UNAVAILABLE`, or
            `MESSAGING_REGION_UNSUPPORTED`.
          example: SENDER_ID_UNAVAILABLE
        unsupportedDetail:
          type: string
          description: The detail message why the fallback is unsupported.
          example: This Sender ID is not registered.
  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.