API documentation

Authentication

Bearer token authentication is used with our API and is required for making requests to all endpoints

You can get your token from the dashboard Tokens section by clicking the "Generate new token" button.

Tokens are unique and should be kept secure.

To authenticate your requests, you need to include the Bearer token in the Authorization header, as shown in the example below.

Authorization: Bearer {YOUR_TOKEN_HERE}

Authorization header example. Replace {YOUR_TOKEN_HERE} with your actual token

Unauthenticated requests

Requests made without a valid bearer token will result in a 401 Unauthorized HTTP response code.

# Unauthenticated response code
401 Unauthorized

# Unauthenticated response JSON body
{
    "error": "Unauthenticated"
}

Unauthenticated response example. The response code is 401 and the response body contains the error message Unauthenticated

Example

Below, you will find a successful request example and its response.

Request example:

curl -X POST "https://api.templid.com/v1/templates/{templateId}/render" \
-H "Authorization: Bearer {YOUR_TOKEN_HERE}" \
-H "Content-type: application/json" \
-d '{
        "name": "John Doe",
        "amount": 44.99
    }'

Response example:

{
    "subject": "John Doe, we have received your order",
    "html": "<h1>Hello John Doe</h1><p>Your amount due is: $44.99</p>",
    "text": "Hello John Doe\n\nYour amount due is: $44.99"
}