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

# Post user message from a REST channel

> Post a message from the user and forward it to the assistant. Return the message of the assistant to the user.



## OpenAPI

````yaml /openapi/pro.yaml post /webhooks/{rest_channel}/webhook
openapi: 3.0.1
info:
  title: Rasa - Server Endpoints
  version: 1.0.0
  description: >-
    The Rasa server provides endpoints to retrieve trackers of conversations as
    well as endpoints to modify them. Additionally, endpoints for training and
    testing models are provided.
servers:
  - url: http://localhost:5005
    description: Local development server
security: []
paths:
  /webhooks/{rest_channel}/webhook:
    post:
      tags:
        - Channel Webhooks
      summary: Post user message from a REST channel
      description: >-
        Post a message from the user and forward it to the assistant. Return the
        message of the assistant to the user.
      operationId: postMessageRestChannel
      parameters:
        - $ref: '#/components/parameters/rest_channel'
      requestBody:
        description: The user message payload
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BasicMessagePayload'
      responses:
        '200':
          description: The message was processed successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  anyOf:
                    - $ref: '#/components/schemas/BotTextMessage'
                    - $ref: '#/components/schemas/BotImageMessage'
                    - $ref: '#/components/schemas/BotButtonsMessage'
                    - $ref: '#/components/schemas/BotAttachmentMessage'
        '401':
          $ref: '#/components/responses/401NotAuthenticated'
        '403':
          $ref: '#/components/responses/403NotAuthorized'
        '406':
          $ref: '#/components/responses/406InvalidHeader'
        '500':
          $ref: '#/components/responses/500ServerError'
      security:
        - TokenAuth: []
        - JWT: []
components:
  parameters:
    rest_channel:
      in: path
      name: rest_channel
      description: >-
        The REST channel used for custom integrations. They provide a URL where
        you can post messages and either receive response messages  directly, or
        asynchronously via a webhook.
      required: true
      schema:
        type: string
        enum:
          - rest
          - callback
  schemas:
    BasicMessagePayload:
      type: object
      properties:
        sender:
          type: string
          description: The sender ID
          example: default
        message:
          type: string
          description: The message text
          example: Hello!
    BotTextMessage:
      type: object
      properties:
        recipient_id:
          type: string
          description: Id of the message receiver
          example: default
        text:
          type: string
          description: Message
          example: Hello!
    BotImageMessage:
      type: object
      properties:
        recipient_id:
          type: string
          description: Id of the message receiver
          example: default
        image:
          type: string
          description: Image URL
          example: https://example.com/image.jpg
    BotButtonsMessage:
      type: object
      properties:
        recipient_id:
          type: string
          description: Id of the message receiver
          example: default
        buttons:
          type: array
          description: Quick reply buttons
          items:
            type: object
            properties:
              title:
                type: string
                description: Button caption
              payload:
                type: string
                description: Payload to be sent if button is clicked
          example:
            - title: 'Yes'
              payload: 'yes'
            - title: 'No'
              payload: 'no'
    BotAttachmentMessage:
      type: object
      properties:
        recipient_id:
          type: string
          description: Id of the message receiver
          example: default
        attachement:
          type: array
          description: Additional information
          items:
            type: object
            properties:
              title:
                type: string
                description: Attachment caption
                example: Attachment Title
              payload:
                type: string
                description: Attachment payload
                example: Attachment Payload
    Error:
      type: object
      properties:
        version:
          type: string
          description: Rasa version
        status:
          type: string
          enum:
            - failure
          description: Status of the requested action
        message:
          type: string
          description: Error message
        reason:
          type: string
          description: Error category
        details:
          type: object
          description: Additional error information
        help:
          type: string
          description: Optional URL to additonal material
        code:
          type: number
          description: HTTP status code
  responses:
    401NotAuthenticated:
      description: User is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: NotAuthenticated
            message: User is not authenticated to access resource.
            code: 401
    403NotAuthorized:
      description: User has insufficient permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: NotAuthorized
            message: User has insufficient permission to access resource.
            code: 403
    406InvalidHeader:
      description: Invalid header provided.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: failure
            reason: InvalidHeader
            message: Invalid header was provided with the request.
            code: 406
    500ServerError:
      description: An unexpected error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            version: 1.0.0
            status: ServerError
            message: An unexpected error occurred.
            code: 500
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: query
      name: token
      description: >
        A plaintext token to secure your server, specified at startup in the
        argument `--auth-token thisismysecret`
    JWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        A JWT token that is signed using the JWT secret specified at startup in
        the argument `--jwt-secret thisismysecret`,

        using the `HS256` algorithm.


        The token's payload must contain an object under the `user` key,

        which in turn must contain the `username` and `role` attributes.

        The following is an example payload for a JWT token:


        ```json

        {
            "user": {
                "username": "<sender_id>",
                "role": "user"
            }
        }

        ```


        If the `role` is `admin`, all endpoints are accessible.

        If the `role` is `user`, endpoints with a `sender_id` parameter are only
        accessible

        if the `sender_id` matches the payload's `username` property.


        For the user trackers endpoint (`GET /users/{user_id}/trackers`), you
        should use `user_id` instead of `username` in the payload.

        In this case, the path `user_id` parameter is matched against the
        payload's `username` property. For example:


        ```json

        {
            "user": {
                "username": "<user_id>",
                "role": "user"
            }
        }

        ```

````