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

# Send Event

> Send an event to a running task.

## Content Types

### TextPart

```json theme={"dark"}
{
  "type": "text",
  "text": "Your message content"
}
```

### DataPart

```json theme={"dark"}
{
  "type": "data",
  "data": { "key": "value" }
}
```


## OpenAPI

````yaml openapi.json POST /tasks/{task_id}/events
openapi: 3.1.0
info:
  title: Sb0 API
  version: 0.1.0
servers: []
security: []
paths:
  /tasks/{task_id}/events:
    post:
      tags:
        - Tasks
      summary: Send Event to Task
      description: Send an event to a running task.
      operationId: tasks_send_event
      parameters:
        - in: path
          name: task_id
          required: true
          schema:
            title: Task Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskEventRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    CreateTaskEventRequest:
      description: >-
        Request for POST /tasks/{task_id}/events


        Content accepts TextPart or DataPart only. Other message types (tool
        calls,

        reasoning, etc.) are agent-generated and sent via the /raw-events
        endpoint.
      properties:
        content:
          anyOf:
            - $ref: '#/components/schemas/TextPart'
            - $ref: '#/components/schemas/DataPart'
            - type: 'null'
          description: Event content
          title: Content
        idempotency_key:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: Optional idempotency key for retry-safe event delivery.
          title: Idempotency Key
        persist_message:
          default: true
          description: >-
            Whether to also create a message record for this event. Defaults to
            True.
          title: Persist Message
          type: boolean
      title: CreateTaskEventRequest
      type: object
    Event:
      description: |-
        Event returned from the events API.

        Content is TextPart or DataPart (human-readable content only).
      properties:
        agent_id:
          description: The UUID of the agent that the event belongs to
          title: Agent Id
          type: string
        content:
          anyOf:
            - $ref: '#/components/schemas/TextPart'
            - $ref: '#/components/schemas/DataPart'
            - type: 'null'
          description: The content of the event (TextPart or DataPart)
          title: Content
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The timestamp of the event
          title: Created At
        id:
          description: The UUID of the event
          title: Id
          type: string
        sequence_id:
          description: The sequence ID of the event
          title: Sequence Id
          type: integer
        streamCapabilities:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Server-advertised stream lifecycle capabilities for this event
          title: Streamcapabilities
        task_id:
          description: The UUID of the task that the event belongs to
          title: Task Id
          type: string
      required:
        - id
        - sequence_id
        - task_id
        - agent_id
      title: Event
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    TextPart:
      description: Text content part.
      properties:
        text:
          description: The text content
          title: Text
          type: string
        type:
          const: text
          default: text
          description: Part type discriminator
          title: Type
          type: string
      required:
        - text
      title: TextPart
      type: object
    DataPart:
      description: Generic data part for unknown/passthrough content.
      properties:
        data:
          description: Arbitrary data content
          title: Data
        type:
          const: data
          default: data
          description: Part type discriminator
          title: Type
          type: string
      required:
        - data
      title: DataPart
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````