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

# Listar violações de guardrail da organização

> Listar violações de guardrail para uma organização específica.

Para uma visão geral de como os guardrails funcionam e de como configurá-los, consulte o guia do recurso [AI Guardrails](/pt-BR/enterprise/features/ai-guardrails).

<div id="permissions">
  ## Permissões
</div>

Requer um usuário de serviço com a permissão `ManageEnterpriseSettings` no nível Enterprise.

<div id="time-filters">
  ## Filtros de tempo
</div>

Este endpoint suporta filtros de tempo opcionais usando os parâmetros de consulta `time_after` e `time_before`.

* Tanto `time_after` quanto `time_before` são **timestamps Unix em segundos**, interpretados como UTC.
* Se você fornecer `time_before`, também deverá fornecer `time_after`.
* O intervalo de tempo entre `time_after` e `time_before` deve ser de **100 dias ou menos**.
* Se nenhum filtro de tempo for fornecido, a API retorna violações de guardrails para todo o histórico disponível (sujeito à paginação).


## OpenAPI

````yaml pt-BR/v3-openapi.yaml GET /v3beta1/enterprise/organizations/{org_id}/guardrail-violations
openapi: 3.1.0
info:
  description: API Devin v3 com autenticação de usuário de serviço e RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3beta1/enterprise/organizations/{org_id}/guardrail-violations:
    get:
      tags:
        - guardrail_violations
      summary: Listar violações de guardrail da organização
      description: Listar violações de guardrail para uma organização específica.
      operationId: >-
        handle_get_org_guardrail_violations_v3beta1_enterprise_organizations__org_id__guardrail_violations_get
      parameters:
        - description: 'ID da organização (prefixo: org-)'
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
        - in: query
          name: order
          required: false
          schema:
            default: desc
            enum:
              - asc
              - desc
            title: Order
            type: string
        - in: query
          name: time_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time Before
        - in: query
          name: time_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time After
        - in: query
          name: after
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: After
        - in: query
          name: first
          required: false
          schema:
            default: 100
            maximum: 200
            minimum: 1
            title: First
            type: integer
        - in: query
          name: session_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Session Id
        - in: query
          name: guardrail_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Guardrail Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResponse_GuardrailViolationResponse_
          description: Resposta bem-sucedida
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Erro de validação
components:
  schemas:
    PaginatedResponse_GuardrailViolationResponse_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Cursor para obter a próxima página ou None se esta for a última
            página.
          title: End Cursor
        has_next_page:
          default: false
          description: Indica se há mais itens disponíveis após esta página.
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/GuardrailViolationResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Contagem total opcional (pode ser omitida por motivos de
            desempenho).
          title: Total
      required:
        - items
      title: PaginatedResponse[GuardrailViolationResponse]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    GuardrailViolationResponse:
      properties:
        action_taken:
          title: Action Taken
          type: string
        confidence_score:
          title: Confidence Score
          type: number
        created_at:
          title: Created At
          type: integer
        event_id:
          title: Event Id
          type: string
        guardrail_id:
          title: Guardrail Id
          type: string
        guardrail_name:
          title: Guardrail Name
          type: string
        org_id:
          title: Org Id
          type: string
        reasoning:
          title: Reasoning
          type: string
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        user_message:
          title: User Message
          type: string
        violation_id:
          title: Violation Id
          type: integer
      required:
        - violation_id
        - org_id
        - session_id
        - event_id
        - guardrail_id
        - guardrail_name
        - confidence_score
        - action_taken
        - reasoning
        - user_message
        - created_at
      title: GuardrailViolationResponse
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Credencial de usuário de serviço (prefixo: cog_)'
      scheme: bearer
      type: http

````