Get a template's usage
GET/api/v1/email/templates/{id}/usage
GET /email/templates/{id}/usage
curl -X GET 'https://www.unitpost.com/api/v1/email/templates/tmpl_123/usage' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0'Response · 200
{
"object": "template_usage",
"template_id": "template_123",
"campaigns": [
{
"id": "id_123",
"name": "Example",
"status": "draft",
"created_at": "2026-01-01T00:00:00.000Z"
}
],
"campaign_count": 1,
"sent_count": 1,
"live_campaigns": [
{
"id": "id_123",
"name": "Example",
"status": "draft"
}
],
"live_automations": [
{
"id": "id_123",
"name": "Example",
"status": "active"
}
],
"pending_sends": 0,
"system_locked": false,
"can_edit_content": false,
"content_blocked_reason": "string",
"can_unpublish": false,
"unpublish_blocked_reason": "string"
}What uses a template, and whether a change would be accepted now: the campaigns that reference it, its live campaigns and automations, queued sends, and can_edit_content / can_unpublish with the reason when not. Read it before an edit or delete: a content edit is refused while a live campaign renders the template, and a delete while any campaign uses it. Requires the templates:read capability.
Parameters1 field
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
Response · 200 fields13 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
template_idrequired | string | — |
campaignsrequired | object[] | The campaigns that use it, any status, newest first: the newest 25 (`campaign_count` says how many in all). |
campaign_countrequired | integer | How many campaigns use it in all. |
sent_countrequired | integer | Emails sent from it, all time. |
live_campaignsrequired | object[] | Scheduled, sending or paused campaigns: they render its current content when they send, so its content is locked. |
live_automationsrequired | object[] | Active or paused automations whose published version sends it: it can't be unpublished or deleted. |
pending_sendsrequired | integer | Queued or scheduled single sends that render it when they go out. |
system_lockedrequired | boolean | A template behind Unitpost's own emails: read-only. |
can_edit_contentrequired | boolean | Whether an update to its body, subject or category would be accepted now. |
content_blocked_reasonrequired | string | null | — |
can_unpublishrequired | boolean | Whether `status: "draft"` would be accepted now. |
unpublish_blocked_reasonrequired | string | null | — |
200401403404422