# Update a snippet `PATCH / PUT / POST /api/v1/snippets/{id}` Updates a snippet by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Snippets → Write**. ## Path parameters - `id` (integer, required) — ID of the snippet. ## Body parameters - `name` (string) — Name of the snippet, up to 191 characters. - `shortcut` (string) — Unique shortcut, up to 64 characters. Use lowercase letters, digits, periods, underscores, or hyphens. - `body` (string) — Reusable text content. An unchanged payload returns the message key `entities.snippet.messages.no_changes`. ## Request (PATCH) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PATCH \ --url "https://api.asdincloud.com/api/v1/snippets/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"body":"See you at practice!"}' ``` ## Request (PUT) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PUT \ --url "https://api.asdincloud.com/api/v1/snippets/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"body":"See you at practice!"}' ``` ## Request (POST) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/snippets/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"body":"See you at practice!"}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "message_key": "entities.snippet.messages.updated" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The requested record was not found. - `400` — The payload is invalid. - `422` — One or more fields failed validation.