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

# Update a snippet

`PUT /v1/snippets/{id}`

Updates a snippet.

## Path parameters

- `id` integer, required

## Headers

- `x-checkly-account` string — Your Checkly account ID, you can find it at https://app.checklyhq.com/settings/account/general

## Request body

- SnippetCreate
  - `name` string, required — The snippet name.
  - `script` string, required — Your Node.js code that interacts with the API check lifecycle, or functions as a partial for browser checks.

## Response `200`

Successful

- Snippet
  - `id` number
  - `name` string — The snippet name.
  - `script` string — Your Node.js code that interacts with the API check lifecycle, or functions as a partial for browser checks.
  - `created_at` string, date-time
  - `updated_at` string, date-time, nullable

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `429` — Too Many Requests

---

[API](https://skmtc.net/checklyhq/apis/checkly-public-api.md) · [All operations](https://skmtc.net/checklyhq/apis/checkly-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/checklyhq/checkly-public-api/versions/9e903da4f3da/schema)
