Send a POST request to /structured-output with a name, description, schema, and type:
| Field | Type | Description |
|---|
type | string | ai (default) or regex. ai uses an LLM to extract data; regex uses a pattern match against the transcript without an LLM. |
name | string | Descriptive name for the structured output. |
description | string | What this structured output extracts. |
schema | object | A JSON Schema object describing the data to extract. |
model | object | LLM configuration used for extraction on ai-type outputs (provider, model, optional temperature/maxTokens). |
Worked example — a simple lead-qualification structured output:
curl -X POST https://api.sulus.ai/structured-output \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"type": "ai",
"name": "Lead Qualification",
"description": "Extract basic lead qualification data from a sales call",
"schema": {
"type": "object",
"properties": {
"customerName": { "type": "string" },
"interestLevel": { "type": "string", "enum": ["high", "medium", "low"] },
"qualified": { "type": "boolean" }
},
"required": ["customerName", "qualified"]
}
}'
The response (201) is the created StructuredOutput object, including its id.