v1.0.0
OpenAPI 3.1.0

Create a snippet

US region

Client Libraries

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.

Body
application/json

Request body for creating or updating a snippet. Only name and value are accepted; updated_at is returned in responses only.

  • name
    Type: string
    max length:  
    150
    required

    The name of the snippet, must be unique. Trimmed of leading and trailing whitespace before storage.

  • value
    Type: string
    required

    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.

Responses
  • 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).

Request Example for post/v1/snippets
{
  "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
  }
}