Create a snippet
Create a new snippet. If a snippet with that name already exists, we'll return a 422 error. If the value contains Liquid, we validate it.
Request body for creating or updating a snippet. Only name and value are accepted; updated_at is returned in responses only.
- Type: stringnamemax length:150required
The name of the snippet, must be unique. Trimmed of leading and trailing whitespace before storage.
- Type: stringvaluerequired
The contents of the snippet, in plain text or Liquid. Customer.io trims leading and trailing whitespace before storing it. A snippet can be up to 16,000 characters by default, and all of the snippets in a workspace can total up to 5 MB.
- application/json
- 401
Unauthorized request. Make sure that you provided the right credentials.
- application/json
- application/json
- 500
Internal server error (for example, render service failure when validating Liquid).
{
"name": "address",
"value": "<strong>My Company</strong></br>1234 Fake St<br/>Fake,NY<br/>10111"
}
{
"snippet": {
"name": "address",
"value": "<strong>My Company</strong></br>1234 Fake St<br/>Fake,NY<br/>10111",
"updated_at": 1582500000
}
}Returns the created snippet.