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

# Send Message

> Sends Message to the Thread between a Agent and an EndUser, returns the Message created from the request, the Messages generated in response, and returns information about the Thread between the Agent and EndUser



## OpenAPI

````yaml POST /message
openapi: 3.0.1
info:
  title: Altur API
  description: >-
    An API aimed to allow third-party developers to interact with the Altur
    platform through a RESTful interface.
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.altur.io/api/v1.0
security:
  - apiKeyAuth: []
paths:
  /message:
    post:
      description: >-
        Sends Message to the Thread between a Agent and an EndUser, returns the
        Message created from the request, the Messages generated in response,
        and returns information about the Thread between the Agent and EndUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                agent_id:
                  description: Unique identifier of the Agent receiving the Message
                  type: string
                  format: uuid4
                end_user_id:
                  description: Unique identifier of the EndUser sending the Message
                  type: string
                  format: uuid4
                content:
                  description: Text content of the Message
                  type: string
      responses:
        '200':
          description: Thread response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent or EndUser not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    MessageResponse:
      type: object
      properties:
        thread:
          $ref: '#/components/schemas/Thread'
        messages:
          description: Array of Messages in response to prompted Message
          type: array
          items:
            $ref: '#/components/schemas/Message'
        in_response_to:
          $ref: '#/components/schemas/Message'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    Thread:
      type: object
      properties:
        id:
          description: Unique identifier for the Thread
          type: string
        agent:
          $ref: '#/components/schemas/Agent'
        end_user:
          $ref: '#/components/schemas/EndUser'
        integration:
          $ref: '#/components/schemas/Integration'
        updated_at:
          description: Last time the Thread was updated
          type: string
          format: date-time
        active:
          description: >-
            Boolean describing if automatic responses by the Agent are active on
            this Thread
          type: boolean
        blocked:
          description: Boolean describing if Thread is blocked
          type: boolean
        tags:
          description: Tags assigned to Thread
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        assigned_to:
          description: Users assigned to Thread
          type: array
          items:
            $ref: '#/components/schemas/User'
    Message:
      type: object
      properties:
        thread_id:
          description: Unique identifier of the Thread the Message belongs to
          type: string
        type:
          description: Message type enum
          type: string
          enum:
            - text
            - image
            - audio
            - video
            - button
            - template
            - document
        content:
          description: Message's text content
          type: string
        media:
          description: Message's media content, if any (usually in form of URL)
          type: string
        sent_by:
          description: Author of this message
          type: string
          enum:
            - AI
            - EU
            - SYS
        sent_by_user:
          description: Altur user id (if Message was sent manually by an in-app user)
          type: string
        sent_at:
          description: Datetime from when the Message was sent
          type: string
          format: date-time
        read:
          description: Boolean describing if the Message is considered as read
          type: boolean
      required:
        - thread_id
        - type
        - sent_by
        - sent_at
    Agent:
      type: object
      properties:
        id:
          description: Unique identifier for the Agent
          type: string
          format: uuid4
        name:
          description: Name of the Agent
          type: string
    EndUser:
      type: object
      properties:
        id:
          description: Unique identifier for the EndUser
          type: string
          format: uuid4
        display_name:
          description: EndUser's display name
          type: string
        integration_type:
          description: Enum representing the Integration's channel
          type: string
          enum:
            - api
            - whatsapp
        info:
          description: >-
            EndUser's information valuable for interactions with Agents or human
            agents
          type: string
      required:
        - id
        - display_name
        - integration
    Integration:
      type: object
      properties:
        id:
          description: Unique identifier for the Integration
          type: string
        type:
          description: Enum representing the Integration's channel
          type: string
          enum:
            - api
            - whatsapp
      required:
        - id
        - type
    Tag:
      type: object
      properties:
        id:
          description: Unique identifier for the Tag
          type: string
        name:
          description: Name given to the Tag
          type: string
        color:
          description: Color used for in-app display of Tag
          type: string
          enum:
            - blue
            - green
            - red
            - pink
            - purple
            - orange
            - yellow
      required:
        - id
        - name
        - color
    User:
      type: object
      properties:
        id:
          description: Unique identifier for the User
          type: string
        email:
          description: User's email address
          type: string
        first_name:
          description: User's first name
          type: string
        last_name:
          description: User's last name
          type: string
      required:
        - id
        - email
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Add `api-key YOUR_API_SECRET_KEY` as the value of the `Authorization`
        header.

````