v1.0.0
OpenAPI 3.1.0
Create a snippet
Client Libraries
US region
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.
The name of the snippet, must be unique. Trimmed of leading and trailing whitespace before storage.
The contents of the snippet (plain text or Liquid). Trimmed of leading and trailing whitespace before storage. Max length is environment-specific (default 16000).
Unauthorized request. Make sure that you provided the right credentials.
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.