---
title: "Create tag"
method: POST
path: "/tags"
tags: ["Tags"]
---

# Create tag

`POST /tags`

## Request

- Base URL: `https://api.caliuapp.com`
- URL: `https://api.caliuapp.com/tags`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `caliu_session`

Create a new tag. Restores soft-deleted tags with the same name.

## Request body

- object
  - `name` string, required: Tag name
  - `parentId` string
  - `color` string
  - `icon` string

## Response `201`

Tag created

- object
  - `tag` Tag, required
    - `id` string, required
    - `name` string, required
    - `parentId` string, nullable, required
    - `handle` string: Full hierarchical handle as written in note content, e.g. "#work/project" or "#my project#" (multi-word tags carry a closing hash)
    - `color` string, nullable, required
    - `icon` string, nullable, required
    - `isPinned` boolean: Pinned tags sort first in clients
    - `noteCount` number
    - `createdAt` string, required

## Other responses

- `409`: Tag already exists
- `422`: Validation error

---

[API](https://skmtc.dev/caliuapp/apis/caliu-api.md) · [All operations](https://skmtc.dev/caliuapp/apis/caliu-api/llms.txt) · [OpenAPI document](https://skmtc.dev/caliuapp/apis/caliu-api/revisions/1ba4d3f687fe?raw)
