Sign in to fill these examples with your own keys. Sign in Start free trial

Templates

Hosted Liquid templates.

Hosted Liquid templates. Create a draft, edit HTML, text, subject, and global CSS, then publish. Send with template.id (alias or public id) and a variables object. Drafts cannot send. Editing a published template keeps the published snapshot live until you publish again. CSS is injected and inlined at send time. id on member routes is the public id or the alias.

GET /api/v1/teams/:obfuscated_team_id/templates

List templates.

request.sh
1curl -sS -X GET \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 https://app.postshiba.com/api/v1/teams/KjkAJW/templates
response.json
1[ 2 { 3 "id": "TpLmQr", 4 "name": "Welcome", 5 "alias": "welcome", 6 "from": "hello@mail.example.com", 7 "reply_to": null, 8 "subject": "Hi {{ name }}", 9 "html": "<p>Hi {{ name }}</p>", 10 "text": "Hi {{ name }}", 11 "css": "p { color: #18181b; }", 12 "sample_data": { 13 "name": "Ada" 14 }, 15 "published": true, 16 "published_at": "2026-09-11T12:00:00.000Z", 17 "has_unpublished_changes": false, 18 "created_at": "2026-09-11T12:00:00.000Z", 19 "updated_at": "2026-09-11T12:00:00.000Z" 20 } 21]

GET /api/v1/templates/:id

Get one template by public id or alias. Returns the current draft fields.

  • id: Public template id or alias
request.sh
1curl -sS -X GET \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 https://app.postshiba.com/api/v1/templates/:email_template_id
response.json
1{ 2 "id": "TpLmQr", 3 "name": "Welcome", 4 "alias": "welcome", 5 "from": "hello@mail.example.com", 6 "reply_to": null, 7 "subject": "Hi {{ name }}", 8 "html": "<p>Hi {{ name }}</p>", 9 "text": "Hi {{ name }}", 10 "css": "p { color: #18181b; }", 11 "sample_data": { 12 "name": "Ada" 13 }, 14 "published": true, 15 "published_at": "2026-09-11T12:00:00.000Z", 16 "has_unpublished_changes": false, 17 "created_at": "2026-09-11T12:00:00.000Z", 18 "updated_at": "2026-09-11T12:00:00.000Z" 19}

POST /api/v1/teams/:obfuscated_team_id/templates

Create a draft template. Alias is generated from name when omitted. name is required. alias is lowercase letters, numbers, and hyphens, unique per team.

  • name: Required. Display name.
  • alias: Optional. Lowercase letters, numbers, hyphens. Unique per team. Generated from name when omitted.
  • from: Optional. Default From. Overridable at send.
  • reply_to: Optional. Default Reply-To.
  • subject: Optional. Liquid.
  • html: Optional. Liquid HTML.
  • text: Optional. Liquid plain text.
  • css: Optional. Global CSS for this template.
  • sample_data: Optional. JSON object used by the dashboard preview.
request.sh
1curl -sS -X POST \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 -H 'Content-Type: application/json' \ 4 -d '{"email_template":{"name":"Welcome","alias":"welcome","from":"hello@mail.example.com","subject":"Hi {{ name }}","html":"\u003cp\u003eHi {{ name }}\u003c/p\u003e","text":"Hi {{ name }}","css":"p { color: #18181b; }","sample_data":{"name":"Ada"}}}' \ 5 https://app.postshiba.com/api/v1/teams/KjkAJW/templates
response.json
1{ 2 "id": "TpLmQr", 3 "name": "Welcome", 4 "alias": "welcome", 5 "from": "hello@mail.example.com", 6 "reply_to": null, 7 "subject": "Hi {{ name }}", 8 "html": "<p>Hi {{ name }}</p>", 9 "text": "Hi {{ name }}", 10 "css": "p { color: #18181b; }", 11 "sample_data": { 12 "name": "Ada" 13 }, 14 "published": true, 15 "published_at": "2026-09-11T12:00:00.000Z", 16 "has_unpublished_changes": false, 17 "created_at": "2026-09-11T12:00:00.000Z", 18 "updated_at": "2026-09-11T12:00:00.000Z" 19}

PATCH /api/v1/templates/:id

Update draft fields. The published snapshot is unchanged until you publish.

  • id: Public template id or alias
request.sh
1curl -sS -X PATCH \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 -H 'Content-Type: application/json' \ 4 -d '{"email_template":{"subject":"Welcome, {{ name }}"}}' \ 5 https://app.postshiba.com/api/v1/templates/:email_template_id
response.json
1{ 2 "id": "TpLmQr", 3 "name": "Welcome", 4 "alias": "welcome", 5 "from": "hello@mail.example.com", 6 "reply_to": null, 7 "subject": "Welcome, {{ name }}", 8 "html": "<p>Hi {{ name }}</p>", 9 "text": "Hi {{ name }}", 10 "css": "p { color: #18181b; }", 11 "sample_data": { 12 "name": "Ada" 13 }, 14 "published": true, 15 "published_at": "2026-09-11T12:00:00.000Z", 16 "has_unpublished_changes": true, 17 "created_at": "2026-09-11T12:00:00.000Z", 18 "updated_at": "2026-09-11T12:00:00.000Z" 19}

POST /api/v1/templates/:id/publish

Publish the current draft. Sends use this snapshot until the next publish.

  • id: Public template id or alias
request.sh
1curl -sS -X POST \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 -H 'Content-Type: application/json' \ 4 https://app.postshiba.com/api/v1/templates/:email_template_id/publish
response.json
1{ 2 "id": "TpLmQr", 3 "name": "Welcome", 4 "alias": "welcome", 5 "from": "hello@mail.example.com", 6 "reply_to": null, 7 "subject": "Hi {{ name }}", 8 "html": "<p>Hi {{ name }}</p>", 9 "text": "Hi {{ name }}", 10 "css": "p { color: #18181b; }", 11 "sample_data": { 12 "name": "Ada" 13 }, 14 "published": true, 15 "published_at": "2026-09-11T12:00:00.000Z", 16 "has_unpublished_changes": false, 17 "created_at": "2026-09-11T12:00:00.000Z", 18 "updated_at": "2026-09-11T12:00:00.000Z" 19}

POST /api/v1/templates/:id/duplicate

Copy the draft into a new unpublished template.

  • id: Public template id or alias
request.sh
1curl -sS -X POST \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 -H 'Content-Type: application/json' \ 4 https://app.postshiba.com/api/v1/templates/:email_template_id/duplicate
response.json
1{ 2 "id": "TpLmQr", 3 "name": "Welcome copy", 4 "alias": "welcome-copy", 5 "from": "hello@mail.example.com", 6 "reply_to": null, 7 "subject": "Hi {{ name }}", 8 "html": "<p>Hi {{ name }}</p>", 9 "text": "Hi {{ name }}", 10 "css": "p { color: #18181b; }", 11 "sample_data": { 12 "name": "Ada" 13 }, 14 "published": false, 15 "published_at": null, 16 "has_unpublished_changes": false, 17 "created_at": "2026-09-11T12:00:00.000Z", 18 "updated_at": "2026-09-11T12:00:00.000Z" 19}

DELETE /api/v1/templates/:id

Delete a template.

  • id: Public template id or alias
request.sh
1curl -sS -X DELETE \ 2 -H 'Authorization: Bearer YOUR_API_KEY' \ 3 https://app.postshiba.com/api/v1/templates/:email_template_id