Tags
Create a tag
Create ONE tag. Find-or-create semantics: if a tag with the same name already exists, the existing row is returned instead of a duplicate (tags are unique per user+name). **Requires `Idempotency-Key`.
POST /v2/tags/
Parameters
Query parameters
include
object
Header parameters
Idempotency-Key
string required
Required. UUID per logical operation, reused on every retry. See
apps/rest-api/src/shared/idempotency.ts for the full contract. Missing → 400 BadRequest; same key + different body → 409 Conflict.Request body
Content-Type: application/json
tag
object required
tag.name
string required
Example
{
"tag": {
"name": "string"
}
}
Responses
201 — Created
Content-Type: application/json
data
object required
data.tag
object required
data.tag.id
string (uuid) required
data.tag.user_id
string
data.tag.name
string
data.tag._count
object
data.tag._count.tags_contacts
integer
Example
{
"data": {
"tag": {
"id": "00000000-0000-0000-0000-000000000000"
}
}
}
400 — Request body failed validation.
Content-Type: application/json
(body)
any
401 — Missing or invalid API key.
Content-Type: application/json
(body)
any
403 — Valid key, insufficient permission.
Content-Type: application/json
(body)
any
404 — Resource does not exist.
Content-Type: application/json
(body)
any
409 — Request conflicts with the current state of the resource.
Content-Type: application/json
(body)
any
429 — Rate limit exceeded.
Content-Type: application/json
(body)
any
500 — Unexpected server error.
Content-Type: application/json
(body)
any
Code samples
curl https://api.prod.getdex.com/v2/tags/ \
--request POST \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"tag": {
"name": "string"
}
}'
fetch('https://api.prod.getdex.com/v2/tags/', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
tag: {
name: 'string'
}
})
})
requests.post("https://api.prod.getdex.com/v2/tags/",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"tag": {
"name": "string"
}
}
)
Create + assign tags to a contact
Find-or-create tags by name and assign them to one contact. Body: `{ tagNames: [...] }`. **Requires `Idempotency-Key`.** Returns the resulting tag list: `{ data: { tags: [...] } }` so the client can w
Count tags
Return the total count of the authenticated user's tags. Cheap path for the settings header / pagination math without loading the list.

