> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-ak-docs-20-document-updating-variables-from-outsid.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# createMessage

> Creates a new [Message](#schema_message). When creating a new [Message](#schema_message), the required tags must be provided. See the specific integration for more details.



## OpenAPI

````yaml runtime-openapi.json post /v1/chat/messages
openapi: 3.0.0
info:
  title: Botpress Runtime API
  description: API for Botpress Runtime
  version: 1.52.1
servers:
  - url: https://api.botpress.cloud
security:
  - BearerAuth: []
tags:
  - name: documented
paths:
  /v1/chat/messages:
    post:
      tags:
        - Endpoints
      description: >-
        Creates a new [Message](#schema_message). When creating a new
        [Message](#schema_message), the required tags must be provided. See the
        specific integration for more details.
      operationId: createMessage
      parameters:
        - name: x-bot-id
          in: header
          description: Bot id
          required: true
          schema:
            type: string
        - name: x-integration-id
          in: header
          description: Integration id
          required: false
          schema:
            type: string
        - name: x-integration-alias
          in: header
          description: Integration alias
          required: false
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/createMessageBody'
      responses:
        '201':
          $ref: '#/components/responses/createMessageResponse'
        default:
          $ref: '#/components/responses/createMessageResponse'
components:
  requestBodies:
    createMessageBody:
      description: Message data
      content:
        application/json:
          schema:
            type: object
            properties:
              payload:
                type: object
                additionalProperties: true
                description: >-
                  Payload is the content type of the message. Accepted payload
                  options: Text, Image, Choice, Dropdown, Card, Carousel, File,
                  Audio, Video, Location
              userId:
                type: string
                minLength: 28
                maxLength: 36
                description: ID of the [User](#schema_user)
              conversationId:
                type: string
                minLength: 28
                maxLength: 36
                description: ID of the [Conversation](#schema_conversation)
              type:
                type: string
                maxLength: 200
                description: >-
                  Type of the [Message](#schema_message) represents the resource
                  type that the message is related to
              tags:
                type: object
                additionalProperties:
                  type: string
                  maxLength: 500
                description: >-
                  Set of [Tags](/docs/developers/concepts/tags) that you can
                  attach to a [Message](#schema_message). The set of
                  [Tags](/docs/developers/concepts/tags) available on a
                  [Message](#schema_message) is restricted by the list of
                  [Tags](/docs/developers/concepts/tags) defined previously by
                  the [Bot](#schema_bot). Individual keys can be unset by
                  posting an empty value to them.
              schedule:
                type: object
                properties:
                  dateTime:
                    type: string
                    maxLength: 28
                    minLength: 24
                    description: >-
                      When the [Message](#schema_message) will be sent, in the
                      ISO 8601 format
                  delay:
                    type: number
                    description: >-
                      Delay in milliseconds before sending the
                      [Message](#schema_message)
                description: >-
                  Schedule the Message to be sent at a specific time. Either
                  dateTime or delay must be provided.
                additionalProperties: false
              origin:
                type: string
                enum:
                  - synthetic
            required:
              - payload
              - userId
              - conversationId
              - type
              - tags
            title: createMessageBody
            additionalProperties: false
  responses:
    createMessageResponse:
      description: Returns a [Message](#schema_message) object if creation succeeds.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                $ref: '#/components/schemas/Message'
            required:
              - message
            title: createMessageResponse
            additionalProperties: false
  schemas:
    Message:
      type: object
      properties:
        id:
          type: string
          minLength: 28
          maxLength: 36
          description: Id of the [Message](#schema_message)
        createdAt:
          type: string
          format: date-time
          description: Creation date of the [Message](#schema_message) in ISO 8601 format
        updatedAt:
          type: string
          format: date-time
          description: Update date of the [Message](#schema_message) in ISO 8601 format
        type:
          type: string
          maxLength: 200
          description: >-
            Type of the [Message](#schema_message) represents the resource type
            that the message is related to
        payload:
          type: object
          additionalProperties: true
          description: >-
            Payload is the content type of the message. Accepted payload
            options: Text, Image, Choice, Dropdown, Card, Carousel, File, Audio,
            Video, Location
        direction:
          type: string
          enum:
            - incoming
            - outgoing
          description: Direction of the message (`incoming` or `outgoing`).
        userId:
          type: string
          minLength: 28
          maxLength: 36
          description: ID of the [User](#schema_user)
        conversationId:
          type: string
          minLength: 28
          maxLength: 36
          description: ID of the [Conversation](#schema_conversation)
        tags:
          type: object
          additionalProperties:
            type: string
          description: >-
            Set of [Tags](/docs/developers/concepts/tags) that you can attach to
            a [Conversation](#schema_conversation). The set of
            [Tags](/docs/developers/concepts/tags) available on a
            [Conversation](#schema_conversation) is restricted by the list of
            [Tags](/docs/developers/concepts/tags) defined previously by the
            [Bot](#schema_bot). Individual keys can be unset by posting an empty
            value to them.
        origin:
          type: string
          enum:
            - synthetic
          description: Origin of the message (`synthetic`).
      required:
        - id
        - createdAt
        - updatedAt
        - type
        - payload
        - direction
        - userId
        - conversationId
        - tags
      description: >-
        The Message object represents a message in a
        [Conversation](#schema_conversation) for a specific
        [User](#schema_user).
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````