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

# Create snippet

`POST /v1/snippets`

## Request

- Base URL: `https://api.botdog.co`
- URL: `https://api.botdog.co/v1/snippets`
- Auth: API key in header `x-api-key`

Create a personal (or team-shared) snippet/template.

## Request body

- CreateSnippetDto
  - `name` string, required: The snippet name
  - `type` 'TEXT' | 'LLM': A static TEXT template or an LLM prompt
  - `content` string: Template body (required for TEXT)
  - `prompt` string: Generation prompt (required for LLM)
  - `shortcut` string: A quick-access shortcut (must be unique)

## Response `201`

- SnippetDto
  - `id` string, required: The unique identifier of the snippet
  - `name` string, required: The name of the snippet
  - `shortcut` string, nullable: The keyboard shortcut for the snippet, if any
  - `type` string, required: The snippet type: a static TEXT template or an LLM prompt
  - `status` string, required: The snippet status
  - `content` string, nullable: The template body (for TEXT snippets)
  - `prompt` string, nullable: The generation prompt (for LLM snippets)
  - `isShared` boolean, required: Whether the snippet is shared with the team
  - `createdAt` string, date-time, required: When the snippet was created
  - `updatedAt` string, date-time, required: When the snippet was last updated

## Other responses

- `401`: Unauthorized. API key is missing or invalid.
- `403`: The key owner has no seat assigned (write endpoints only), the team is on Botdog Managed and so may only read (write endpoints only), or the subscription/plan does not permit this.
- `409`: Shortcut already in use
- `429`: Rate limit exceeded. Retry after cooldown.

---

[API](https://skmtc.dev/botdog/apis/botdog-api.md) · [All operations](https://skmtc.dev/botdog/apis/botdog-api/llms.txt) · [OpenAPI document](https://skmtc.dev/botdog/apis/botdog-api/revisions/6c0213d8a608?raw)
