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

# Find the compliance events of one gateway request

> The App's compliance events that record request_id (the gateway's X-Tyk-AI-Request-ID) in their metadata, recorded within 10 minutes of at, oldest first, at most 20 (Enterprise). An agent trace's guardrail outcome links to them.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml get /compliance/events-by-request
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /compliance/events-by-request:
    get:
      tags:
        - Compliance
      summary: Find the compliance events of one gateway request
      description: >-
        The App's compliance events that record request_id (the gateway's
        X-Tyk-AI-Request-ID) in their metadata, recorded within 10 minutes of
        at, oldest first, at most 20 (Enterprise). An agent trace's guardrail
        outcome links to them.
      parameters:
        - name: request_id
          in: query
          description: Gateway request id (tyai_ followed by 32 hex digits)
          required: true
          schema:
            type: string
        - name: app_id
          in: query
          description: App ID
          required: true
          schema:
            type: integer
        - name: at
          in: query
          description: When the request ran (RFC 3339)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.complianceEventsByRequestResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api.complianceEventsByRequestResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/compliance.ComplianceEventRecord'
    models.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
    compliance.ComplianceEventRecord:
      type: object
      properties:
        app_id:
          type: integer
        app_name:
          type: string
        description:
          type: string
        event_type:
          type: string
        filter_name:
          type: string
        filter_scope:
          type: string
        id:
          type: integer
        llm_id:
          type: integer
        metadata:
          type: object
          additionalProperties: true
        model_name:
          type: string
        severity:
          type: string
        timestamp:
          type: string
        user_id:
          type: integer
        vendor:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````