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

# Send a message to a channel (channelId in body)



## OpenAPI

````yaml /openapi.json post /api/v1/messages
openapi: 3.0.0
info:
  title: Placet API
  description: Chat-based agent inbox for AI-human interaction
  version: 0.1.0
  contact: {}
servers:
  - url: http://localhost:3001
    description: Local development
security: []
tags: []
paths:
  /api/v1/messages:
    post:
      tags:
        - Messages
      summary: Send a message to a channel (channelId in body)
      operationId: MessagesAgentController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageDto'
      responses:
        '201':
          description: Message created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageItemResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not your agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api-key: []
components:
  schemas:
    CreateMessageDto:
      type: object
      properties:
        channelId:
          type: string
          minLength: 1
        text:
          type: string
        status:
          type: string
          enum:
            - info
            - success
            - warning
            - error
        review:
          $ref: '#/components/schemas/CreateMessageDtoReview'
        metadata:
          type: object
          additionalProperties: {}
        webhookUrl:
          type: string
          format: uri
        attachmentIds:
          type: array
          items:
            type: string
        textAttachments:
          type: array
          items:
            type: object
            properties:
              content:
                type: string
                minLength: 1
              filename:
                default: content.md
                type: string
                minLength: 1
              mimeType:
                default: text/markdown
                type: string
            required:
              - content
        iterationOf:
          type: string
      required:
        - channelId
    MessageItemResponse:
      type: object
      properties:
        id:
          type: string
          example: clxyz111
        channelId:
          type: string
          example: clxyz456
        senderType:
          type: string
          example: agent
          enum:
            - agent
            - user
        senderId:
          type: string
          example: clxyz456
        text:
          type: string
          example: Hello from agent
        status:
          type: string
          example: info
          enum:
            - info
            - success
            - warning
            - error
        review:
          type: object
          example:
            type: approval
            status: pending
          description: Review object (null if no review)
        metadata:
          type: object
          example:
            source: automation
          description: Arbitrary metadata
        createdAt:
          type: string
          example: '2025-01-01T00:00:00.000Z'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/AttachmentResponse'
      required:
        - id
        - channelId
        - senderType
        - senderId
        - createdAt
        - attachments
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Validation failed
        errors:
          description: Zod validation errors (only on 400)
          type: array
          items:
            $ref: '#/components/schemas/ZodValidationError'
      required:
        - statusCode
        - message
    CreateMessageDtoReview:
      type: object
      properties:
        type:
          type: string
        payload:
          type: object
          additionalProperties: {}
        callback:
          $ref: '#/components/schemas/CreateMessageDtoReviewCallback'
          nullable: true
        expiresAt:
          type: string
          nullable: true
        expiresInSeconds:
          type: integer
          maximum: 9007199254740991
          minimum: 0
          exclusiveMinimum: true
      required:
        - type
    AttachmentResponse:
      type: object
      properties:
        id:
          type: string
          example: clxyz789
        messageId:
          type: string
          example: clxyz123
        pluginType:
          type: string
          example: file
        filename:
          type: string
          example: report.pdf
        mimeType:
          type: string
          example: application/pdf
        size:
          type: number
          example: 1024
        storageKey:
          type: string
          example: uploads/clxyz123/report.pdf
        createdAt:
          type: string
          example: '2025-01-01T00:00:00.000Z'
      required:
        - id
        - messageId
        - pluginType
        - filename
        - mimeType
        - size
        - storageKey
        - createdAt
    ZodValidationError:
      type: object
      properties:
        code:
          type: string
          example: invalid_type
        message:
          type: string
          example: Expected string, received number
        path:
          example:
            - email
          type: array
          items:
            type: string
      required:
        - code
        - message
        - path
    CreateMessageDtoReviewCallback:
      type: object
      properties:
        url:
          type: string
          format: uri
        method:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
      required:
        - url
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Placet API key (hp_...)

````