Templates
Reusable bodies with variable substitution, sent by template_id.
Every endpoint needs Authorization: Bearer lk_live_.... See
Conventions for headers, status codes
and error shape.
List templates
GET /v1/templates · scope templates:read
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
sort |
query | string (name, created_at, updated_at) |
Field to order by. This list holds tens of rows per account, so every column is offered and none needs an index. |
order |
query | string (asc, desc) |
Defaults to asc for the default field and asc for any other. Always tie-broken on id, so the order is total. |
Response 200
Templates.
| Field | Type | Notes |
|---|---|---|
data |
array of Template |
Errors: 401, 403
Create a template
POST /v1/templates · scope templates:write
Request body
| Field | Type | Notes |
|---|---|---|
name |
string | Required. Template name (1–120 chars). |
subject |
string | May contain {{variable}} placeholders. |
html |
string | HTML body; {{variable}} values are HTML-escaped. |
text |
string | Plain-text body. |
Response 201
Created.
| Field | Type | Notes |
|---|---|---|
id |
string | |
name |
string | |
subject |
string | |
html |
string | |
text |
string | |
created_at |
string | |
updated_at |
string |
Errors: 400, 401, 403
Get a template
GET /v1/templates/{id} · scope templates:read
Response 200
Template.
| Field | Type | Notes |
|---|---|---|
id |
string | |
name |
string | |
subject |
string | |
html |
string | |
text |
string | |
created_at |
string | |
updated_at |
string |
Errors: 404
Update a template
PUT /v1/templates/{id} · scope templates:write
Request body
| Field | Type | Notes |
|---|---|---|
name |
string | Required. Template name (1–120 chars). |
subject |
string | May contain {{variable}} placeholders. |
html |
string | HTML body; {{variable}} values are HTML-escaped. |
text |
string | Plain-text body. |
Response 200
Updated.
| Field | Type | Notes |
|---|---|---|
id |
string | |
name |
string | |
subject |
string | |
html |
string | |
text |
string | |
created_at |
string | |
updated_at |
string |
Errors: 400, 404
Delete a template
DELETE /v1/templates/{id} · scope templates:write
Response 204
Deleted.
Errors: 404