> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keebai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/crm/tags

> List the tag catalog, filtered by scope, category, or name.

Returns a paginated list of the tags defined in your company, sorted by name. Results cover the whole **company**, not just the project your token belongs to — see [Tenancy is implicit](https://docs.keebai.com/dev/crm/overview.md#tenancy-is-implicit).

Every tag has a **scope**: `ticket` tags label pipeline tickets, and `client` tags label customers and contacts. A tag's `_id` is what you send in a customer's `tags` array or in a [ticket update](https://docs.keebai.com/dev/endpoints/crm-ticket-update.md)'s `tag_ids`, `add_tag_ids`, and `remove_tag_ids`.

## Endpoint

```
GET https://api.keebai.com/v1/crm/tags
```

## Required scope

`crm:tags:read`

## Headers

| Header | Required | Value |
| - | - | - |
| `Authorization` | Yes | `Bearer kbai_pk_<token>` |

## Query parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `scope` | `string` | No | `ticket` or `client`. |
| `search` | `string` | No | Case-insensitive match anywhere in the tag name. Up to 100 characters. |
| `category_id` | `string` | No | `ObjectId` of a [tag category](https://docs.keebai.com/dev/endpoints/crm-tag-categories-list.md). Only tags in that category. |
| `limit` | `integer` | No | Page size, `1`–`200`. Defaults to 50. |
| `offset` | `integer` | No | Records to skip. Defaults to 0. |

## Example request

```bash curl theme={"system"}
curl -G https://api.keebai.com/v1/crm/tags \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  --data-urlencode "scope=ticket" \
  --data-urlencode "search=vip"
```

```js JavaScript theme={"system"}
const params = new URLSearchParams({ scope: "ticket", search: "vip" });

const response = await fetch(`https://api.keebai.com/v1/crm/tags?${params}`, {
  headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
});
const { data, total } = await response.json();
```

```python Python theme={"system"}
import os, requests

resp = requests.get(
    "https://api.keebai.com/v1/crm/tags",
    headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
    params={"scope": "ticket", "search": "vip"},
    timeout=10,
)
resp.raise_for_status()
tags = resp.json()["data"]
```

## Response

### 200 OK

```json theme={"system"}
{
  "data": [
    {
      "_id": "6720a1b2c3d4e5f6a7b8c9d0",
      "name": "Cliente VIP",
      "color": "#f5a623",
      "scope": "ticket",
      "category_id": "6720a0f1e2d3c4b5a6978877",
      "category": {
        "id": "6720a0f1e2d3c4b5a6978877",
        "name": "Segmento",
        "exclusive": true
      },
      "created_at": "2026-10-02T13:04:11.512Z",
      "updated_at": "2026-10-02T13:04:11.512Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}
```

`category` is `null` for a tag without a category.

### 400 Bad Request

A `scope` outside the allowed set, a malformed `category_id`, `limit` above 200, or an unknown query parameter.

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `crm:tags:read` scope.

## Operational notes

* **The catalog is small.** Most companies have a few dozen tags. Fetch it once, cache it, and resolve tag ids on tickets and customers locally instead of calling [GET /v1/crm/tags/:id](https://docs.keebai.com/dev/endpoints/crm-tag-get.md) per record.
* **Only the list resolves the category.** The detail and the write endpoints return `category_id` without the `category` summary.


## OpenAPI

````yaml GET /v1/crm/tags
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/crm/tags:
    get:
      tags:
        - crm-tags
      summary: Listar etiquetas
      description: >-
        Devuelve el catálogo de etiquetas de la company del token, ordenado por
        nombre.
      operationId: PublicTagsController_list
      parameters:
        - name: scope
          required: false
          in: query
          schema:
            type: string
            enum:
              - ticket
              - client
        - name: search
          required: false
          in: query
          description: Búsqueda por nombre, sin distinguir mayúsculas.
          schema:
            type: string
        - name: category_id
          required: false
          in: query
          description: Filtrar por categoría
          schema:
            type: string
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 200
            default: 50
            type: number
        - name: offset
          required: false
          in: query
          schema:
            type: number
            default: 0
            minimum: 0
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTagListResponseDto'
      security:
        - PAT: []
components:
  schemas:
    PublicTagListResponseDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PublicTagResponseDto'
        total:
          type: number
        limit:
          type: number
        offset:
          type: number
      required:
        - data
        - total
        - limit
        - offset
    PublicTagResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: ObjectId de la etiqueta
        name:
          type: string
        color:
          type: string
          example: '#1890ff'
        scope:
          type: string
          enum:
            - ticket
            - client
        category_id:
          type: string
          nullable: true
          description: ObjectId de la categoría, o `null` si no tiene.
        category:
          nullable: true
          description: >-
            Resumen de la categoría. Sólo viene en el listado; el detalle trae
            `category_id`.
          type: object
          allOf:
            - $ref: '#/components/schemas/PublicTagCategorySummaryDto'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - _id
        - name
        - color
        - scope
        - category_id
        - created_at
        - updated_at
    PublicTagCategorySummaryDto:
      type: object
      properties:
        id:
          type: string
          description: ObjectId de la categoría
        name:
          type: string
        exclusive:
          type: boolean
      required:
        - id
        - name
        - exclusive
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.