# Generate a template PDF `POST /api/v1/templates/{id}/print` Generates a PDF from a stored template or an HTML preview. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Templates → Write**. ## Path parameters - `id` (integer, required) — ID of the template. ## Body parameters - `athlete_id` (integer) — Use an athlete ID to populate the athlete variables. - `context` (string) — Use athlete_print to require a valid athlete and fail if any template variables remain unresolved. - `html` (string) — Optional HTML preview. If supplied, it replaces the rendered template content. - `style_css` (string or null) — Override the page stylesheet when also supplying preview HTML. - `filename` (string) — Optional name for the generated PDF. - `additional properties` (map values) — Send template variables as top-level properties when rendering the stored template. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/templates/${ID:?Set ID}/print" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"first_name":"Alex","filename":"practice-reminder.pdf"}' ``` ## Response **200 OK** Returns the URL of the generated PDF in `url`. Example with fictional data and selected fields. ```json { "status": "success", "template_id": "27", "url": "https://files.example.com/practice-reminder.pdf" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The template, body, or stylesheet could not be processed. - `404` — The requested record was not found. - `422` — The athlete print context is invalid or variables could not be resolved. - `500` — The PDF could not be generated.