# Labels

> Reply labels and the triggers they run. 6 REST endpoints with parameters, permissions and curl examples. Each endpoint is also an MCP tool for your AI.

Canonical: https://ballast.to/docs/api/labels

[API reference](https://ballast.to/docs/api)

Reply labels and the triggers they run. 6 endpoints, each also a tool for your AI through [MCP](https://ballast.to/docs/mcp). Authentication and errors are on the [overview](https://ballast.to/docs/api#authentication).

## Labels with their triggers and lead counts

GET

/api/v1/labels

MCP tool

list\_labels

Read-only

Returns

- **`labels` required object\[\]**

cURL

```
curl https://ballast.to/api/v1/labels \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```

## Create a label

POST

/api/v1/labels

MCP tool

create\_label

Owners and admins

Parameters

- **`name` required string**
- **`description` string | null**
- **`aiPrompt` string | null**: Tells the reply classifier when to apply it. Empty = applied by hand only.
- **`type` required "positive" | "negative" | "neutral" | "warning"**
- **`triggers` required object**

Returns

- **`id` required string**
- **`name` required string**
- **`description` required string | null**
- **`aiPrompt` required string | null**
- **`type` required "positive" | "negative" | "neutral" | "warning"**
- **`triggers` required object**
- **`position` required number**
- **`system` required boolean**: Used by the engine: editable, not deletable
- **`leads` required number**

cURL

```
curl -X POST https://ballast.to/api/v1/labels \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<name>","type":"positive","triggers":{}}'
```

## Change a label, its AI prompt or triggers

PATCH

/api/v1/labels/{id}

MCP tool

update\_label

Owners and admins

Parameters

- **`id` required path · string**
- **`name` required string**
- **`description` string | null**
- **`aiPrompt` string | null**: Tells the reply classifier when to apply it. Empty = applied by hand only.
- **`type` required "positive" | "negative" | "neutral" | "warning"**
- **`triggers` required object**

Returns the same fields as Create a label.

cURL

```
curl -X PATCH https://ballast.to/api/v1/labels/<id> \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<name>","type":"positive","triggers":{}}'
```

## Delete a label

DELETE

/api/v1/labels/{id}

Removes it from every lead. Labels the engine relies on can't be deleted.

MCP tool

delete\_label

Owners and admins

MCP asks to confirm

Parameters

- **`id` required path · string**

Returns

- **`ok` required true**

cURL

```
curl -X DELETE https://ballast.to/api/v1/labels/<id> \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```

## Set the label order

POST

/api/v1/labels/reorder

Owners and admins

Parameters

- **`ids` required string\[\]**

Returns

- **`ok` required true**

cURL

```
curl -X POST https://ballast.to/api/v1/labels/reorder \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids":[]}'
```

## Run the reply classifier on a sample reply

POST

/api/v1/labels/test

Uses every label's AI prompt, with \`draft\` replacing one label's saved prompt, so a prompt can be tried before saving. Nothing is labeled.

MCP tool

test\_label\_prompt

Needs an active plan

Parameters

- **`subject` string | null**
- **`reply` required string**
- **`draft` object | null**

Returns

- **`labelId` required string | null**: Null: no label fits well enough, a human decides. "draft" when the unsaved new label wins
- **`labelName` required string | null**
- **`confidence` required number**
- **`reason` required string**
- **`source` required string**: "rules" for auto-replies caught without a model, else the model id

cURL

```
curl -X POST https://ballast.to/api/v1/labels/test \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reply":"<reply>"}'
```
