# Create a snippet `POST /api/v1/snippets` Creates a snippet. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Snippets → Write**. ## Body parameters - `name` (string, required) — Name of the snippet, up to 191 characters. - `shortcut` (string, required) — Unique shortcut, up to 64 characters. Use lowercase letters, digits, periods, underscores, or hyphens. - `body` (string, required) — Reusable text content. ## Request 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" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"name":"Welcome note","shortcut":"welcome","body":"Welcome to the club!"}' ``` ## Response **201 Created** The created snippet is returned in data. Example with fictional data and selected fields. ```json { "message_key": "entities.snippet.messages.created", "data": { "id": 8, "name": "Welcome note", "shortcut": "welcome", "body": "Welcome to the club!" } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The payload is invalid. - `422` — One or more fields failed validation.