Snippets
Snippets are reusable text blocks scoped to the organization, typically used for message composition.
All endpoints require authentication via the X-API-Key header. See Authentication.
Create a snippet
POST /snippets
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Yes | Non-empty. |
value | string | Yes | Non-empty. |
Example request
Response
Errors
| Status | Message | Cause |
|---|---|---|
| 400 | Validation error | Missing or empty name or value. |
List snippets
GET /snippets
Returns snippets sorted by name ascending.
Query parameters
| Parameter | Type | Default | Notes |
|---|---|---|---|
page | number | 0 | 0-indexed. |
perPage | number | 50 | Items per page. |
Example request
Response
Update a snippet
PUT /snippets/:id
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Snippet ID. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | Non-empty if provided. |
value | string | No | Non-empty if provided. |
Example request
Response
Errors
| Status | Message | Cause |
|---|---|---|
| 404 | Not found | Snippet does not exist. |
Delete a snippet
DELETE /snippets/:id
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Snippet ID. |
Example request
Response
Errors
| Status | Message | Cause |
|---|---|---|
| 404 | Not found | Snippet does not exist. |
Response envelope
All endpoints use the standard envelope:
Error responses:
data is null for a general failure, such as a database error or an upstream timeout. When the request is rejected because of a specific field, data carries the field(s) at fault instead:
Each issue carries a path (the dotted path into the request body) and a message. A label is added when the path is not self-describing, which today means custom fields only, for example "path": "fields.68b0a1f39c2e4d0012ab77e5", "label": "Class Year". issues is an array, but treat it as holding at most one entry: validation stops at the first failure.