Get a template's usage

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
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields13 fields
FieldTypeDescription
objectrequiredstring—
template_idrequiredstring—
campaignsrequiredobject[]The campaigns that use it, any status, newest first: the newest 25 (`campaign_count` says how many in all).
campaign_countrequiredintegerHow many campaigns use it in all.
sent_countrequiredintegerEmails sent from it, all time.
live_campaignsrequiredobject[]Scheduled, sending or paused campaigns: they render its current content when they send, so its content is locked.
live_automationsrequiredobject[]Active or paused automations whose published version sends it: it can't be unpublished or deleted.
pending_sendsrequiredintegerQueued or scheduled single sends that render it when they go out.
system_lockedrequiredbooleanA template behind Unitpost's own emails: read-only.
can_edit_contentrequiredbooleanWhether an update to its body, subject or category would be accepted now.
content_blocked_reasonrequiredstring | null—
can_unpublishrequiredbooleanWhether `status: "draft"` would be accepted now.
unpublish_blocked_reasonrequiredstring | null—
200401403404422

Search docs and guides

Search the docs and product guides.