Skip to content
Klozzo API
OpenAPI Postman

Reference

Tags

Tags are user-scoped labels attachable to contacts. Each tag has a name and an optional hex color. Tag deletion against an in-use tag returns 409 unless force=true is sent.

List tags

Returns all tags owned by the authenticated user, sorted alphabetically. Each tag includes the count of associated contacts.

GET /api/tags

curl --request GET \
    --get "https://klozzo.com/api/tags" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
{
    "data": [
        {
            "id": null,
            "name": "aut",
            "slug": null,
            "color": "#a11e59",
            "location_id": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": null,
            "name": "modi",
            "slug": null,
            "color": "#865450",
            "location_id": null,
            "created_at": null,
            "updated_at": null
        }
    ]
}
  • data object[]

    • id string

    • name string

    • slug string

    • color string

    • location_id string

    • created_at string

    • updated_at string

Create a tag

Tags are the free-form way to group people: a campaign, an event, a list you built by hand. Use them for something you will want to filter by later but that has no value of its own — when the thing you want to record has a value ("budget", "plan", "renewal date"), a custom field is what you want instead.

POST /api/tags

The name is unique inside the location; creating one that already exists answers 422 rather than a second tag with the same name.

Body parameters

  • name string required

    Tag name (max 255).

    Example: VIP

  • color string

    Hex color including the # prefix.

    Example: #ff6b35

curl --request POST \
    "https://klozzo.com/api/tags" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"VIP\",
    \"color\": \"#ff6b35\"
}"
{
    "data": {
        "id": null,
        "name": "nihil",
        "slug": null,
        "color": "#c8a15d",
        "location_id": null,
        "created_at": null,
        "updated_at": null
    }
}
  • data object

    • id string

    • name string

    • slug string

    • color string

    • location_id string

    • created_at string

    • updated_at string

Fetch a tag

Returns one tag by id, with how many contacts carry it. Useful before deleting one: the count is what tells you whether removing it is housekeeping or data loss.

GET /api/tags/{id}

Path parameters

  • id integer required

    Tag ID.

    Example: 3

curl --request GET \
    --get "https://klozzo.com/api/tags/3" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
{
    "data": {
        "id": null,
        "name": "adipisci",
        "slug": null,
        "color": "#f76df4",
        "location_id": null,
        "created_at": null,
        "updated_at": null
    }
}
  • data object

    • id string

    • name string

    • slug string

    • color string

    • location_id string

    • created_at string

    • updated_at string

Update a tag

Updates a tag's name or colour by id. Every contact carrying the tag sees the new name immediately — a tag is one row, not a copy per contact — so renaming is how you fix a typo, never how you split a group in two.

PUT /api/tags/{id}

Path parameters

  • id integer required

    Tag ID.

    Example: 3

Body parameters

  • name string

    Tag name (max 255).

    Example: VIP Customer

  • color string

    Hex color including the # prefix.

    Example: #ff6b35

curl --request PUT \
    "https://klozzo.com/api/tags/3" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"VIP Customer\",
    \"color\": \"#ff6b35\"
}"
{
    "data": {
        "id": null,
        "name": "accusantium",
        "slug": null,
        "color": "#902510",
        "location_id": null,
        "created_at": null,
        "updated_at": null
    }
}
  • data object

    • id string

    • name string

    • slug string

    • color string

    • location_id string

    • created_at string

    • updated_at string

Delete a tag

Deletes a tag by id. If the tag is attached to any contacts, returns 409 unless force=true is passed, in which case the tag is detached from all contacts then deleted.

DELETE /api/tags/{id}

Path parameters

  • id integer required

    Tag ID.

    Example: 3

Query parameters

  • force boolean

    Detach from contacts and delete anyway.

    Example: true

curl --request DELETE \
    "https://klozzo.com/api/tags/3?force=1" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
{
    "message": "Tag deleted."
}
  • message string