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

# Send form via SMS

> Send a link to a form via SMS. When the recipient completes and submits the form, the contents are returned as an HTTP response OR via webhook.



## OpenAPI

````yaml POST /forms/sms
openapi: 3.1.0
info:
  title: Poku API
  version: 1.0.0
  description: OpenAPI document for the authenticated Poku API routes.
servers:
  - url: https://api.pokulabs.com
security:
  - bearerAuth: []
tags:
  - name: calls
  - name: messages
  - name: forms
  - name: interactions
  - name: numbers
  - name: webhooks
paths:
  /forms/sms:
    post:
      tags:
        - forms
      summary: Send a form via SMS
      description: >-
        Send a link to a form via SMS. When the recipient completes and submits
        the form, the contents are returned as an HTTP response OR via webhook.
      operationId: sendSmsForm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FormMediumInput'
      responses:
        '200':
          description: Form sent successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormResponse'
              examples:
                formSubmitted:
                  summary: Form submitted
                  value:
                    values:
                      name: John Smith
                      email: johnsmith@gmail.com
                    content: |-
                      First & Last Name: John Smith
                      Email: johnsmith@gmail.com
                noReply:
                  summary: No response received
                  value:
                    response: Human did not respond. Continue where you left off.
components:
  schemas:
    FormMediumInput:
      type: object
      required:
        - message
        - title
        - fields
        - to
      properties:
        message:
          type: string
          default: 'Please fill out this form: {{url}}'
          description: >-
            The SMS body sent to the recipient. `{{url}}` inserts the full form
            link. `{{replyToken}}` inserts only the form ID.


            **Example `url`:**
            `https://dashboard.pokulabs.com/reply/EniUSmrc_5hisuSf`


            **Example `replyToken`:** `EniUSmrc_5hisuSf`
        title:
          type: string
          description: The title displayed at the top of the form.
        description:
          type: string
          description: A subtitle shown below the title on the form.
        brandImageUrl:
          type: string
          format: uri
          description: URL of your logo, displayed at the top of the form above the title.
        submitLabel:
          type: string
          default: Submit
          description: Label on the form's submit button.
        fields:
          type: array
          items:
            $ref: '#/components/schemas/CaptureFormField'
          description: An array of fields to display on the form.
        to:
          type: string
          description: >-
            The number you want to message, in E.164 format. See [supported
            countries](https://docs.pokulabs.com/reference/supported-countries).
        from:
          type: string
          description: >-
            Defaults to your Poku reserved number. If you don't have one, falls
            back to a Poku shared number.


            You can also bring your own number from Twilio or Messagebird.
            Configure your credentials on the [Integrations
            page](https://dashboard.pokulabs.com/integrations) and pass the
            number here in E.164 format. If it's a US number, it must be
            approved for A2P texting.
        waitTime:
          type: number
          minimum: 1
          maximum: 600
          description: >-
            Either this parameter or `followUpTime` must be supplied.


            The number of seconds the API request is held open waiting for the
            form to be submitted. This is displayed as a countdown on the form.
            When the window expires, the agent moves on. The recipient can still
            submit the form within the `followUpTime` window.
          example: 60
          default: 90
        followUpTime:
          type: number
          minimum: 1
          maximum: 60000
          description: >-
            Either this parameter or `waitTime` must be supplied.


            After `waitTime` expires, how long Poku continues to accept a form
            submission. When the form is submitted within this window, the
            response is sent to any webhooks you've configured. Once this window
            closes, the form will show "This form has expired".
          example: 6000
          default: 90
      additionalProperties: false
    FormResponse:
      type: object
      properties:
        values:
          type: object
          description: The submitted form data, keyed by field ID.
          additionalProperties:
            type: string
        content:
          type: string
          description: A formatted text summary of the submitted values.
        response:
          type: string
          description: Returned when the waitTime expires with no form submission.
    CaptureFormField:
      type: object
      required:
        - id
        - label
        - type
      properties:
        id:
          type: string
          description: >-
            Unique identifier for the field. Used as the key in the returned
            response payload. Accepts letters, numbers, hyphens, and
            underscores.
        label:
          type: string
          description: The text displayed above the field.
        type:
          type: string
          enum:
            - text
            - textarea
            - email
            - phone_number
            - select
            - checkbox
            - address
          description: >-
            The input type for the field:

            - `text` — single-line text input

            - `textarea` — multi-line text input

            - `email` — text input with built-in validation (checks for `@` and
            a valid domain)

            - `phone_number` — lets the recipient select or search a country
            code from a dropdown, then enter their phone number

            - `select` — dropdown with predefined options (see `options`)

            - `checkbox` — boolean checkbox

            - `address` — text input with address validation powered by Google
            Places API, ensuring only real addresses are accepted
        required:
          type: boolean
          description: >-
            Whether the field must be completed before the form can be
            submitted.
          default: false
        placeholder:
          type: string
          description: >-
            Placeholder text shown inside the input before the recipient types
            anything.
        helperText:
          type: string
          description: Supplementary text shown below the field to guide the recipient.
        options:
          type: array
          items:
            $ref: '#/components/schemas/CaptureFormFieldOption'
          description: >-
            Predefined options for `select` fields. Each option requires a
            `label` (shown to the recipient) and a `value` (returned in the
            response payload). Only valid for `select` type.
        validations:
          type: array
          items:
            $ref: '#/components/schemas/CaptureFormStringValidationRule'
          description: >-
            Custom validation rules applied to the field. Each rule requires a
            `title` — which is shown below the field, and a `pattern`, a regular
            expression the input must match.


            Only valid for `text`, `textarea`, `email`, and `phone_number`
            fields.


            **Example:**

            ```json

            [
              { "title": "Must be 5 to 10 characters long", "pattern": "^.{5,10}$" },
              { "title": "Starts with a letter", "pattern": "^[A-Za-z].*" },
              { "title": "Does not contain Z", "pattern": "^(?!.*[Z]).*$" }
            ]

            ```
      additionalProperties: false
    CaptureFormFieldOption:
      type: object
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
      additionalProperties: false
    CaptureFormStringValidationRule:
      type: object
      required:
        - title
        - pattern
      properties:
        title:
          type: string
        pattern:
          type: string
          description: Must be a valid regular expression.
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication header containing your Poku API key. Find it in the [Poku
        dashboard](https://dashboard.pokulabs.com/). The format is "Bearer
        YOUR_API_KEY"

````