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

# Analíticas

> Mide totales, rankings y series temporales.

Los endpoints de analíticas resumen cómo se usa el espacio de trabajo en proyectos y usuarios.

## Solicitud básica y respuesta

Empieza con los totales desde `GET /api/v1/app/organization/analytics/totals`.

```bash theme={null}
curl "https://{BASE_URL}/api/v1/app/organization/analytics/totals" \
  -H "Authorization: Bearer {API_TOKEN}"
  -H "x-org: {org_slug}"
```

<Accordion title="Ejemplo de respuesta">
  ```json theme={null}
  {
    "projects_total": 12,
    "threads_total": 184,
    "interactions_total": 1420,
    "agent_flows_total": 36,
    "uploaded_artifacts_total": 87
  }
  ```
</Accordion>

## Ranking de usuarios activos

<Accordion title="Parametros del endpoint">
  | Tipo  | Nombre       | Obligatorio | Notas                                   |
  | ----- | ------------ | ----------- | --------------------------------------- |
  | Query | `start_date` | No          | Inicio del periodo como timestamp Unix. |
  | Query | `end_date`   | No          | Fin del periodo como timestamp Unix.    |
  | Query | `limit`      | No          | Número máximo de usuarios a devolver.   |
</Accordion>

```bash theme={null}
curl "https://{BASE_URL}/api/v1/app/organization/analytics/ranking/active-users?start_date=1738291200&end_date=1738972800&limit=5" \
  -H "Authorization: Bearer {API_TOKEN}"
  -H "x-org: {org_slug}"
```

<Accordion title="Ejemplo de respuesta">
  ```json theme={null}
  [
    {
      "user": {
        "id": "user_4b7c2a1d9e5f3c8b",
        "org_id": "org_2f3a9d1c7b5e4a8f",
        "account_id": "acct_6c8a1f3b2d4e5f7a",
        "name": "Sasha Patel",
        "email": "sasha@auroralabs.com",
        "state": "Active",
        "roles": ["AppAdmin"],
        "created_at": "2026-02-08T14:12:45Z"
      },
      "interactions_created": 46,
      "agent_flows_created": 4
    }
  ]
  ```
</Accordion>

## Ranking de proyectos activos

<Accordion title="Parametros del endpoint">
  | Tipo  | Nombre       | Obligatorio | Notas                                   |
  | ----- | ------------ | ----------- | --------------------------------------- |
  | Query | `start_date` | No          | Inicio del periodo como timestamp Unix. |
  | Query | `end_date`   | No          | Fin del periodo como timestamp Unix.    |
  | Query | `limit`      | No          | Número máximo de proyectos a devolver.  |
</Accordion>

```bash theme={null}
curl "https://{BASE_URL}/api/v1/app/organization/analytics/ranking/active-projects?start_date=1738291200&end_date=1738972800&limit=5" \
  -H "Authorization: Bearer {API_TOKEN}"
  -H "x-org: {org_slug}"
```

<Accordion title="Ejemplo de respuesta">
  ```json theme={null}
  [
    {
      "project": {
        "id": "proj_7a5c3e1b9d2f4a6c",
        "name": "Customer Insights",
        "goal": "Summarize weekly support trends.",
        "deadline": "2026-03-01T00:00:00Z",
        "visibility": "Private",
        "member_count": 4,
        "default_member_role": "Editor",
        "default_role_enabled": true,
        "project_context": "Support analytics for Q1.",
        "answer_context": "Use approved templates.",
        "is_pinned": true
      },
      "interactions_created": 112,
      "agent_flows_created": 12
    }
  ]
  ```
</Accordion>

## Serie de tiempo

<Accordion title="Parametros del endpoint">
  | Tipo  | Nombre       | Obligatorio | Notas                                            |
  | ----- | ------------ | ----------- | ------------------------------------------------ |
  | Query | `start_date` | No          | Inicio del periodo como timestamp Unix.          |
  | Query | `end_date`   | No          | Fin del periodo como timestamp Unix.             |
  | Query | `type`       | Si          | Tipo de métrica a devolver, como `interactions`. |
</Accordion>

```bash theme={null}
curl "https://{BASE_URL}/api/v1/app/organization/analytics/timeseries?start_date=1738291200&end_date=1738972800&type=interactions" \
  -H "Authorization: Bearer {API_TOKEN}"
  -H "x-org: {org_slug}"
```

<Accordion title="Ejemplo de respuesta">
  ```json theme={null}
  [
    { "date": "2026-02-02", "value": 18 },
    { "date": "2026-02-03", "value": 25 },
    { "date": "2026-02-04", "value": 21 }
  ]
  ```
</Accordion>

## Errores y casos límite

* **400**: rango de fechas o tipo inválido.
* **403**: permisos insuficientes.
