Get an SMS template's usage

Get an SMS template's usage

GET/api/v1/sms/templates/{id}/usage

GET /sms/templates/{id}/usage
curl -X GET 'https://www.unitpost.com/api/v1/sms/templates/tmpl_123/usage' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "sms_template_usage",
  "template_id": "template_123",
  "live_campaigns": [
    {
      "id": "id_123",
      "name": "Example",
      "status": "queued"
    }
  ],
  "live_automations": [
    {
      "id": "id_123",
      "name": "Example",
      "status": "queued"
    }
  ],
  "pending_sends": 0,
  "system_locked": false,
  "can_edit_content": false,
  "content_blocked_reason": "string",
  "can_unpublish": false,
  "unpublish_blocked_reason": "string"
}

What uses an SMS template, and whether a change would be accepted now: its live campaigns and automations, queued texts, and can_edit_content / can_unpublish with the reason when not. Read it before an edit or delete. Requires the templates:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields10 fields
FieldTypeDescription
objectrequiredstring—
template_idrequiredstring—
live_campaignsrequiredobject[]—
live_automationsrequiredobject[]—
pending_sendsrequiredinteger—
system_lockedrequiredboolean—
can_edit_contentrequiredboolean—
content_blocked_reasonrequiredstring | null—
can_unpublishrequiredboolean—
unpublish_blocked_reasonrequiredstring | null—
200401403404422

Search docs and guides

Search the docs and product guides.