---
title: "Update a snippet"
method: PUT
path: "/v4/snippets/{id}"
tags: ["Snippets"]
---

# Update a snippet

`PUT /v4/snippets/{id}`

Rename a snippet, replace its body, or archive/restore it. Updates apply on the next send of any email that references the snippet via `{{ snippet.key }}` — there's no per-email versioning, so a content change ripples to every broadcast or sequence email using that key.

The request body must match the existing `snippet_type`. For an **`inline`** snippet, send `content` (and optionally `name`, `archived`). For a **`block`** snippet, send `document_attributes.value_html` (and optionally `name`, `archived`). Pass `archived: true` to archive, `false` to restore.

**Warning:** `snippet_type` is immutable. Sending a different value, or sending the body shape for the wrong type, returns a `422` with `snippet_type cannot be changed`.

See [Create a snippet](/api-reference/snippets/create-a-snippet) for the full snippet model and how `key` ties into Liquid.

## Path parameters

- `id` integer, required

## Request body

- union
  - object
    - `name` string — New name for the snippet
    - `snippet_type` string — Cannot be changed — must match the existing type if provided
    - `archived` boolean — Pass `true` to archive or `false` to restore the snippet
    - `content` string — New Liquid-enabled text content
  - object
    - `name` string — New name for the snippet
    - `snippet_type` string — Cannot be changed — must match the existing type if provided
    - `archived` boolean — Pass `true` to archive or `false` to restore the snippet
    - `document_attributes` object — Updated rich-text document
      - `value_html` string, required — New HTML content for the block snippet

## Response `200`

Updates the snippet and returns its details

- object
  - `snippet` object, required
    - `id` integer, required
    - `name` string, required
    - `snippet_type` string, required
    - `archived` boolean, required
    - `key` string, required
    - `created_at` string, required
    - `updated_at` string, required
    - `content` string, required
    - `document` object, required
      - `id` integer, required
      - `value` unknown, required
      - `value_html` string, required
      - `value_plain` unknown, required
      - `version` integer, required

## Other responses

- `401` — Returns a 401 if the token and/or account cannot be authenticated
- `404` — Returns a 404 when the provided id does not exist
- `422` — Returns a 422 with an error message when one or more of the parameters were invalid

---

[API](https://skmtc.net/kit/apis/kit-api.md) · [All operations](https://skmtc.net/kit/apis/kit-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kit/kit-api/revisions/0df0c90d12da/schema)
