Skip to documentation

API · Templates

Retrieve Template

Retrieve the current template draft and its variables (requires full access). Each template has one draft and one published version; earlier versions are unavailable.

GET/templates/{id}Full access

Request parameters

ParameterTypeDescription
id
path · required
stringTemplate id or alias.

Request example

Set OPENSEND_BASE_URL=https://api.example.com and OPENSEND_API_KEY=os_replace_me on your server.

bash
curl -X GET "$OPENSEND_BASE_URL/templates/YOUR_id" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Response

200 · application/json. Example IDs stand for IDs returned by your installation.

json
{
  "object": "template",
  "id": "YOUR_ID",
  "name": "example",
  "alias": "example",
  "status": "draft",
  "created_at": "example",
  "updated_at": "example",
  "published_at": "example",
  "current_version_id": "YOUR_CURRENT_VERSION_ID",
  "from": "example",
  "subject": "example",
  "reply_to": [
    "example"
  ],
  "html": "example",
  "text": "example",
  "variables": [
    {
      "key": "example",
      "type": "string",
      "fallback_value": "example",
      "id": "YOUR_ID",
      "created_at": "example",
      "updated_at": "example"
    }
  ],
  "has_unpublished_versions": false
}

Behavior and errors

current_version_id identifies the current draft revision and changes on draft edits, remaining stable on publish. Variables have stable IDs and independent created_at/updated_at values. Older templates without this metadata fall back to template timestamps.

Use a full-access credential. Resource IDs belong to your team; an unknown or foreign resource returns 404. See authentication, errors, rate limits, and compatibility for the shared contract.