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

# Publish events to a topic



## OpenAPI

````yaml api-reference/endpoints/events/api-reference/openapi.json post /api/v1/events/publish
openapi: 3.1.0
info:
  title: Polos Orchestrator API
  description: API for the Polos durable execution platform for AI agents
  contact:
    name: Polos Team
    url: https://github.com/polos-dev/polos
  license:
    name: ''
  version: 1.0.0
servers:
  - url: /
    description: Current server
security: []
tags:
  - name: Health
    description: Health check endpoints
  - name: Projects
    description: Project management endpoints
  - name: Agents
    description: Agent definition management
  - name: Tools
    description: Tool definition management
  - name: Workflows
    description: Workflow management
  - name: Executions
    description: Workflow execution management
  - name: Traces
    description: Observability traces
  - name: Events
    description: Event publishing and streaming
  - name: Event Triggers
    description: Event-based workflow triggers
  - name: Schedules
    description: Scheduled workflow execution
  - name: Workers
    description: Worker registration and management
  - name: Deployments
    description: Deployment management
paths:
  /api/v1/events/publish:
    post:
      tags:
        - Events
      summary: Publish events to a topic
      operationId: publish_event
      parameters:
        - name: X-Project-ID
          in: header
          description: Project ID (optional if execution_id is provided)
          required: false
          schema:
            type:
              - string
              - 'null'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishEventRequest'
        required: true
      responses:
        '200':
          description: Events published successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishEventResponse'
        '400':
          description: Bad request
        '500':
          description: Internal server error
      security:
        - bearer_auth: []
        - cookie_auth: []
components:
  schemas:
    PublishEventRequest:
      type: object
      description: Request to publish events
      required:
        - topic
        - events
      properties:
        durable:
          type:
            - boolean
            - 'null'
          description: Whether events are durable (deprecated)
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventData'
          description: List of events to publish
        execution_id:
          type:
            - string
            - 'null'
          description: Source execution ID
        root_execution_id:
          type:
            - string
            - 'null'
          description: Root execution ID
        topic:
          type: string
          description: Topic to publish to
    PublishEventResponse:
      type: object
      description: Response after publishing events
      required:
        - sequence_ids
        - created_at
      properties:
        created_at:
          type: string
          description: Publication timestamp (RFC3339)
        sequence_ids:
          type: array
          items:
            type: integer
            format: int64
          description: Sequence IDs assigned to events
    EventData:
      type: object
      description: Event data for publishing
      required:
        - data
      properties:
        attempt_number:
          type:
            - integer
            - 'null'
          format: int32
          description: Attempt number for retries
        data:
          description: Event payload
        event_type:
          type:
            - string
            - 'null'
          description: Event type identifier
        execution_id:
          type:
            - string
            - 'null'
          description: Associated execution ID
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
    cookie_auth:
      type: apiKey
      in: cookie
      name: polos_auth

````