# Remove a label from a trainee

`DELETE https://api.coach-platform.com/api/public/trainees/{traineeId}/labels/{labelId}`

Detach a single label from one trainee. The label itself is not deleted and other trainees keep it. Returns journeyOutcome, which reports whether removing this label left the trainee's active journey enrolment without a matching label.

- Resource: Labels
- Authentication: API key in the `Authorization: Bearer cp_live_...` header
- HTML version: https://www.coach-platform.com/docs/api/reference/delete-trainees-trainee-id-labels-label-id
- OpenAPI spec: https://www.coach-platform.com/openapi.json

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `traineeId` | string | Yes |   |
| `labelId` | string | Yes |   |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Idempotency-Key` | string | No | Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate. |

## Responses

| Status | Description |
|---|---|
| `200` OK | Successful response |
| `400` Bad Request |  |
| `401` Unauthorized |  |
| `403` Forbidden |  |
| `404` Not Found |  |
| `409` Conflict |  |
| `429` Too Many Requests |  |
| `500` Internal Server Error |  |

### 200 OK

Content type: `application/json`

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.message` | string |   |
| `data.journeyOutcome` | object \| null |   |
| `data.journeyOutcome.status` | string |   |
| `data.journeyOutcome.enrollmentId` | string \| null |   |
| `data.journeyOutcome.journeyId` | string \| null |   |
| `data.journeyOutcome.journeyTitle` | string \| null |   |
| `data.journeyOutcome.canAct` | boolean \| null |   |

Example:

```json
{
  "data": {
    "message": "<string>",
    "journeyOutcome": {
      "status": "<string>",
      "enrollmentId": "<string>",
      "journeyId": "<string>",
      "journeyTitle": "<string>",
      "canAct": true
    }
  }
}
```

### Error responses 400, 401, 403, 404, 409, 429, 500

Content type: `application/json`

| Field | Type | Description |
|---|---|---|
| `error` | object |   |
| `error.code` | string |   |
| `error.message` | string |   |
| `error.fix` | string \| null |   |
| `error.details` | object \| null |   |
| `error.retryAfterMs` | number \| null |   |

Example:

```json
{
  "error": {
    "code": "<string>",
    "message": "<string>",
    "fix": "<string>",
    "details": {},
    "retryAfterMs": 123
  }
}
```

## Examples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.coach-platform.com/api/public/trainees/<traineeId>/labels/<labelId>' \
  --header 'Authorization: Bearer cp_live_...'
```

### JavaScript (fetch)

```js
const response = await fetch('https://api.coach-platform.com/api/public/trainees/<traineeId>/labels/<labelId>', {
  method: 'DELETE',
  headers: {
    Authorization: 'Bearer cp_live_...',
  },
});

const data = await response.json();
```

## Related endpoints

- [List labels](https://www.coach-platform.com/docs/api/reference/get-labels/index.md): `GET /api/public/labels`. List all trainee labels (tags) defined by the coach.
- [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee.
- [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color.
- [Delete a label](https://www.coach-platform.com/docs/api/reference/delete-labels-label-id/index.md): `DELETE /api/public/labels/{labelId}`. Delete a label.
- Previous: [Add labels to a trainee](https://www.coach-platform.com/docs/api/reference/post-trainees-trainee-id-labels/index.md): `POST /api/public/trainees/{traineeId}/labels`. Add labels to a trainee.
- Next: [Update a label](https://www.coach-platform.com/docs/api/reference/patch-labels-label-id/index.md): `PATCH /api/public/labels/{labelId}`. Rename a label or change its color.
