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

# Send a message

> Sends a message to a channel. Requires channelId and text. channelId must be a bare
UUID (do not include the GetStream 'messaging:' prefix). When senderId is provided it
must be a member of the channel; otherwise the authenticated user is used as the author.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/messages
openapi: 3.0.0
info:
  contact: {}
  title: Assembly API
  version: 0.0.1
servers:
  - url: https://api.assembly.com
security: []
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: Send a message
      description: >-
        Sends a message to a channel. Requires channelId and text. channelId
        must be a bare

        UUID (do not include the GetStream 'messaging:' prefix). When senderId
        is provided it

        must be a member of the channel; otherwise the authenticated user is
        used as the author.
      operationId: send-message
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/messages.CreateMessageInput'
        description: Message to send
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/messages.Message'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Invalid request body, channel ID, or sender ID
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Missing or invalid API key
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Unexpected server error
      security:
        - APIKeyHeader: []
components:
  schemas:
    messages.CreateMessageInput:
      properties:
        channelId:
          description: >-
            ChannelID identifies the channel the message is sent to. Required.
            Must be a bare UUID and must not include the GetStream 'messaging:'
            prefix.
          example: 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        senderId:
          description: >-
            SenderID optionally overrides the author of the message. When
            omitted, the authenticated user is used. When set it must be the
            UUID of a member of the channel.
          example: 550e8400-e29b-41d4-a716-446655440001
          format: uuid
          type: string
        text:
          description: >-
            Text is the body of the message. Required. Limited to 5000
            characters by GetStream.
          example: Thanks for the update, I'll review the contract today.
          type: string
      required:
        - channelId
        - text
      type: object
    messages.Message:
      properties:
        channelId:
          description: >-
            ChannelID is the channel the message belongs to (bare UUID, without
            the GetStream 'messaging:' prefix).
          example: 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        createdAt:
          type: string
        creatorId:
          type: string
        data:
          type: string
        id:
          type: string
        identityId:
          type: string
        isAttachmentIncluded:
          description: >-
            IsAttachmentIncluded indicates whether the message has one or more
            attachments.
          example: false
          type: boolean
        object:
          description: Object is the resource type discriminator, always "message".
          example: message
          type: string
        previousAttributes:
          additionalProperties: true
          type: object
        ref:
          type: string
        senderId:
          description: SenderID is the UUID of the member who authored the message.
          example: 550e8400-e29b-41d4-a716-446655440001
          format: uuid
          type: string
        text:
          description: >-
            Text is the body of the message. Empty when the message only carries
            attachments.
          example: Thanks for the update, I'll review the contract today.
          type: string
        updatedAt:
          type: string
      type: object
    dispatcher.Error:
      properties:
        code:
          type: string
        data: {}
        message:
          type: string
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-KEY
      type: apiKey

````