---
title: "Send Event to Task"
method: POST
path: "/tasks/{task_id}/events"
tags: ["Tasks"]
---

# Send Event to Task

`POST /tasks/{task_id}/events`

Send an event to a running task.

## Path parameters

- `task_id` string, required

## Request body

- CreateTaskEventRequest — 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.
  - `content` union — Event content
    - TextPart — Text content part.
      - `text` string, required — The text content
      - `type` 'text' — Part type discriminator
    - DataPart — Generic data part for unknown/passthrough content.
      - `data` unknown, required
      - `type` 'data' — Part type discriminator
  - `idempotency_key` string, nullable — Optional idempotency key for retry-safe event delivery.
  - `persist_message` boolean — Whether to also create a message record for this event. Defaults to True.

## Response `201`

Successful Response

- Event — Event returned from the events API. Content is TextPart or DataPart (human-readable content only).
  - `agent_id` string, required — The UUID of the agent that the event belongs to
  - `content` union — The content of the event (TextPart or DataPart)
    - TextPart — Text content part.
      - `text` string, required — The text content
      - `type` 'text' — Part type discriminator
    - DataPart — Generic data part for unknown/passthrough content.
      - `data` unknown, required
      - `type` 'data' — Part type discriminator
  - `created_at` string, date-time, nullable — The timestamp of the event
  - `id` string, required — The UUID of the event
  - `sequence_id` integer, required — The sequence ID of the event
  - `streamCapabilities` string[], nullable — Server-advertised stream lifecycle capabilities for this event
  - `task_id` string, required — The UUID of the task that the event belongs to

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/terminaluse/apis/sb0-api.md) · [All operations](https://skmtc.net/terminaluse/apis/sb0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/terminaluse/sb0-api/versions/f24a474dc415/schema)
