v1.0.0
OpenAPI 3.1.0

Update snippets

US region

Client Libraries

Update snippets

In your payload, you'll pass a name and value. Snippet names are unique. If the snippet name does not exist, we'll create a new snippet. If the name exists, we'll update the existing snippet.

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 (plain text or Liquid). Trimmed of leading and trailing whitespace before storage. Max length is environment-specific (default 16000).

Responses
  • application/json
  • 400

    The request is malformed.

  • 429

    Your request is over the 10-per-second limit.

Request Example for put/v1/snippets
curl https://api.customer.io/v1/snippets \
  --request PUT \
  --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
  }
}