---
title: Create a service tag
description: "Creates a tag in the header's workspace."
api_method: POST
api_path: "/v1/service-tags"
canonical_url: https://wiblo.app/docs/developers/api/service-tags/create-service-tag
last_updated: 2026-07-28T18:08:25+02:00
md_url: https://wiblo.app/docs/developers/api/service-tags/create-service-tag.md
---

# Create a service tag

`POST /v1/service-tags`

Creates a tag in the header's workspace. Owner/admin only. Names are unique per workspace case-insensitively — a duplicate is 409 `TAG_NAME_TAKEN`. Per-user rate-limited at 60/60s.

## Headers

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `X-Wiblo-Workspace` | `string` | Yes | Workspace id the call is scoped to. The actor must hold an active membership in it; a foreign or unknown id collapses onto 404 WORKSPACE_NOT_FOUND. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | Yes | Display name, unique per workspace (case-insensitive). |
| `color` | `string \| null` | No | `#rrggbb` chip colour; `null` uses the default chip style. |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/service-tags \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "X-Wiblo-Workspace: $WIBLO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Deep dive",
  "color": "#a78bfa"
}'
```

**TypeScript**

```ts
import { createSdk, createServiceTag } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await createServiceTag({
  client: sdk,
  headers: { "X-Wiblo-Workspace": "..." },
  body: {
    "name": "Deep dive",
    "color": "#a78bfa"
  },
})
```

## Example response

```json
{
  "id": "f2a7c4e1-8b3d-4e5f-9a6c-1d0e8b5f3a2c",
  "workspace_id": "9c1b7e24-6a3f-4d58-b2e9-0f4a8c6d1e37",
  "name": "Deep dive",
  "color": "#a78bfa",
  "created_at": "2026-07-26T10:00:00.000Z",
  "updated_at": "2026-07-26T10:00:00.000Z"
}
```

## Responses

**`201`** — Tag created. Returns `TagResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Unique id of the tag. |
| `workspace_id` | `string` | Yes | Workspace the tag belongs to. |
| `name` | `string` | Yes | Display name, unique per workspace (case-insensitive). |
| `color` | `string \| null` | Yes | `#rrggbb` chip colour; `null` uses the default chip style. |
| `created_at` | `string` | Yes | Creation timestamp (RFC 3339). |
| `updated_at` | `string` | Yes | Last-update timestamp (RFC 3339). |

**`400`** — Body failed Zod validation, or the `X-Wiblo-Workspace` header was missing (`VALIDATION_FAILED`). Returns `ApiErrorEnvelope`.

**`401`** — No valid session cookie or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`403`** — The actor is a plain member; owner or admin is required (`ADMIN_REQUIRED`). Returns `ApiErrorEnvelope`.

**`404`** — The actor has no active membership in the header's workspace (`WORKSPACE_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`409`** — Another tag in the workspace already uses this name, case-insensitively (`TAG_NAME_TAKEN`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.
