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

# Send a message

> Sends an SMS/MMS from a workspace outbound channel (`from`) to a contact (`to`). Requires `text`, `mediaUrl`, or both. `userId` in the body is ignored.



## OpenAPI

````yaml developer/api-reference/openapi.json POST /integrations/developer/zapier/send-message-action
openapi: 3.1.0
info:
  contact:
    email: support@messagedesk.com
    name: MessageDesk Support
    url: https://messagedesk.com
  description: >-
    The MessageDesk Developer API. Integration providers use it to read and
    write a workspace on a user's behalf. Zapier is the only supported provider
    today; endpoints are namespaced by provider under
    `/integrations/developer/{provider}`.
  title: MessageDesk API
  version: '1.0'
servers:
  - description: Production
    url: https://c3uezq47el.execute-api.us-west-2.amazonaws.com/main
security: []
tags:
  - description: >-
      Read-only lookups an integration uses while a user configures it: the
      workspaces they belong to, and the users, phone numbers and contact
      properties in a workspace.
    name: Context lookups
  - description: >-
      Write operations an integration performs on behalf of a user. Every
      request body carries the target workspace as `id` and names the calling
      provider in `developerProvider`.
    name: Actions
  - description: >-
      Event subscriptions for instant triggers, plus sample-data endpoints that
      return a workspace's most recent records (or generated placeholders when
      it has none) in exactly the shape the matching webhook delivers.
    name: Triggers
externalDocs:
  description: ''
  url: ''
paths:
  /integrations/developer/zapier/send-message-action:
    post:
      tags:
        - Actions
      summary: Send a message
      description: >-
        Sends an SMS/MMS from a workspace outbound channel (`from`) to a contact
        (`to`). Requires `text`, `mediaUrl`, or both. `userId` in the body is
        ignored.
      operationId: sendMessage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/developer.DeveloperSendMessageRequest'
              summary: request
              description: Message to send
        description: Message to send
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/developer.DeveloperProviderSendMessageResponse
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: Missing or invalid bearer token
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: The authenticated user is not a member of the workspace
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: Workspace or referenced record not found
        '422':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/validator.ValidationError'
                type: array
          description: Request body failed validation
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/openapi.ErrorResponse'
          description: Internal Server Error
      security:
        - BearerAuth: []
components:
  schemas:
    developer.DeveloperSendMessageRequest:
      properties:
        developerProvider:
          $ref: '#/components/schemas/enums.DeveloperProvider'
          description: Integration provider making the request
        from:
          description: Workspace phone number (outbound channel) in E.164 format
          type: string
        id:
          description: Workspace ID the request targets
          maxLength: 45
          type: string
        mediaUrl:
          description: Publicly reachable URL of an image or file to attach
          type: string
        text:
          description: Message text, up to 1200 characters
          maxLength: 1200
          type: string
        to:
          description: Contact phone number in E.164 format
          type: string
        userId:
          description: >-
            Optional acting user; overwritten with the authenticated user on
            endpoints that record authorship
          maxLength: 45
          type: string
      required:
        - developerProvider
        - from
        - id
        - to
      type: object
    developer.DeveloperProviderSendMessageResponse:
      properties:
        conversationId:
          type: string
        from:
          type: string
        id:
          type: string
        text:
          type: string
        to:
          type: string
        workspaceId:
          type: string
      type: object
    openapi.ErrorResponse:
      properties:
        error:
          description: Human-readable description of the failure
          example: workspace not found
          type: string
      type: object
    validator.ValidationError:
      properties:
        field:
          type: string
        message:
          type: string
      type: object
    enums.DeveloperProvider:
      enum:
        - zapier
      type: string
      x-enum-varnames:
        - DeveloperProviderZapier
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: >-
        An OAuth 2.0 access token, sent as `Authorization: Bearer <token>`.
        MessageDesk is the OAuth 2.0 provider (backed by AWS Cognito): an
        integration such as Zapier obtains the token through the
        authorization-code flow when a user connects their MessageDesk account.
        Access tokens are valid for 24 hours and are refreshed with the refresh
        token.
      scheme: bearer
      type: http

````