Get Template
Retrieve a single template by ID, including its full content.
Endpoint
GET https://api.campaignlark.com/v1/templates/:id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | required | The template ID. |
Sample Request
GET https://api.campaignlark.com/v1/templates/1
Response
Success — 200 OK
{
"error": null,
"data": {
"id": 1,
"name": "Welcome Email",
"type": "editor",
"json_content": "{...}",
"html_content": "<html>...</html>",
"preview_url": "https://usercontent.campaignlark.com/image/abc123.png",
"processed": true
}
}
Template Object (Detail)
Includes all list fields plus:
| Field | Type | Description |
|---|---|---|
json_content | string or null | Editor JSON content (only for editor templates). |
html_content | string | Rendered HTML content. |
preview_url | string | URL to the template preview image (empty if not yet generated). |
Errors
| Status | Message | Cause |
|---|---|---|
400 | Please provide a valid template ID. | id path param is missing or not a number. |
404 | We were unable to find the template. | Template does not exist in the workspace. |