Logo
Search
API Docs

Structured Output API: Create, List, Get, Delete

Structured Data & Outputs

Structured Output API: Create, List, Get, Delete

Overview

Structured Outputs (Post-Call Data Extraction) covers the concept — attaching a structured output to an assistant via artifactPlan.structuredOutputIds, and how it compares to the legacy analysisPlan. This page is the CRUD API reference for managing the structured-output resource itself. For complete, worked full-schema examples, see Real Estate Lead Qualification, E-commerce Order Processing, and Healthcare Appointment Booking structured-output templates.


Create a Structured Output

Send a POST request to /structured-output with a name, description, schema, and type:

FieldTypeDescription
typestringai (default) or regex. ai uses an LLM to extract data; regex uses a pattern match against the transcript without an LLM.
namestringDescriptive name for the structured output.
descriptionstringWhat this structured output extracts.
schemaobjectA JSON Schema object describing the data to extract.
modelobjectLLM 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.


List Structured Outputs

GET /structured-output returns a paginated list, with these optional query parameters:

ParameterTypeDescription
idstringFilter to a specific structured output ID.
namestringFilter by name.
pagenumberPage number to return. Defaults to 1.
limitnumberMaximum number of items to return. Defaults to 100.
sortOrderstringSort order. Defaults to DESC. Valid values: ASC, DESC.
createdAtGt / createdAtLt / createdAtGe / createdAtLedate-timeFilter by createdAt greater than / less than / greater-or-equal / less-or-equal a given timestamp.
updatedAtGt / updatedAtLt / updatedAtGe / updatedAtLedate-timeFilter by updatedAt using the same four comparisons.
curl -X GET "https://api.sulus.ai/structured-output?page=1&limit=25&sortOrder=ASC" \
  -H "Authorization: Bearer <YOUR_API_KEY>"

Get a Structured Output

GET /structured-output/{id} returns the structured output definition identified by its ID:

curl -X GET https://api.sulus.ai/structured-output/<id> \
  -H "Authorization: Bearer <YOUR_API_KEY>"

Delete a Structured Output

DELETE /structured-output/{id} deletes the definition and returns the deleted StructuredOutput object:

curl -X DELETE https://api.sulus.ai/structured-output/<id> \
  -H "Authorization: Bearer <YOUR_API_KEY>"

Deleting a structured output does not retroactively remove data already extracted on past calls, but any assistant still referencing its ID in artifactPlan.structuredOutputIds will stop receiving new extractions against that schema — update the assistant's artifactPlan first if you're replacing rather than retiring the schema.