Skip to content

Create or replace an email include

POST
/v2/email/templates/includes
curl --request POST \
--url https://api.connect.ms/v2/email/templates/includes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "content": "example" }'

Stores an MJML fragment that templates can pull in with mj-include. An existing include with the same name is replaced.

Connect-Version
string

The API version to use, for example 2026-10-01. Defaults to the version set on your API key.

Idempotency-Key
string

A unique value of up to 255 characters, so a retried request is not acted on twice. Required for keys in Strict API Mode.

The include to create or replace.

Media typeapplication/json

The include to create or replace.

object
name
required

The name templates include it by, up to 64 characters of letters, digits, dots, hyphens and underscores, not starting with a dot. An existing include with the same name is replaced.

string
0 <= 64 characters /^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/
content
required

The MJML content, up to 500000 characters.

string
0 <= 500000 characters

Example generated

{
"name": "example",
"content": "example"
}

The include was stored. The Location header holds its URL.

Media typeapplication/json

A reusable MJML fragment that templates pull in with mj-include.

object
name
required

The name templates refer to it by, as the path of an mj-include.

string
content
required

The MJML content.

string
updatedAt

When (UTC) the include was last stored, or null when not known.

string format: date-time
nullable

Example generated

{
"name": "example",
"content": "example",
"updatedAt": "2026-04-15T12:00:00Z"
}

The request is not valid. The detail field says why, and errors lists any problems by field name.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The API key or bearer token is missing or not valid, or the request signature could not be verified.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The caller is not allowed to do this.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

A request with this Idempotency-Key is still being processed. Retry after the Retry-After header.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

This Idempotency-Key was already used for a different request. Use a new key.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

This API key requires an Idempotency-Key header on every POST and PATCH.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The service is temporarily unavailable. Retry after the Retry-After header.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}