---
raw: true
search:
  tags:
    - Teams
    - POST
seo:
  description: >-
    Creates a label for the team. Names are unique within the team, ignoring…
    Reference for the POST /v1/teams/{teamId}/labels endpoint in the Spacefast
    API.
sidebar:
  label: Create a team label
  badge: POST
title: Create a team label
type: openapi-operation
---
Creates a label for the team. Names are unique within the team, ignoring case. Leave the color out and the server picks the next unused hue from the palette.

`POST /v1/teams/{teamId}/labels`

**Request body** (`application/json`, required)

- `name` (string, required) — Label name. Trimmed, and unique within the team ignoring case.
- `color` (string) — Hue for the label. The server picks one when omitted.

Request body example:

```json
{
  "name": "string",
  "color": "red"
}
```

**Responses**

- `201` — Response for status 201
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 201:

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "teamId": "string",
    "name": "string",
    "color": "red",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
```
