---
title: "Capture event"
method: POST
path: "/api/v1/capture-event"
tags: ["SDK"]
---

# Capture event

`POST /api/v1/capture-event`

Record one turn-pair or tool call. Generate `event_id` client-side so children can reference parents.

## Headers

- `x-org-id` string, required

## Request body

- object
  - `event_id` string, uuid, required — Client-generated UUID. Use as `parent_id` on child events.
  - `session_id` string, uuid, required — Session UUID from `capture-session`.
  - `primitive_name` string, required — Agent name (turn-pair) or tool name (tool call).
  - `args` string, required — Input — user message or JSON-encoded tool args.
  - `result` string, required — Output — assistant reply or JSON-encoded tool result.
  - `success` boolean — Defaults to `true`.
  - `latency` integer — Execution time in **ms**.
  - `timestamp` integer — Unix time in **ms** when the event occurred. Defaults to server time.
  - `parent_id` string, uuid — Parent event UUID. Set on tool calls to point at the agent turn (or parent tool) that triggered them.
  - `metadata` object — Free-form event metadata.

## Response `200`

Event recorded

- object
  - `event_id` string, uuid

## Other responses

- `400` — Invalid request body

---

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