Create a snippet
Snippets are reusable pieces of email content you can drop into a broadcast or sequence email using Liquid: {{ snippet.key }}. Update the snippet once and every email that references it picks up the new content on next send.
There are two snippet_types. inline snippets store plain-text content (with Liquid variable support like {{ subscriber.first_name }}) in the content field. block snippets store rich-text HTML — text, lists, images, buttons — in document_attributes.value_html. A snippet's type is fixed at creation: it cannot be changed via Update a snippet.
The response includes a key field. That's the identifier you use in Liquid — for example, a snippet returned with "key": "welcome-message" is referenced inside a broadcast as {{ snippet.welcome-message }}. Keys are derived from the snippet name on creation.
Note: the API rejects circular references — a snippet cannot reference itself, directly or transitively — with a 422 validation error.
For end-user context on how creators build and edit snippets in the Kit UI, see the help articles on content snippets and code snippets for custom templates.
Request
- Base URLhttps://api.kit.com
- URLhttps://api.kit.com/v4/snippets
- Auth
- API key in header X-Kit-Api-Key
- or OAuth 2Authorization code: https://api.kit.com/v4/oauth/authorizeToken URL: https://api.kit.com/v4/oauth/token
Request body
Response
Creates a new snippet
Changes
No recorded changes to this operation across all 2 revisions of this API.