cURL Examples
cURL Examples
Section titled “cURL Examples”Replace YOUR_PRODUCT_SLUG and YOUR_API_KEY with the values provided by your administrator.
JSON Request
Section titled “JSON Request”Retrieve calculated outputs as JSON:
curl -X POST "https://staging-api.illustrata.io/api/YOUR_PRODUCT_SLUG" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "field1": "value1", "field2": 100000 } }'PDF Download
Section titled “PDF Download”Save the illustration as a PDF file:
curl -X POST "https://staging-api.illustrata.io/api/YOUR_PRODUCT_SLUG?format=pdf" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -o illustration.pdf \ -d '{ "inputs": { "field1": "value1", "field2": 100000 } }'The -o illustration.pdf flag saves the response body directly to a file.
JSON + PDF Together
Section titled “JSON + PDF Together”Receive JSON outputs and a base64-encoded PDF in a single response:
curl -X POST "https://staging-api.illustrata.io/api/YOUR_PRODUCT_SLUG?format=both" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "field1": "value1", "field2": 100000 } }'Using X-API-Key Instead of Bearer
Section titled “Using X-API-Key Instead of Bearer”If you prefer the X-API-Key header:
curl -X POST "https://staging-api.illustrata.io/api/YOUR_PRODUCT_SLUG" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "field1": "value1" } }'Health Check
Section titled “Health Check”Verify the API is reachable (no authentication required):
curl https://staging-api.illustrata.io/healthInspecting Response Headers
Section titled “Inspecting Response Headers”Add -i to see response headers, including rate limit info:
curl -i -X POST "https://staging-api.illustrata.io/api/YOUR_PRODUCT_SLUG" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "field1": "value1" } }'Look for:
X-RateLimit-Limit: 60X-RateLimit-Remaining: 58X-RateLimit-Daily-Limit: 10000X-RateLimit-Daily-Remaining: 9998