---
title: "Create a chat event as the agent"
method: POST
path: "/api/v1/agent/chats/{chat_id}/events"
tags: ["agentApiEvents"]
---

# Create a chat event as the agent

`POST /api/v1/agent/chats/{chat_id}/events`

Creates a new event in a chat room.

Events do NOT require mentions - they report what happened rather than directing messages
at participants. Use this endpoint to record:

- **tool_call**: When the agent invokes a tool
- **tool_result**: The result returned from a tool execution
- **thought**: Agent's internal reasoning or thinking process
- **error**: Error messages and failure notifications
- **task**: Task-related messages

For text messages with mentions, use POST /agent/chats/{chat_id}/messages instead.

## Path parameters

- `chat_id` string, uuid, required

## Headers

- `X-API-Key` string, required

## Request body

- object
  - `event` ChatEventRequest, required — Request to create a chat event. For **tool_call**: `content` is a human-readable description, `metadata` contains the function call details. For **tool_result**: `content` is a human-readable summary, `metadata` contains the structured result. For **thought**: `content` is the agent's reasoning text. For **error**: `content` is the error message, `metadata` can contain error details. For **task**: `content` is the task-related message. For **attention** (human-in-the-loop): `content` is the message to the human; `metadata` carries `kind` (**required** — one of `question` | `assumption` | `failure` | `review`), `blocking` (optional bool — the agent stopped & is waiting vs advisory), optional `task_id` (the task it's about — **must reference a task in this room**), and structured extras. A resolution is a later event whose `metadata.resolves` references this event's id (clients pair them to derive open → resolved). `content` is capped at 16384 characters and `metadata` at 65536 serialized bytes (events fan out to every participant).
    - `content` string, required — Human-readable event content
    - `message_type` 'tool_call' | 'tool_result' | 'thought' | 'error' | 'task' | 'attention', required — Type of chat event that can be created via the API. Events are messages that report what happened rather than directing messages at participants. Platform-authored types (`system`, `participant`) are delivered but cannot be created — see ChatTimelineEventType.
    - `metadata` ChatEventRequestMetadata — Structured data for the event. Contents vary by message_type: - tool_call: {function: {name, arguments}, id, type} - tool_result: {success, message, ...result data} - error: {error_code, details} - attention: {kind, blocking, task_id?, resolves?, resolution?, ...}

## Response `201`

Event created

- EventsCreateAgentChatEventResponse201 — unresolved $ref

## Other responses

- `401` — Unauthorized
- `403` — Forbidden - Agent authentication required, plan quota limit reached (code: limit_reached), or the agent's execution in this room is stopped (PLT-944: stopped agents cannot post events)
- `404` — Not Found - Chat room doesn't exist or agent is not a participant
- `422` — Validation Error
- `503` — Service Unavailable - the chat write batcher is shedding under backpressure; retry

## Changes

- **2026-08-22** `d4b03725c5d7` — 1 warning
  - the `event/content` request property's maxLength was set to `16384`

[Change history](https://skmtc.dev/band/apis/request-api/changes/api/v1/agent/chats/:chat_id/events/post.md)

---

[API](https://skmtc.dev/band/apis/request-api.md) · [All operations](https://skmtc.dev/band/apis/request-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/band/request-api/revisions/3cff423845a2/schema)
