> ## 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/tickets/:id

> Fetch a single ticket by id.

Returns one ticket with its full record, including tags, conversation summary, and linked appointments.

## Endpoint

```
GET https://api.keebai.com/v1/crm/tickets/{id}
```

## Required scope

`crm:tickets:read`

## Headers

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

## Path parameters

| Field | Type     | Required | Description               |
| ----- | -------- | -------- | ------------------------- |
| `id`  | `string` | Yes      | `ObjectId` of the ticket. |

## Example request

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.keebai.com/v1/crm/tickets/65f4b5c6d7e8f9a0b1c2d3e4 \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ```

  ```js JavaScript theme={null}
  const response = await fetch(
    `https://api.keebai.com/v1/crm/tickets/${ticketId}`,
    { headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` } },
  );
  const { ticket } = await response.json();
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.get(
      f"https://api.keebai.com/v1/crm/tickets/{ticket_id}",
      headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
      timeout=10,
  )
  resp.raise_for_status()
  ticket = resp.json()["ticket"]
  ```
</CodeGroup>

## Response

### 200 OK

```json theme={null}
{
  "ticket": {
    "_id": "65f4b5c6d7e8f9a0b1c2d3e4",
    "chat_user": "66c1d2e3f4a5b6c7d8e9f0a1",
    "chat_user_name": "Juan Pérez",
    "chat_user_avatar": "https://cdn.keebai.com/avatars/juan.jpg",
    "chat_user_channel": "whatsapp",
    "chat_user_channel_id": "67d1e2f3a4b5c6d7e8f9a0b1",
    "stage": "67d1e2f3a4b5c6d7e8f9a0b1",
    "is_closed": false,
    "resolution": null,
    "priority": "high",
    "category": "soporte",
    "assigned_to": "68e1f2a3b4c5d6e7f8a9b0c1",
    "custom_fields": { "origen": "landing" },
    "amount": 150000,
    "amount_currency": "CLP",
    "amount_status": "estimated",
    "tag_ids": ["69f1a2b3c4d5e6f7a8b9c0d1"],
    "conversation_summary": {
      "motivo": "Consulta por plan anual",
      "estado": "Esperando confirmación de presupuesto",
      "proximos_pasos": "Enviar propuesta el lunes",
      "is_final": false
    },
    "appointment_ids": [],
    "operator_instructions": [],
    "closed_at": null,
    "created_at": "2026-05-02T14:31:07.221Z",
    "updated_at": "2026-05-02T15:02:44.010Z"
  }
}
```

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

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

### 404 Not Found

No ticket with that id, or the ticket belongs to a different company.


## OpenAPI

````yaml GET /v1/crm/tickets/{id}
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/tickets/{id}:
    get:
      tags:
        - crm-tickets
      summary: Obtener detalle de un ticket
      operationId: PublicTicketsController_get
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTicketEnvelopeDto'
      security:
        - PAT: []
components:
  schemas:
    PublicTicketEnvelopeDto:
      type: object
      properties:
        ticket:
          $ref: '#/components/schemas/PublicTicketResponseDto'
      required:
        - ticket
    PublicTicketResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: ObjectId del ticket
        chat_user:
          type: string
          description: ObjectId del chat user (contacto)
        chat_user_name:
          type: string
        chat_user_avatar:
          type: string
        chat_user_channel:
          type: string
          description: Canal de origen (whatsapp, instagram…)
        chat_user_channel_id:
          type: string
        stage:
          description: Etapa actual del pipeline. Ausente si el ticket no tiene una.
          allOf:
            - $ref: '#/components/schemas/PublicTicketStageDto'
        is_closed:
          type: boolean
        resolution:
          type: string
          enum:
            - won
            - lost
        priority:
          type: string
          enum:
            - low
            - medium
            - high
            - urgent
        category:
          type: string
        assigned_to:
          $ref: '#/components/schemas/PublicTicketAssigneeDto'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/PublicTicketTagDto'
        custom_fields:
          type: object
        amount:
          type: number
        amount_currency:
          type: string
          description: Moneda ISO 4217
        amount_status:
          type: string
          enum:
            - estimated
            - confirmed
        conversation_summary:
          $ref: '#/components/schemas/PublicConversationSummaryDto'
        ai_feedback_status:
          type: string
          description: 'Feedback de la IA: resolved | unresolved'
        appointment_ids:
          description: Citas de scheduling vinculadas al ticket
          type: array
          items:
            type: string
        last_message:
          description: Último mensaje del contacto. Sólo presente en el listado.
          allOf:
            - $ref: '#/components/schemas/PublicTicketLastMessageDto'
        closed_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - _id
        - chat_user
        - is_closed
        - priority
        - tags
        - custom_fields
        - created_at
        - updated_at
    PublicTicketStageDto:
      type: object
      properties:
        stage_id:
          type: string
          description: Etapa de destino dentro del pipeline
        prioridad:
          type: string
          description: Prioridad reportada al mover la etapa
        contexto:
          type: string
          description: Contexto del movimiento
        problema:
          type: string
          description: Problema detectado
        recomendaciones:
          type: string
          description: Recomendaciones para el operador
      required:
        - stage_id
    PublicTicketAssigneeDto:
      type: object
      properties:
        id:
          type: string
          description: ObjectId del usuario
        full_name:
          type: string
        email:
          type: string
      required:
        - id
    PublicTicketTagDto:
      type: object
      properties:
        id:
          type: string
          description: ObjectId del tag
        name:
          type: string
        color:
          type: string
          description: 'Color hex, ej. #1890ff'
      required:
        - id
        - name
    PublicConversationSummaryDto:
      type: object
      properties:
        motivo:
          type: string
        estado:
          type: string
        proximos_pasos:
          type: string
        is_final:
          type: boolean
    PublicTicketLastMessageDto:
      type: object
      properties:
        id:
          type: string
        content:
          type: string
        role:
          type: string
        direction:
          type: string
          description: inbound | outbound
        created_at:
          type: string
          format: date-time
      required:
        - id
  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`.

````