> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish message to stream

> Publishes a message to a stream



## OpenAPI

````yaml /api-reference/endpoint/storage/openapi.json post /storage/streams/{name}/messages
openapi: 3.0.3
info:
  title: quiva.ai Gateway
  description: >-
    A comprehensive interface for managing key-value stores, object stores,
    streams, and search indexing
  contact:
    name: quiva.ai Support
    url: https://quiva.ai/help-center/
  version: 1.0.0
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /storage/streams/{name}/messages:
    post:
      tags:
        - Messages
      summary: Publish message to stream
      description: Publishes a message to a stream
      operationId: publishMessage
      parameters:
        - $ref: '#/components/parameters/streamName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishMessageRequest'
            examples:
              user_login_event:
                summary: User login event
                value:
                  stream: user-events
                  subject: events.user.login
                  body:
                    user_id: usr_abc123
                    email: user@example.com
                    ip_address: 192.168.1.100
                    user_agent: Mozilla/5.0
                    timestamp: '2024-03-15T14:30:00Z'
              order_created_event:
                summary: Order created event
                value:
                  stream: order-processing
                  subject: orders.created
                  body:
                    order_id: ord_xyz789
                    customer_id: cust_456
                    items:
                      - sku: PROD-001
                        quantity: 2
                        price: 29.99
                      - sku: PROD-002
                        quantity: 1
                        price: 49.99
                    total: 109.97
                    currency: USD
                    created_at: '2024-03-15T14:35:00Z'
              system_metric:
                summary: System metric event
                value:
                  stream: system-logs
                  subject: logs.system.metrics
                  body:
                    host: api-server-01
                    cpu_usage: 45.2
                    memory_usage: 68.5
                    disk_usage: 32.1
                    active_connections: 1250
                    timestamp: '2024-03-15T14:40:00Z'
              notification_event:
                summary: Notification event
                value:
                  stream: realtime-notifications
                  subject: notifications.email
                  body:
                    notification_id: notif_001
                    type: email
                    recipient: user@example.com
                    template: welcome_email
                    variables:
                      name: John Doe
                      activation_link: https://example.com/activate/abc123
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    streamName:
      name: name
      in: path
      description: Name of the stream
      required: true
      schema:
        type: string
  schemas:
    PublishMessageRequest:
      type: object
      required:
        - stream
        - subject
        - body
      properties:
        stream:
          type: string
          description: Stream name
        subject:
          type: string
          description: Message subject
        body:
          type: object
          description: Message payload
          additionalProperties: true
    SuccessMessage:
      type: object
      properties:
        message:
          type: string
          example: success
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
  responses:
    SuccessResponse:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuccessMessage'
          example:
            message: success
    BadRequestError:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: validation_error
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: unauthorized
    NotFoundError:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: not_found
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: internal_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````