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

# Send Message

> Send a message

### Postal Messages

When sending a postal message, the recipient must contain the `contact_id` and no `handle`. If the contact does not exist yet, make sure to create it first.


## OpenAPI

````yaml post /send_message
openapi: 3.1.0
info:
  title: Mateo API
  description: The official API for Mateo
  version: 1.0.0
servers:
  - url: https://integration.getmateo.com/api/v1
security:
  - bearerAuth: []
externalDocs:
  description: Documentation for Mateo API
  url: https://docs.getmateo.com
paths:
  /send_message:
    post:
      tags:
        - Send Message
      summary: Send Message
      description: Send a message
      operationId: postIndex3
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: Channel ID from which the message will be sent
                id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                  description: Message ID
                conversation_id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                  description: Conversation ID
                conversation_status:
                  anyOf:
                    - type: string
                      enum:
                        - open
                        - closed
                        - archived
                    - type: 'null'
                  description: Conversation Status
                to:
                  anyOf:
                    - type: array
                      items:
                        type: object
                        properties:
                          handle:
                            anyOf:
                              - anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: string
                              - type: 'null'
                          country_codes:
                            type: array
                            items:
                              type: string
                          full_name:
                            anyOf:
                              - type: string
                              - type: 'null'
                          contact_id:
                            anyOf:
                              - type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                              - type: 'null'
                          external_contact_id:
                            anyOf:
                              - type: string
                              - type: 'null'
                          secondary_external_contact_id:
                            anyOf:
                              - type: string
                              - type: 'null'
                        description: A recipient of the message
                    - type: 'null'
                  description: To Recipients of the message
                cc:
                  anyOf:
                    - type: array
                      items:
                        type: object
                        properties:
                          handle:
                            anyOf:
                              - anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: string
                              - type: 'null'
                          country_codes:
                            type: array
                            items:
                              type: string
                          full_name:
                            anyOf:
                              - type: string
                              - type: 'null'
                          contact_id:
                            anyOf:
                              - type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                              - type: 'null'
                          external_contact_id:
                            anyOf:
                              - type: string
                              - type: 'null'
                          secondary_external_contact_id:
                            anyOf:
                              - type: string
                              - type: 'null'
                        description: A recipient of the message
                    - type: 'null'
                  description: CC Recipients of the message
                bcc:
                  anyOf:
                    - type: array
                      items:
                        type: object
                        properties:
                          handle:
                            anyOf:
                              - anyOf:
                                  - type: string
                                  - type: array
                                    items:
                                      type: string
                              - type: 'null'
                          country_codes:
                            type: array
                            items:
                              type: string
                          full_name:
                            anyOf:
                              - type: string
                              - type: 'null'
                          contact_id:
                            anyOf:
                              - type: string
                                format: uuid
                                pattern: >-
                                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                              - type: 'null'
                          external_contact_id:
                            anyOf:
                              - type: string
                              - type: 'null'
                          secondary_external_contact_id:
                            anyOf:
                              - type: string
                              - type: 'null'
                        description: A recipient of the message
                    - type: 'null'
                  description: BCC Recipients of the message
                subject:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Subject of the message
                html:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: HTML content of the message
                text:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Text content of the message
                content:
                  anyOf:
                    - type: object
                      properties: {}
                      additionalProperties: {}
                    - type: 'null'
                  description: >-
                    Content of the message. Only use this if you know what you
                    are doing. Prefer using html or text otherwise
                send_after:
                  anyOf:
                    - type: string
                      format: date-time
                      pattern: >-
                        ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                    - type: 'null'
                  description: Send the message after this time
                placeholder_values:
                  anyOf:
                    - type: array
                      items:
                        type: string
                    - type: 'null'
                  description: Placeholder values for the message
                reply_to_message_id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                  description: Message ID to which this message is a reply
                attachments:
                  anyOf:
                    - type: array
                      items:
                        type: string
                    - type: 'null'
                  description: >-
                    Attachment URLs to the message. Can either https:// or
                    media_library://
                template_id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                  description: Template ID
                review_channel_id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                  description: Review Channel ID
                marketing_channel_id:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    - type: 'null'
                  description: Marketing Channel ID
                actions:
                  anyOf:
                    - type: array
                      items:
                        type: object
                        properties:
                          data:
                            anyOf:
                              - type: string
                              - type: 'null'
                          text:
                            type: string
                          type:
                            type: string
                            enum:
                              - quick_reply
                              - call_to_action
                              - list
                          subtype:
                            anyOf:
                              - type: string
                                enum:
                                  - url
                                  - phone_number
                              - type: 'null'
                        required:
                          - text
                          - type
                    - type: 'null'
                  description: Actions for the message, e.g. quick reply buttons
                footer:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Footer text for the message
              required:
                - from
      responses:
        '200':
          content:
            application/vnd.pgrst.object+json:
              schema:
                type: object
                properties:
                  conversation:
                    type: object
                    properties:
                      id:
                        type: string
                      created_at:
                        type: string
                      updated_at:
                        type: string
                      organisation_id:
                        type: string
                      subject:
                        anyOf:
                          - type: string
                          - type: 'null'
                      assignee_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      unread:
                        anyOf:
                          - type: boolean
                          - type: 'null'
                      channel_id:
                        type: string
                      contact_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      external_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      is_spam:
                        type: boolean
                      inbox_id:
                        type: string
                      latest_message_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      latest_inbound_message_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      latest_message_created_at:
                        anyOf:
                          - type: string
                          - type: 'null'
                      latest_inbound_message_created_at:
                        anyOf:
                          - type: string
                          - type: 'null'
                      tags:
                        anyOf:
                          - type: array
                            items:
                              type: string
                          - type: 'null'
                      files:
                        anyOf:
                          - type: array
                            items:
                              type: object
                              properties: {}
                              additionalProperties: {}
                          - type: 'null'
                      channel_type:
                        type: string
                        enum:
                          - email
                          - sms
                          - whatsapp
                          - facebook
                          - instagram
                          - google_business_messaging
                      status:
                        type: string
                        enum:
                          - open
                          - closed
                          - archived
                    required:
                      - id
                      - created_at
                      - updated_at
                      - organisation_id
                      - subject
                      - assignee_id
                      - unread
                      - channel_id
                      - contact_id
                      - external_id
                      - is_spam
                      - inbox_id
                      - latest_message_id
                      - latest_inbound_message_id
                      - latest_message_created_at
                      - latest_inbound_message_created_at
                      - tags
                      - files
                      - channel_type
                      - status
                  message:
                    type: object
                    properties:
                      id:
                        type: string
                      created_at:
                        type: string
                      updated_at:
                        type: string
                      organisation_id:
                        type: string
                      conversation_id:
                        type: string
                      is_inbound:
                        type: boolean
                      subject:
                        anyOf:
                          - type: string
                          - type: 'null'
                      blurb:
                        anyOf:
                          - type: string
                          - type: 'null'
                      author_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      content:
                        anyOf:
                          - type: object
                            properties: {}
                            additionalProperties: {}
                          - type: 'null'
                      raw_content:
                        anyOf:
                          - type: string
                          - type: 'null'
                      status:
                        type: string
                        enum:
                          - sent
                          - sending_error
                          - bounce_error
                          - submission_error
                          - submitted
                          - sending
                          - read
                          - draft
                          - scheduled
                          - interacted
                      attachment_count:
                        anyOf:
                          - type: number
                          - type: 'null'
                      reply_to_message_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      external_files:
                        anyOf:
                          - type: object
                            properties: {}
                            additionalProperties: {}
                          - type: 'null'
                      external_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      template_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      review_channel_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      author_type:
                        anyOf:
                          - type: string
                            enum:
                              - employee
                              - bot
                              - external
                          - type: 'null'
                      forwarded:
                        anyOf:
                          - type: boolean
                          - type: 'null'
                      forwarded_message_text:
                        anyOf:
                          - type: string
                          - type: 'null'
                      send_after:
                        anyOf:
                          - type: string
                          - type: 'null'
                      footer:
                        anyOf:
                          - type: string
                          - type: 'null'
                      sendout_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      campaign_id:
                        anyOf:
                          - type: string
                          - type: 'null'
                      sent_at:
                        anyOf:
                          - type: string
                          - type: 'null'
                      timestamp:
                        anyOf:
                          - type: string
                          - type: 'null'
                      location:
                        anyOf:
                          - type: object
                            properties: {}
                            additionalProperties: {}
                          - type: 'null'
                      location_metadata:
                        anyOf:
                          - type: object
                            properties: {}
                            additionalProperties: {}
                          - type: 'null'
                      contacts:
                        anyOf:
                          - type: object
                            properties: {}
                            additionalProperties: {}
                          - type: 'null'
                      files:
                        anyOf:
                          - type: object
                            properties: {}
                            additionalProperties: {}
                          - type: 'null'
                      header_media_filename:
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - id
                      - created_at
                      - updated_at
                      - organisation_id
                      - conversation_id
                      - is_inbound
                      - subject
                      - blurb
                      - author_id
                      - content
                      - raw_content
                      - status
                      - attachment_count
                      - reply_to_message_id
                      - external_files
                      - external_id
                      - template_id
                      - review_channel_id
                      - author_type
                      - forwarded
                      - forwarded_message_text
                      - send_after
                      - footer
                      - sendout_id
                      - campaign_id
                      - sent_at
                      - timestamp
                      - location
                      - location_metadata
                      - contacts
                      - files
                      - header_media_filename
                  recipients:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        created_at:
                          type: string
                        updated_at:
                          type: string
                        organisation_id:
                          type: string
                        conversation_id:
                          type: string
                        message_id:
                          type: string
                        contact_id:
                          anyOf:
                            - type: string
                            - type: 'null'
                        handle:
                          type: string
                        full_name:
                          anyOf:
                            - type: string
                            - type: 'null'
                        is_organisation:
                          anyOf:
                            - type: boolean
                            - type: 'null'
                        role:
                          type: string
                          enum:
                            - from
                            - to
                            - cc
                            - bcc
                            - reply_to
                        status:
                          type: string
                          enum:
                            - sent
                            - sending_error
                            - bounce_error
                            - submission_error
                            - submitted
                            - sending
                            - read
                            - draft
                            - scheduled
                            - interacted
                      required:
                        - id
                        - created_at
                        - updated_at
                        - organisation_id
                        - conversation_id
                        - message_id
                        - contact_id
                        - handle
                        - full_name
                        - is_organisation
                        - role
                        - status
                  actions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        created_at:
                          type: string
                        updated_at:
                          type: string
                        organisation_id:
                          type: string
                        conversation_id:
                          type: string
                        message_id:
                          type: string
                        text:
                          type: string
                        data:
                          anyOf:
                            - type: string
                            - type: 'null'
                        clicked:
                          type: boolean
                        type:
                          type: string
                          enum:
                            - quick_reply
                            - call_to_action
                            - list
                        subtype:
                          type: string
                          enum:
                            - url
                            - phone_number
                      required:
                        - id
                        - created_at
                        - updated_at
                        - organisation_id
                        - conversation_id
                        - message_id
                        - text
                        - data
                        - clicked
                        - type
                        - subtype
                required:
                  - conversation
                  - message
                  - recipients
                  - actions
          description: The message was sent successfully
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  hint:
                    type: string
                  statusCode:
                    type: number
                required:
                  - code
                  - message
                  - statusCode
          description: Invalid input
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````