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

# Send verification

> Creates a new Verification for an account and sends the code to the given phone number.



## OpenAPI

````yaml POST /accounts/{account_id}/verifications
openapi: 3.1.1
info:
  title: Surge
  version: '1.0'
servers:
  - url: https://api.surge.app
security:
  - authorization: []
paths:
  /accounts/{account_id}/verifications:
    post:
      tags:
        - Verifications
      summary: Create a verification
      description: >-
        Creates a new Verification for an account and sends the code to the
        given phone number.
      operationId: CreateVerification
      parameters:
        - in: path
          name: account_id
          required: true
          schema:
            description: The account to associate with the verification.
            example: acct_01j9a43avnfqzbjfch6pygv1td
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerificationParams'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verification'
          description: Created verification
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Surge from '@surgeapi/node';


            const client = new Surge({
              apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
            });


            const verification = await
            client.verifications.create('acct_01j9a43avnfqzbjfch6pygv1td', {
              phone_number: '+18015551234',
            });


            console.log(verification.id);
        - lang: Python
          source: |-
            import os
            from surge import Surge

            client = Surge(
                api_key=os.environ.get("SURGE_API_KEY"),  # This is the default and can be omitted
            )
            verification = client.verifications.create(
                account_id="acct_01j9a43avnfqzbjfch6pygv1td",
                phone_number="+18015551234",
            )
            print(verification.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/surge-go\"\n\t\"github.com/stainless-sdks/surge-go/option\"\n)\n\nfunc main() {\n\tclient := surge.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tverification, err := client.Verifications.New(\n\t\tcontext.TODO(),\n\t\t\"acct_01j9a43avnfqzbjfch6pygv1td\",\n\t\tsurge.VerificationNewParams{\n\t\t\tPhoneNumber: \"+18015551234\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", verification.ID)\n}\n"
        - lang: Ruby
          source: >-
            require "surge_api"


            surge = SurgeAPI::Client.new(api_key: "My API Key")


            verification =
            surge.verifications.create("acct_01j9a43avnfqzbjfch6pygv1td",
            phone_number: "+18015551234")


            puts(verification)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Surge\Client;

            use Surge\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('SURGE_API_KEY') ?: 'My API
            Key');


            try {
              $verification = $client->verifications->create(
                'acct_01j9a43avnfqzbjfch6pygv1td', phoneNumber: '+18015551234'
              );

              var_dump($verification);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
components:
  schemas:
    VerificationParams:
      description: Parameters for creating a Verification
      example:
        phone_number: '+18015551234'
      properties:
        phone_number:
          description: The phone number to be verified. In E.164 format.
          example: '+18015551234'
          format: phone-number
          pattern: ^\+[1-9]\d{6,14}$
          type: string
      required:
        - phone_number
      title: VerificationParams
      type: object
    Verification:
      description: A phone number verification
      example:
        attempt_count: 0
        id: vfn_01jayh15c2f2xamftg0xpyq1nj
        phone_number: '+18015551234'
        status: pending
      properties:
        attempt_count:
          description: The number of times the code has been attempted.
          type: integer
        id:
          description: Unique identifier for the object.
          type: string
        phone_number:
          description: The phone number being verified. In E.164 format.
          example: '+18015551234'
          format: phone-number
          pattern: ^\+[1-9]\d{6,14}$
          type: string
        status:
          description: The current status of the verification.
          enum:
            - pending
            - verified
            - exhausted
            - expired
          type: string
      required:
        - id
        - attempt_count
        - phone_number
        - status
      title: Verification
      type: object
    ErrorResponse:
      description: An error response
      example:
        error:
          message: The requested resource could not be found.
          type: not_found
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
      title: ErrorResponse
      type: object
    Error:
      description: An error response
      example:
        message: The requested resource was not found.
        type: not_found
      properties:
        detail:
          additionalProperties: true
          description: Additional details about the error.
          type: object
        message:
          description: A human-readable error message.
          example: The requested resource was not found.
          type: string
        type:
          description: A unique error code.
          example: not_found
          type: string
      required:
        - type
        - message
      title: Error
      type: object
  securitySchemes:
    authorization:
      bearerFormat: Surge API token
      scheme: bearer
      type: http

````