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

# Ver estadísticas del enlace

> Muestra clics y métricas agregadas de un enlace corto.



## OpenAPI

````yaml /es/short-links-api/api-reference/openapi-short-links.json get /v1/short-links/{id}/analytics
openapi: 3.0.3
info:
  title: 'API de notificación: enlaces cortos'
  description: >-
    API para **crear**, **enumerar**, **actualizar** y **eliminar** enlaces
    cortos del espacio de trabajo (dominio predeterminado **clicar.co** o según
    configuración), además de **análisis** (series temporales y pausas) y
    **lista de clics individuales**.


    **Autenticación:** Clave API en `Authorization: Bearer sk_live_xxxxx` o
    `x-api-key: sk_live_xxxxx`. El **espacio de trabajo** es siempre el de la
    clave (cada clave API pertenece a un espacio de trabajo); **no** envíe
    `x-workspace-id` en API v1: las solicitudes con este encabezado completado
    reciben **400** (`WORKSPACE_HEADER_NOT_ALLOWED`).


    **Ámbitos:** `short_links:read` (OBTENER) y `short_links:manage` (POST,
    PATCH, BORRAR).
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Producción
security:
  - ntfShortLinksBearerAuth: []
  - ntfShortLinksApiKeyHeader: []
tags:
  - name: Enlaces cortos
    description: CRUD, listado, análisis y eventos de clic en `/v1/short-links`.
paths:
  /v1/short-links/{id}/analytics:
    get:
      tags:
        - Short links
      summary: Ver estadísticas del enlace
      description: Muestra clics y métricas agregadas de un enlace corto.
      operationId: ntfShortLinks_getV1ShortLinksAnalytics
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID (algunos) de su enlace.
        - name: granularity
          in: query
          schema:
            type: string
            enum:
              - hour
              - day
          description: >-
            Agregación temporal. Cualquier valor distinto de `day` se trata como
            `hour`.
        - name: start
          in: query
          schema:
            type: string
            format: date-time
          description: Inicio de gama (inclusive), ISO 8601.
        - name: end
          in: query
          schema:
            type: string
            format: date-time
          description: Fin de rango (inclusive), ISO 8601.
      responses:
        '200':
          description: Analíticas en el rango solicitado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_AnalyticsResponse'
              examples:
                byDay:
                  summary: Granularidad diaria
                  value:
                    success: true
                    data:
                      granularity: day
                      range:
                        start: '2026-04-13T00:00:00.000Z'
                        end: '2026-04-20T23:59:59.999Z'
                      series:
                        - bucketStart: '2026-04-13T00:00:00.000Z'
                          clicksTotal: 5
                        - bucketStart: '2026-04-14T00:00:00.000Z'
                          clicksTotal: 12
                        - bucketStart: '2026-04-15T00:00:00.000Z'
                          clicksTotal: 8
                      breakdown:
                        country:
                          - key: BR
                            clicks: 20
                          - key: US
                            clicks: 3
                          - key: (unknown)
                            clicks: 2
                        deviceType:
                          - key: mobile
                            clicks: 18
                          - key: desktop
                            clicks: 7
        '400':
          description: '`start` o `end` no válido (fecha no analizable).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
              examples:
                invalidRange:
                  value:
                    success: false
                    error: Bad Request
                    message: Invalid start or end
                    code: BAD_REQUEST
        '401':
          description: Clave API faltante o no válida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
        '403':
          description: Falta el alcance `short_links:read`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
        '404':
          description: El enlace no existe o ha sido eliminado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfShortLinks_ErrorResponse'
              examples:
                notFound:
                  value:
                    success: false
                    error: Not Found
                    message: Not Found
                    code: NOT_FOUND
components:
  schemas:
    NtfShortLinks_AnalyticsResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/NtfShortLinks_AnalyticsPayload'
    NtfShortLinks_ErrorResponse:
      type: object
      description: Error genérico de API v1 (enlaces cortos).
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: >-
            Etiqueta de error de estilo HTTP (por ejemplo, no autorizado,
            solicitud incorrecta, no encontrada).
        message:
          type: string
          nullable: true
          description: >-
            Mensaje legible por humanos para usuarios finales (localizado a
            través de Accept-Language/x-locale cuando corresponda).
        code:
          type: string
          nullable: true
          description: >-
            Código API v1 estable (enumeración). Siempre presente en los
            errores. Úselo con el estado HTTP para decidir reintentar o
            corregir. Ver [Respuestas de
            error](/es/guides/conceitos/resposta-de-erros).
      required:
        - success
        - error
        - message
        - code
    NtfShortLinks_AnalyticsPayload:
      type: object
      required:
        - granularity
        - range
        - series
        - breakdown
      properties:
        granularity:
          type: string
          enum:
            - hour
            - day
        range:
          type: object
          required:
            - start
            - end
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        series:
          type: array
          items:
            $ref: '#/components/schemas/NtfShortLinks_AnalyticsBucket'
        breakdown:
          type: object
          required:
            - country
            - deviceType
          properties:
            country:
              type: array
              items:
                $ref: '#/components/schemas/NtfShortLinks_BreakdownRow'
            deviceType:
              type: array
              items:
                $ref: '#/components/schemas/NtfShortLinks_BreakdownRow'
    NtfShortLinks_AnalyticsBucket:
      type: object
      required:
        - bucketStart
        - clicksTotal
      properties:
        bucketStart:
          type: string
          format: date-time
        clicksTotal:
          type: integer
          minimum: 0
    NtfShortLinks_BreakdownRow:
      type: object
      required:
        - key
        - clicks
      properties:
        key:
          type: string
          description: País (ISO o `(unknown)`) o tipo de dispositivo.
        clicks:
          type: integer
          minimum: 0
  securitySchemes:
    ntfShortLinksBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Clave API sin autorización de encabezado. Ejemplo: `Authorization:
        Bearer sk_live_xxxxx`
    ntfShortLinksApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Clave API sin encabezado x-api-key. Ejemplo: `x-api-key: sk_live_xxxxx`'

````