---
title: "Create a snippet"
method: POST
path: "/v1/snippets"
tags: ["Snippets"]
---

# Create a snippet

`POST /v1/snippets`

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

- SnippetRequest — Request body for creating or updating a snippet. Only `name` and `value` are accepted; `updated_at` is returned in responses only.
  - `name` string, required — The name of the snippet, must be unique. Trimmed of leading and trailing whitespace before storage.
  - `value` 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).

## Response `200`

Returns the created snippet.

- object
  - `snippet` Snippet — describes a piece of reusable content. You must provide a name for the snippet and the `value`—the content that appears in messages that use the snippet.
    - `name` string, required — The name of the snippet, must be unique.
    - `value` string, required — The contents of the snippet.
    - `updated_at` integer — The last date-time the snippet was updated.

## Other responses

- `401` — Unauthorized request. Make sure that you provided the right credentials.
- `422` — Validation error or a snippet with that name already exists.
- `429` — Your request is over the 10-per-second limit.
- `500` — Internal server error (for example, render service failure when validating Liquid).

---

[API](https://skmtc.dev/customer/apis/customer-io-journeys-api-reference.md) · [All operations](https://skmtc.dev/customer/apis/customer-io-journeys-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/customer/customer-io-journeys-api-reference/revisions/4b391af7cb06/schema)
