Sending Templates API
The Templates API from Sending — 2 operation(s) for templates.
The Templates API from Sending — 2 operation(s) for templates.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/sending-dev:sending-dev-templates-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Sending.dev Templates API
version: 1.0.0
description: 'Public REST API of Sending.dev (MCP-native orchestrator for email + WhatsApp + Telegram).
## Authentication
Every request requires `Authorization: Bearer sk_...` (workspace API key). The `tenantId` is always derived from the key.
## Idempotency
Sends require an `idempotencyKey` (min 8 characters) to prevent duplicates on retries.'
contact:
name: Sending.dev
url: https://sending.dev
servers:
- url: https://sending.dev/api/v1
description: Production
- url: http://localhost:3000/api/v1
description: Local development
security:
- bearerAuth: []
tags:
- name: Templates
paths:
/templates:
get:
tags:
- Templates
summary: List templates
description: 'Reusable content templates for campaigns, transactional sends and `message` nodes of automations: this is where you get a valid `templateId`. The body is not included, read it from the detail. Filterable by channel with `?channel=`. Required scope: `templates:read` or `templates:write`.'
security:
- bearerAuth: []
x-required-scope:
- templates:read
- templates:write
responses:
'200':
description: Template list.
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateList'
'401':
description: Missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
operationId: getTemplates
x-operation-id-source: derived
post:
tags:
- Templates
summary: Create a template
description: 'Email: `subject` is mandatory and `format` is one of markdown, html (default) and blocks; with `blocks` the `body` is the JSON of an EmailDoc, the same document as the visual editor. WhatsApp and Telegram: `format` is always text and there is no subject. `{{...}}` variables are derived from the content and are not declared. The name is unique in the workspace: on a duplicate the response is 409 `template_exists` with the existing `templateId`, to reuse or to fix with PATCH. Required scope: `templates:write`.'
security:
- bearerAuth: []
x-required-scope:
- templates:write
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTemplateInput'
responses:
'201':
description: Template created.
content:
application/json:
schema:
type: object
properties:
template:
$ref: '#/components/schemas/Template'
warnings:
type: array
items:
type: string
description: 'Non-blocking warnings: present only when there is something to report, e.g. {{...}} variables that match no contact field.'
required:
- template
'401':
description: Missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'409':
description: State conflict (e.g. duplicate).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Invalid input.
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
operationId: postTemplates
x-operation-id-source: derived
/templates/{id}:
get:
tags:
- Templates
summary: Get a template
description: 'Content included: use it to re-read a template before fixing it and to know which variables it expects before using it in a send. Required scope: `templates:read` or `templates:write`.'
security:
- bearerAuth: []
x-required-scope:
- templates:read
- templates:write
parameters:
- schema:
type: string
description: Template ID.
required: true
name: id
in: path
responses:
'200':
description: Template detail.
content:
application/json:
schema:
type: object
properties:
template:
$ref: '#/components/schemas/Template'
required:
- template
'401':
description: Missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: Resource not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: getTemplatesById
x-operation-id-source: derived
patch:
tags:
- Templates
summary: Update a template
description: 'Updates only the fields present in the body. The rules still cross-check: changing only the `body` of a `blocks` template still requires a valid EmailDoc. Campaigns already sent do not change, they carry the content frozen at send time. Required scope: `templates:write`.'
security:
- bearerAuth: []
x-required-scope:
- templates:write
parameters:
- schema:
type: string
description: Template ID.
required: true
name: id
in: path
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateTemplateInput'
responses:
'200':
description: Template updated.
content:
application/json:
schema:
type: object
properties:
template:
$ref: '#/components/schemas/Template'
warnings:
type: array
items:
type: string
description: 'Non-blocking warnings: present only when there is something to report, e.g. {{...}} variables that match no contact field.'
required:
- template
'401':
description: Missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: Resource not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: State conflict (e.g. duplicate).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Invalid input.
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
operationId: patchTemplatesById
x-operation-id-source: derived
delete:
tags:
- Templates
summary: Delete a template
description: 'Rejected with 409 `template_in_use` if a campaign still references it (the response lists the campaigns using it). Required scope: `templates:write`.'
security:
- bearerAuth: []
x-required-scope:
- templates:write
parameters:
- schema:
type: string
description: Template ID.
required: true
name: id
in: path
responses:
'200':
description: Template deleted.
content:
application/json:
schema:
$ref: '#/components/schemas/Ok'
'401':
description: Missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
'404':
description: Resource not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: State conflict (e.g. duplicate).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: deleteTemplatesById
x-operation-id-source: derived
components:
schemas:
Ok:
type: object
properties:
ok:
type: boolean
enum:
- true
required:
- ok
CreateTemplateInput:
type: object
properties:
name:
type: string
minLength: 2
maxLength: 200
description: Unique within the workspace.
body:
type: string
minLength: 1
description: Base content. With format 'blocks' it is the JSON of an EmailDoc (the visual editor document).
channels:
type: array
items:
type: string
enum:
- email
- whatsapp
- telegram
minItems: 1
description: 'Channels the template can be used on. Default: [''email''].'
format:
type: string
enum:
- markdown
- html
- text
- blocks
description: 'Email: markdown, html or blocks (default html). WhatsApp/Telegram: always text.'
subject:
type: string
minLength: 1
description: Required if the template includes the email channel.
channelText:
type: object
properties:
whatsapp:
type: string
telegram:
type: string
description: 'Alternative text for WhatsApp/Telegram: without an override the base body is degraded to plain text.'
required:
- name
- body
ValidationError:
type: object
properties:
error:
type: object
properties:
formErrors:
type: array
items:
type: string
fieldErrors:
type: object
additionalProperties:
type: array
items:
type: string
required:
- formErrors
- fieldErrors
required:
- error
description: 'Zod validation failed: shape of `ZodError.flatten()`.'
TemplateSummary:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
channel:
type: string
enum:
- email
- whatsapp
- telegram
description: Derived primary channel (email wins when enabled).
channels:
type: array
items:
type: string
enum:
- email
- whatsapp
- telegram
format:
type: string
enum:
- markdown
- html
- text
- blocks
subject:
type:
- string
- 'null'
variables:
type: array
items:
type: string
description: '{{...}} variables found in the content. Derived, not declared.'
createdAt:
type: string
format: date-time
example: '2026-06-30T12:00:00.000Z'
updatedAt:
type: string
format: date-time
example: '2026-06-30T12:00:00.000Z'
required:
- id
- name
- channel
- channels
- format
- subject
- variables
TemplateList:
type: object
properties:
templates:
type: array
items:
$ref: '#/components/schemas/TemplateSummary'
required:
- templates
Error:
type: object
properties:
error:
type: string
example: not_found
message:
type: string
required:
- error
description: 'Generic error: snake_case code in `error`.'
Template:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
channel:
type: string
enum:
- email
- whatsapp
- telegram
description: Derived primary channel (email wins when enabled).
channels:
type: array
items:
type: string
enum:
- email
- whatsapp
- telegram
format:
type: string
enum:
- markdown
- html
- text
- blocks
subject:
type:
- string
- 'null'
variables:
type: array
items:
type: string
description: '{{...}} variables found in the content. Derived, not declared.'
createdAt:
type: string
format: date-time
example: '2026-06-30T12:00:00.000Z'
updatedAt:
type: string
format: date-time
example: '2026-06-30T12:00:00.000Z'
body:
type: string
channelText:
type:
- object
- 'null'
properties:
whatsapp:
type: string
telegram:
type: string
description: Text overrides for chat channels.
required:
- id
- name
- channel
- channels
- format
- subject
- variables
- body
- channelText
UpdateTemplateInput:
type: object
properties:
name:
type: string
minLength: 2
maxLength: 200
description: Unique within the workspace.
body:
type: string
minLength: 1
description: Base content. With format 'blocks' it is the JSON of an EmailDoc (the visual editor document).
channels:
type: array
items:
type: string
enum:
- email
- whatsapp
- telegram
minItems: 1
description: 'Channels the template can be used on. Default: [''email''].'
format:
type: string
enum:
- markdown
- html
- text
- blocks
description: 'Email: markdown, html or blocks (default html). WhatsApp/Telegram: always text.'
subject:
type: string
minLength: 1
description: Required if the template includes the email channel.
channelText:
type: object
properties:
whatsapp:
type: string
telegram:
type: string
description: 'Alternative text for WhatsApp/Telegram: without an override the base body is degraded to plain text.'
ForbiddenError:
type: object
properties:
error:
type: string
enum:
- forbidden
need:
type: string
example: contacts:write
required:
- error
description: Insufficient scope; `need` names the missing scope.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Workspace API key in the `sk_...` format, passed as `Authorization: Bearer sk_...`. The `tenantId` is always derived from the key, never from a request parameter.'