latestSwagger 2.02026-08-10148196271.0 KB

afaab604b58c

snippets

Create a snippet

Create a new snippet.

post/api/snippets

Request body

contentstring required

Content of the snippet. Handlebars must be valid. Disallowed content: script tags with JS sources or non-JSON content, inline JS event handlers (e.g., <code>onload="..."</code>), and <code>javascript:</code> in <code>href</code> or <code>src</code> attributes (anchors and iframes).

createdByUserIdstring

User ID (email) of the creator. If not provided, defaults to the project creator.

descriptionstring

Description of the snippet.

namestring required

Name of the snippet. Must be unique within the project, up to 100 characters (a-z, A-Z, 0-9, hyphens (-), underscores (_), and spaces). Cannot be changed after snippet is created.

variablesstring[]

A list of variable names used in the content with a Handlebars expression such as <code>{{#if (eq myVariable "someValue")}}</code>. Variable names are case-sensitive and should be simple identifiers (letters, numbers, underscores). To learn more about using variables in Snippets, see <a href="https://support.iterable.com/hc/articles/4414796078868\">Customizing Snippets with Variables</a>.

Response

successful operation