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 (plain text or Liquid). Trimmed of leading and trailing whitespace before storage. Max length is environment-specific (default 16000).
- application/json
- 401
Unauthorized request. Make sure that you provided the right credentials.
- application/json
- 429
Your request is over the 10-per-second limit.
- 500
Internal server error (for example, render service failure when validating Liquid).
curl https://api.customer.io/v1/snippets \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"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.