Skip to content

cURL Examples

Replace YOUR_PRODUCT_SLUG and YOUR_API_KEY with the values provided by your administrator.

Retrieve calculated outputs as JSON:

Terminal window
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
}
}'

Save the illustration as a PDF file:

Terminal window
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.

Receive JSON outputs and a base64-encoded PDF in a single response:

Terminal window
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
}
}'

If you prefer the X-API-Key header:

Terminal window
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" } }'

Verify the API is reachable (no authentication required):

Terminal window
curl https://staging-api.illustrata.io/health

Add -i to see response headers, including rate limit info:

Terminal window
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: 60
X-RateLimit-Remaining: 58
X-RateLimit-Daily-Limit: 10000
X-RateLimit-Daily-Remaining: 9998