A walkthrough for API access
This guide assumes you've already gone through the entire Quick Start Guide. If you haven't, please do so before starting this walkthrough.
Obtain your API key by going to Account on the navigation bar → API Keys → Generate New API Key. If you need more API keys, you can purchase a Team or Enterprise subscription.

Create your struct:
curl -s -X POST "https://api.stract-api.com/struct" \
-H "authorization: bearer API_KEY" \
-H "content-type: application/json" \
-d '{"name": "user_order"}'{
"id": "a3e5ae77-c967-43a4-968f-58e0bf0dc1db",
"account_id": "UUID",
"suser_id": "UUID",
"date_created": "2026-10-21T00:00:00.000Z",
"name": "user_order",
"dt_archived": null
}Then add fields to it:
curl -s -X POST "https://api.stract-api.com/struct/a3e5ae77-c967-43a4-968f-58e0bf0dc1db/field" \
-H "authorization: bearer API_KEY" \
-H "content-type: application/json" \
-d '[{"name": "hamburger_count", "description": "Number of hamburgers the customer ordered", "type": "number"}]'[
{
"id": "de8f5e20-9397-4021-bec4-412354849361",
"struct_id": "a3e5ae77-c967-43a4-968f-58e0bf0dc1db",
"date_created": "2026-10-21T00:00:00.000Z",
"name": "hamburger_count",
"description": "Number of hamburgers the customer ordered",
"type": "number",
"enum_values": null
}
]API users can run analysis jobs using raw text in JSON payloads and synchronously wait for output, without needing to upload a file
curl -s -X POST "https://api.stract-api.com/struct/a3e5ae77-c967-43a4-968f-58e0bf0dc1db/job/sync/text" \
-H "authorization: bearer API_KEY" \
-H "content-type: application/json" \
-d '{"name": "order_1042", "text": "Hey, uhhmmmm. I want to order two hamburgers, four large fries and six chocolate milk shakes. Thanks.", "output_type": "json", "additional_instructions": "This text is from a customer ordering from the outdoor order station of a drive-thru fast food restaurant."}'[
{
"hamburger_count": 2,
"document_name": "order_1042"
}
]Alternatively, you can upload a document and synchronously wait for output.
curl -s -X POST "https://api.stract-api.com/struct/a3e5ae77-c967-43a4-968f-58e0bf0dc1db/job/sync" \
-H "authorization: bearer API_KEY" \
-F "file=@order_1042.txt" \
-F "additional_instructions=This text is from a customer ordering from the outdoor order station of a drive-thru fast food restaurant." \
-F "output_type=json"[
{
"hamburger_count": 2,
"document_name": "order_1042.txt"
}
]You can also upload documents separately, then run an analysis job asynchronously on many documents at once. You can find details for all of our endpoints in our API documentation. If you prefer to run our API documentation through an LLM, you can use the raw yaml instead.
We are planning to create SDKs for large programming languages (Node, Python, Java, etc...). If your team would benefit from an SDK, please contact us and let us know what you need.