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

# Listar Gatilhos

> Retorna os gatilhos configurados em um container com paginação.

Um **gatilho** é uma configuração que define quando e como uma conversão deve ser disparada — tipo de disparo (`api`, `page_view`, `element_click`, etc.), nome do evento no Metrito, mapeamento para a Meta Conversion API e condições de página.




## OpenAPI

````yaml /openapi/tracking.yaml get /v3/tracking/containers/{container_id}/triggers
openapi: 3.1.0
info:
  title: API de Rastreamento — Metrito
  version: '3.0'
  description: >
    API para envio de eventos de rastreamento, gerenciamento de gatilhos
    (triggers) e webhooks de transação.


    ## Conceitos


    - **Container** — O contêiner de rastreamento vinculado a um domínio.

    - **Gatilho (Trigger)** — Uma *configuração* que define quando e como uma
    conversão deve ser disparada (tipo de disparo, mapeamento Meta, condições).
    Recurso CRUD.

    - **Evento** — Um *dado de rastreamento* enviado em tempo real: "usuário
    visualizou página X", "usuário comprou Y". Transitório, processado via fila.


    ## Infraestrutura


    - Rate limiting via `X-RateLimit-*` headers

    - Request ID via `X-Request-Id` em todas as respostas

    - `Idempotency-Key` suportado em POSTs de criação e ingestão
servers:
  - url: https://api.metrito.com
    description: Produção
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /v3/tracking/containers/{container_id}/triggers:
    get:
      summary: Listar gatilhos
      description: >
        Retorna os gatilhos configurados em um container com paginação.


        Um **gatilho** é uma configuração que define quando e como uma conversão
        deve ser disparada — tipo de disparo (`api`, `page_view`,
        `element_click`, etc.), nome do evento no Metrito, mapeamento para a
        Meta Conversion API e condições de página.
      operationId: listTriggers
      parameters:
        - $ref: '#/components/parameters/ContainerId'
        - name: page
          in: query
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            maximum: 100
        - name: trigger_type
          in: query
          description: Filtrar por tipo de disparo
          schema:
            type: string
            enum:
              - api
              - page_view
              - page_view_duration
              - element_click
              - element_view
              - element_hover
              - form_submit
              - scroll_depth
              - video_view_duration
              - whatsapp_keyword_message
              - click_tracking_link
              - checkout_transaction_approved
      responses:
        '200':
          description: Gatilhos retornados com sucesso
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerListResponse'
              example:
                data:
                  - id: 64a1b2c3d4e5f6a7b8c9d0e2
                    name: Compra Aprovada
                    domain: minhaloja.com.br
                    config:
                      trigger:
                        type: api
                      facebook:
                        name: Purchase
                        track_custom: false
                    created_at: '2026-01-15T10:00:00.000Z'
                  - id: 64a1b2c3d4e5f6a7b8c9d0e3
                    name: Lead Capturado
                    domain: minhaloja.com.br
                    config:
                      trigger:
                        type: api
                      facebook:
                        name: Lead
                        track_custom: false
                    created_at: '2026-01-10T08:30:00.000Z'
                pagination:
                  page: 1
                  limit: 50
                  total: 2
                  total_pages: 1
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  parameters:
    ContainerId:
      name: container_id
      in: path
      required: true
      description: >
        Identificador do container. Aceita três formatos:

        - **ObjectId** — `64a1b2c3d4e5f6a7b8c9d0e1` (encontrado na URL da
        plataforma após `/containers/`)

        - **Domínio** — `minhaloja.com.br` (containers v2, o domínio real)

        - **Metrito Tracking Code** — `MTC-AB12` (containers v3, visível na
        sidebar da plataforma)
      schema:
        type: string
        examples:
          - 64a1b2c3d4e5f6a7b8c9d0e1
          - minhaloja.com.br
          - MTC-AB12
  schemas:
    TriggerListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Trigger'
        pagination:
          type: object
          properties:
            page:
              type: integer
            limit:
              type: integer
            total:
              type: integer
            total_pages:
              type: integer
    Trigger:
      type: object
      properties:
        id:
          type: string
          description: ID único do gatilho
        name:
          type: string
          description: Nome do gatilho
        description:
          type: string
          nullable: true
        domain:
          type: string
          description: Domínio do container
        is_automatic:
          type: boolean
          nullable: true
        config:
          type: object
          properties:
            trigger:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - api
                    - page_view
                    - page_view_duration
                    - element_click
                    - element_view
                    - element_hover
                    - form_submit
                    - scroll_depth
                    - video_view_duration
                    - whatsapp_keyword_message
                    - click_tracking_link
                    - checkout_transaction_approved
            facebook:
              type: object
              nullable: true
              properties:
                name:
                  type: string
                track_custom:
                  type: boolean
        created_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - authentication_error
                - authorization_error
                - validation_error
                - rate_limit_error
                - not_found_error
                - api_error
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
              nullable: true
  responses:
    Unauthorized:
      description: API key ausente, inválida, revogada ou expirada
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: authentication_error
              code: invalid_api_key
              message: The API key provided is invalid or has been revoked.
              request_id: req_abc123
    RateLimited:
      description: Rate limit excedido
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: rate_limit_error
              code: rate_limit_exceeded
              message: Rate limit exceeded. Maximum 120 requests per 60s.
              request_id: req_abc123
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: JWT da plataforma ou API key `mtk_live_...`
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key `mtk_live_...` via header `x-api-key`

````