Make Your First API Request
Now that you have an account, an API key, and a template, let's generate something.
API endpoint
The base URL for the API is:
https://rest.apitemplate.io/v2/
APITemplate.io also offers regional endpoints for better performance and data residency:
| Region | Endpoint |
|---|---|
| US (default) | https://rest.apitemplate.io/v2/ |
| EU | https://rest-eu.apitemplate.io/v2/ |
| Australia | https://rest-au.apitemplate.io/v2/ |
| Singapore | https://rest-sg.apitemplate.io/v2/ |
Create a PDF
Send a POST request to /create-pdf with your template ID and JSON data:
curl -X POST "https://rest.apitemplate.io/v2/create-pdf?template_id=YOUR_TEMPLATE_ID" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"company_name": "Acme Corp",
"invoice_number": "INV-001",
"amount": "$1,250.00"
}'
The response will include a download_url where you can access the generated PDF:
{
"download_url": "https://rest.apitemplate.io/v2/...",
"status": "success"
}
Create an image
Send a POST request to /create-image with your image template ID:
curl -X POST "https://rest.apitemplate.io/v2/create-image?template_id=YOUR_TEMPLATE_ID" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"overrides": [
{
"name": "title",
"text": "Hello World"
}
]
}'
What's next?
For step-by-step walkthroughs, see:
For the full API documentation, visit the REST API Reference.