> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.templated.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Creating a Render via API

# Creating a Render via API

Generate images, PDFs, or videos programmatically using the `/v1/render` endpoint.

## Endpoint

```
POST https://api.templated.io/v1/render
```

## Basic Request

```javascript
fetch('https://api.templated.io/v1/render', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    "template": "YOUR_TEMPLATE_ID",
    "format": "jpg",
    "layers": {
      "title": { "text": "Welcome!", "color": "#FF0000" },
      "image-1": { "image_url": "https://example.com/photo.jpg" }
    }
  })
});
```

## Parameters

| Parameter | Type | Required | Description |
| ---- |
| `template` | string | Yes | Your template ID |
| `format` | string | No | Output format: `jpg`, `png`, `webp`, `pdf`, `mp4`. Default: `jpg` |
| `layers` | object | No | Layer modifications (key = layer name) |
| `transparent` | boolean | No | Transparent background (PNG only) |
| `scale` | number | No | Scale factor 0.1–4.0. Default: 1.0 |
| `webhook_url` | string | No | URL to receive completion notification |

## Response

```json
{
  "id": "render-uuid",
  "url": "https://templated-assets.s3.amazonaws.com/renders/render-uuid.jpg",
  "width": 1920,
  "height": 1080,
  "format": "jpg",
  "templateId": "template-uuid",
  "templateName": "My Template",
  "createdAt": "2026-01-11 10:30:00"
}
```

## Code Examples

### Python
```python
import requests

response = requests.post(
    'https://api.templated.io/v1/render',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'template': 'TEMPLATE_ID',
        'layers': {'title': {'text': 'Hello'}}
    }
)
print(response.json()['url'])
```

### cURL
```bash
curl -X POST https://api.templated.io/v1/render \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"template": "TEMPLATE_ID", "layers": {"title": {"text": "Hello"}}}'
```

For complete documentation: [https://templated.io/docs/renders/create/](https://templated.io/docs/renders/create/)