API Reference
Base URL: https://api.semarize.com|All endpoints require Authorization: Bearer <api_key>
Authentication
All API requests require a Bearer token in the Authorization header. API keys follow the format smz_live_* (production) or smz_test_* (sandbox).
Key details
Keys are hashed before storage - you cannot retrieve a key after creation.
Keys are scoped to a workspace. All runs created with a key belong to that workspace.
Keys can optionally have an expiration date. Expired keys return 401.
Runs
A Run executes a Kit against a conversation and produces structured output. Create runs with POST /v1/runs. By default runs are async (202 → poll). Add "mode": "sync" to block until completion.
/v1/runsCreate a run
Create a run. Default mode is async (returns 202 immediately, poll for results). Set mode to sync to block until completion (returns 200 or 202 fallback).
Headers
AuthorizationrequiredBearer <api_key>Content-Typerequiredapplication/jsonIdempotency-KeyoptionalClient-generated unique key (max 254 chars). Prevents duplicate runs.X-Request-IdoptionalOptional request tracking ID.Request body
kit_codestringrequiredThe 8-character Kit code identifying which Kit to run.kit_version_idstringoptionalUUID of a specific Kit version. Overrides kit_code if provided.inputobjectrequiredThe conversation data. Shape depends on the Kit configuration (typically includes a transcript field).typestringoptionalRun type. Defaults to "api". Options: api, sandbox.modestringoptionalExecution mode. Defaults to "async". Options: async, sync. Sync mode blocks until the run completes or times out./v1/runsList runs
List runs for the authenticated workspace. Ordered by most recent first.
Query parameters
limitintegerNumber of runs to return. Range: 1–100. Default: 50./v1/runs/:runIdGet run details
Retrieve the full details of a run including output (when succeeded), error information, and duration.
Brick output fields
Each Brick is keyed by its unique key (e.g. pain_is_specific). Output fields are configurable per Brick - not every Brick will return all fields.
valueThe typed result (boolean, number, string, or category). Always present.confidenceConfidence score from 0 to 1. Present when enabled for the Brick.reasonShort explanation of why this value was returned. Present when enabled for the Brick.evidenceArray of text spans from the conversation. Present when enabled for the Brick./v1/runs/:runId/usageGet run usage
Retrieve token usage and credit consumption for a completed run. Useful for monitoring and optimization.
Sync mode details
Add "mode": "sync" to your POST /v1/runs request body. The API attempts to execute the run inline and return the result directly.
Response behavior
GET /v1/runs/:runId. Inspect status - HTTP 200 means the request cycle completed, not necessarily that the run succeeded.sync_fallback: true and waited_ms. Fall back to polling with the returned run_id. Includes Retry-After header.Kits & Bricks
Introspect Kit output schemas and Brick metadata. Useful for validating integrations and understanding what fields each Brick returns before creating runs.
/v1/kits/:kitId/schemaGet Kit output schema
Returns the output schema for a Kit, including all Bricks and their configured output fields. Use this to understand what fields each Brick will return before creating a run.
/v1/kits/schemaGet Kit output schema by query
Alternative to the path-based schema endpoint. Look up a Kit schema by kit_code, kit_id, or kit_version_id query parameter.
Query parameters
kit_codestringThe 8-character Kit code.kit_idstringThe Kit UUID.kit_version_idstringA specific Kit version UUID.GET /v1/kits/:kitId/schema./v1/bricksGet Brick metadata
Retrieve metadata for one or more Bricks by their IDs. Useful for mapping brick keys to names and types.
Query parameters
idsstringrequiredComma-separated list of Brick IDs (max 100).Webhooks
Receive push notifications when runs reach terminal state instead of polling. Workspace-level, at-least-once delivery with HMAC-SHA256 signatures. v1 supports one endpoint per workspace.
/v1/webhooksCreate or update webhook
Register a webhook endpoint for the authenticated workspace. v1 supports one endpoint per workspace - calling this again replaces the existing endpoint (upsert).
Request body
urlstringrequiredHTTPS URL to receive webhook events. Must be public-routable./v1/webhooksList webhooks
List webhook endpoints for the authenticated workspace.
/v1/webhooks/:idDelete webhook
Remove a webhook endpoint. Events will no longer be delivered to this URL.
Events and delivery
Semarize sends a POST request to your endpoint when a run reaches terminal state.
Terminal events
Signing headers
Every webhook delivery includes these headers for verification and deduplication:
Semarize-Event-IdUnique event ID. Stable across retries.Semarize-Delivery-IdUnique per delivery attempt. Recommended for deduplication.Semarize-Event-TypeEvent type (e.g. run.succeeded).Semarize-TimestampUnix timestamp of the event.Semarize-SignatureHMAC-SHA256 signature: v1=<hex>. Verify using your webhook secret.Payload
The payload data field contains the same shape as GET /v1/runs/:runId. If the payload exceeds the size limit, Semarize sends a thin event with only run_id, status, error_code, and duration_ms - fetch full details via GET /v1/runs/:runId.
Retries
Delivery uses exponential backoff (1m, 2m, 4m, 8m, ...) capped at 1 hour. Up to 10 attempts within a 24-hour window. After that, the delivery is marked dead. Dedupe on Semarize-Delivery-Id (recommended) or Semarize-Event-Id.
Errors
The API uses standard HTTP status codes. Error responses include a structured body.
400401403404409422429500Next steps
Ready to integrate? Start with the quickstart guide or explore real-world examples.