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

# Send Message

> Sends a message (text, media and/or poll) to a chat from the phone in the x-phone header. For group chats the header can be omitted — a connected phone that is in the group is selected automatically, within the token's phone scopes. Sending is asynchronous — track the returned unique_id via GET /message/{unique_id}/status.



## OpenAPI

````yaml api-reference/openapi-generated.json POST /v1/message/send
openapi: 3.0.3
info:
  title: Periskope API
  version: 1.0.0
  description: >-
    Periskope external API.


    Responses use a flat, unwrapped shape: most endpoints return the resource at
    the top level, and list endpoints return a wrapper object with pagination
    inline (e.g. `{ from, to, count, chats: [...] }`). The documented response
    schemas describe these shapes directly.
servers:
  - url: https://api.periskope.app
security:
  - bearerAuth: []
paths:
  /v1/message/send:
    post:
      tags:
        - Messages
      summary: Send a message
      description: >-
        Sends a message (text, media and/or poll) to a chat from the phone in
        the x-phone header. For group chats the header can be omitted — a
        connected phone that is in the group is selected automatically, within
        the token's phone scopes. Sending is asynchronous — track the returned
        unique_id via GET /message/{unique_id}/status.
      operationId: sendMessage
      parameters:
        - schema:
            type: string
            example: '919876543210'
            description: >-
              Phone to send from: country code + number without symbols or
              spaces (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx).
              Required for 1-1 chats. For group chats it can be omitted — a
              connected phone that is in the group is selected automatically,
              within the token's phone scopes.
          required: false
          description: >-
            Phone to send from: country code + number without symbols or spaces
            (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx). Required
            for 1-1 chats. For group chats it can be omitted — a connected phone
            that is in the group is selected automatically, within the token's
            phone scopes.
          name: x-phone
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                chat_id:
                  type: string
                  minLength: 1
                  description: >-
                    Chat to send the message to. For group chats, the chat_id
                    ending with @g.us; for 1-1 chats, country code + number of
                    the contact, optionally suffixed with @c.us (e.g.
                    911111111111 or 911111111111@c.us).
                  example: 911111111111@c.us
                message:
                  type: string
                  description: >-
                    The text body of the message, or the caption when media is
                    provided. Supports the basic WhatsApp markdown formatting
                    (*bold*, _italic_, ~strikethrough~, ```monospace```).
                  example: Hello World
                media:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - image
                        - video
                        - document
                        - audio
                        - ptt
                      description: >-
                        Kind of media being sent: 'image', 'video', 'document',
                        'audio', or 'ptt' (push-to-talk voice note). Determines
                        the message_type of the resulting message.
                      example: image
                    url:
                      type: string
                      description: >-
                        Publicly accessible URL that hosts the content to be
                        sent. Provide either url or filedata, not both.
                      example: https://example.com/files/image.png
                    filedata:
                      type: string
                      description: >-
                        Raw bytes of the file, encoded as base64. Alternative to
                        url — provide either url or filedata, not both.
                      example: iVBORw0KGgoAAAANSUhEUgAA...
                    mimetype:
                      type: string
                      description: >-
                        MIME type of the media file (e.g. image/png, video/mp4,
                        text/csv). Recommended when sending filedata.
                      example: image/png
                    filename:
                      type: string
                      description: >-
                        Filename of the media, shown in the chat (mainly
                        relevant for document messages). Defaults to the last
                        path segment of url.
                      example: image.png
                  required:
                    - type
                  description: >-
                    Media to send — a document, image, video, audio file or
                    voice note. Provide either a public url or base64 filedata.
                    The message text, when given, becomes the caption.
                poll:
                  type: object
                  properties:
                    pollName:
                      type: string
                      minLength: 1
                      description: The question or title of the poll
                      example: Which day suits everyone for the demo?
                    pollOptions:
                      type: array
                      items:
                        type: string
                      minItems: 2
                      maxItems: 12
                      description: >-
                        The answer options of the poll — between 2 and 12
                        entries
                      example:
                        - Monday
                        - Wednesday
                        - Friday
                    options:
                      type: object
                      properties:
                        allowMultipleAnswers:
                          type: boolean
                          description: >-
                            When true, respondents can select multiple options.
                            Defaults to single choice.
                          example: true
                        pollId:
                          type: string
                          description: >-
                            Optional unique identifier of the poll — useful to
                            correlate the same poll sent across multiple chats
                          example: poll-2026-demo-day
                      description: Additional options of the poll
                  required:
                    - pollName
                    - pollOptions
                  description: >-
                    Poll to send instead of a plain message. The resulting
                    message has message_type poll_creation.
                reply_to:
                  type: string
                  description: >-
                    message_id of an existing message in the chat to reply to.
                    The sent message quotes it.
                  example: >-
                    true_911111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                options:
                  type: object
                  properties:
                    hide_url_preview:
                      type: boolean
                      description: >-
                        When true, disables the automatic link preview for URLs
                        contained in the message
                      example: true
                  description: Additional sending options
              required:
                - chat_id
      responses:
        '200':
          description: The queued message
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - queued
                    description: >-
                      Always queued — messages are not sent synchronously, they
                      are queued on the phone and submitted in the background
                  unique_id:
                    type: string
                    description: >-
                      Provisional id of the message. Use it with GET
                      /message/{unique_id}/status to track delivery, or with GET
                      /message/{message_id} once processed. The resulting
                      message record carries it as unique_id.
                    example: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                  queue_id:
                    type: string
                    description: >-
                      Id of the queue job on the phone. The resulting message
                      record carries it as sent_message_id, and the queue
                      endpoints accept it as queue_id.
                    example: 00000000-0000-0000-0000-000000000000
                  queue_position:
                    type: number
                    description: >-
                      Position of the job in the send queue at the moment it was
                      enqueued (0 = next in line)
                    example: 0
                  track_by:
                    type: object
                    properties:
                      unique_id:
                        type: string
                        description: >-
                          Ready-to-use path for tracking the message by
                          unique_id
                        example: >-
                          GET
                          /messages/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/status
                    description: Convenience pointers for tracking the message
              examples:
                default:
                  summary: Response body
                  value:
                    status: queued
                    unique_id: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                    queue_id: 00000000-0000-0000-0000-000000000000
                    queue_position: 0
                    track_by:
                      unique_id: >-
                        GET
                        /messages/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/status
        '400':
          description: The phone is off or its server is unreachable
          content:
            application/json:
              examples:
                error:
                  summary: The phone is off or its server is unreachable
                  value:
                    code: ERROR
                    message: The phone is off or its server is unreachable
                    status: 400
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ERROR
                  message:
                    type: string
                    example: The phone is off or its server is unreachable
                  status:
                    type: integer
                    example: 400
                example:
                  code: ERROR
                  message: The phone is off or its server is unreachable
                  status: 400
        '401':
          description: Invalid, expired or missing API token
          content:
            application/json:
              examples:
                error:
                  summary: Invalid, expired or missing API token
                  value:
                    code: UNAUTHORIZED_ERROR
                    message: Invalid bearer auth token
                    status: 401
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNAUTHORIZED_ERROR
                  message:
                    type: string
                    example: Invalid bearer auth token
                  status:
                    type: integer
                    example: 401
                example:
                  code: UNAUTHORIZED_ERROR
                  message: Invalid bearer auth token
                  status: 401
        '404':
          description: >-
            x-phone omitted and the group chat was not found on any phone of the
            org
          content:
            application/json:
              examples:
                error:
                  summary: >-
                    x-phone omitted and the group chat was not found on any
                    phone of the org
                  value:
                    code: NOT_FOUND_ERROR
                    message: >-
                      x-phone omitted and the group chat was not found on any
                      phone of the org
                    status: 404
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: NOT_FOUND_ERROR
                  message:
                    type: string
                    example: >-
                      x-phone omitted and the group chat was not found on any
                      phone of the org
                  status:
                    type: integer
                    example: 404
                example:
                  code: NOT_FOUND_ERROR
                  message: >-
                    x-phone omitted and the group chat was not found on any
                    phone of the org
                  status: 404
        '422':
          description: Request validation failed
          content:
            application/json:
              examples:
                error:
                  summary: Request validation failed
                  value:
                    code: VALIDATION_ERROR
                    message: Request validation failed
                    status: 422
                    fields:
                      body.chat_id:
                        message: chat_id is required
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: VALIDATION_ERROR
                  message:
                    type: string
                    example: Request validation failed
                  status:
                    type: integer
                    example: 422
                  fields:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        message:
                          type: string
                        value: {}
                    example:
                      body.chat_id:
                        message: chat_id is required
                example:
                  code: VALIDATION_ERROR
                  message: Request validation failed
                  status: 422
                  fields:
                    body.chat_id:
                      message: chat_id is required
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              examples:
                error:
                  summary: Rate limit exceeded
                  value:
                    code: RATE_LIMIT_ERROR
                    message: You can only make 100 requests per second
                    status: 429
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: RATE_LIMIT_ERROR
                  message:
                    type: string
                    example: You can only make 100 requests per second
                  status:
                    type: integer
                    example: 429
                example:
                  code: RATE_LIMIT_ERROR
                  message: You can only make 100 requests per second
                  status: 429
        '500':
          description: Internal server error
          content:
            application/json:
              examples:
                error:
                  summary: Internal server error
                  value:
                    code: UNKNOWN_ERROR
                    message: Internal server error
                    status: 500
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNKNOWN_ERROR
                  message:
                    type: string
                    example: Internal server error
                  status:
                    type: integer
                    example: 500
                example:
                  code: UNKNOWN_ERROR
                  message: Internal server error
                  status: 500
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript
          source: |-
            import { PeriskopeApi } from '@periskope/periskope-client';

            const client = new PeriskopeApi({
              authToken: 'YOUR_API_KEY',
              phone: '919876543210', // the phone to act with (x-phone)
            });

            async function main() {
              const response = await client.messages.sendMessage({
                chat_id: '911111111111@c.us',
              });
              console.log(response);
            }

            main();
        - lang: bash
          label: cURL
          source: |-
            curl -X POST 'https://api.periskope.app/v1/message/send' \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -H 'x-phone: 919876543210' \
              -H 'Content-Type: application/json' \
              -d '{
                "chat_id": "911111111111@c.us"
              }'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Periskope API token, sent as `Authorization: Bearer <token>`.
        Generate one from the Periskope dashboard under **Settings → API &
        Webhooks**. API access requires an active Pro or Enterprise plan.

````

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