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

# List violations

> List all violation snapshots with optional filtering and pagination.



## OpenAPI

````yaml /openapi/em-data-readiness-v2.yaml get /api/data-readiness/violations
openapi: 3.1.0
info:
  title: EM Data Readiness Service
  description: Data Readiness Service API for managing workflows, metrics, and data quality
  version: 4.3.0-dev1
servers: []
security:
  - BearerAuth: []
tags:
  - name: Health
    description: Service health monitoring. Check service status and version information.
  - name: Root
    description: Root endpoint providing service information and navigation links.
  - name: Configuration
    description: Service configuration endpoints. View current configuration values.
  - name: Workflows
    description: >-
      Workflow configuration and execution management. Create, configure, and
      run data quality workflows including definitions, configurations, runs,
      and tasks.
  - name: Data Assets
    description: >-
      Data catalog entity management. Manage databases, schemas, and tables
      metadata.
  - name: Metrics
    description: >-
      Data quality metrics and scorecards. Calculate scores, view trends, and
      analyze dimensions.
  - name: Violations
    description: >-
      Data quality violation management. View, acknowledge, and remediate
      detected violations.
  - name: Glossary
    description: >-
      Business glossary management. Create, verify, and organize business terms
      and definitions.
paths:
  /api/data-readiness/violations:
    get:
      tags:
        - Violations
      summary: List violations
      description: List all violation snapshots with optional filtering and pagination.
      operationId: list_violations
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number (1-indexed)
            default: 1
            title: Page
          description: Page number (1-indexed)
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Items per page
            default: 20
            title: Per Page
          description: Items per page
        - name: asset_fqn
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by asset FQN (prefix match)
            title: Asset Fqn
          description: Filter by asset FQN (prefix match)
        - name: service
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by service name
            title: Service
          description: Filter by service name
        - name: database
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by database name
            title: Database
          description: Filter by database name
        - name: schema
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by schema name
            title: Schema
          description: Filter by schema name
        - name: table
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by table name
            title: Table
          description: Filter by table name
        - name: severity
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ViolationSeverity'
              - type: 'null'
            description: Filter by severity
            title: Severity
          description: Filter by severity
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ViolationStatus'
              - type: 'null'
            description: Filter by status
            title: Status
          description: Filter by status
        - name: assessment_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AssessmentType'
              - type: 'null'
            description: Filter by assessment type (metadata or data_quality)
            title: Assessment Type
          description: Filter by assessment type (metadata or data_quality)
        - name: dimension_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Filter by dimension ID
            title: Dimension Id
          description: Filter by dimension ID
        - name: definition_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by violation definition
            title: Definition Name
          description: Filter by violation definition
        - name: workflow_run_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Filter by Prefect workflow run ID
            title: Workflow Run Id
          description: Filter by Prefect workflow run ID
        - name: sort_by
          in: query
          required: false
          schema:
            enum:
              - created_at
              - updated_at
              - severity
              - status
              - asset_fqn
              - service
              - database_name
              - schema_name
              - table_name
            type: string
            description: Sort field
            default: created_at
            title: Sort By
          description: Sort field
        - name: sort_order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/SortOrder'
            description: Sort direction
            default: desc
          description: Sort direction
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ViolationListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    ViolationSeverity:
      type: string
      enum:
        - low
        - medium
        - high
      title: ViolationSeverity
      description: Severity level of a violation.
    ViolationStatus:
      type: string
      enum:
        - open
        - resolved
        - acknowledged
        - false_positive
      title: ViolationStatus
      description: Lifecycle status of a violation.
    AssessmentType:
      type: string
      enum:
        - metadata
        - data_quality
      title: AssessmentType
      description: Type of assessment a dimension belongs to.
    SortOrder:
      type: string
      enum:
        - asc
        - desc
      title: SortOrder
      description: Sort order for list queries.
    ViolationListResponse:
      properties:
        violations:
          items:
            $ref: '#/components/schemas/ViolationResponse'
          type: array
          title: Violations
          description: List of violations
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
          description: Pagination metadata
      type: object
      required:
        - violations
        - pagination
      title: ViolationListResponse
      description: Response model for paginated violation list.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorInfo'
          description: >-
            Error information object containing code, message, and optional
            details
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: Request ID for debugging and support
          examples:
            - req_abc123xyz
      type: object
      required:
        - error
      title: ErrorResponse
      description: >-
        Standard error response model for API errors.


        Matches the structure returned by _handle_service_error in
        workflows/routes.py.

        The actual API response format is:

        {
            "error": {
                "code": "ERROR_CODE",
                "message": "Error message",
                "details": {...}
            },
            "request_id": "optional-request-id"
        }
    ViolationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique violation identifier
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
        name:
          type: string
          title: Name
          description: Violation type name
          examples:
            - missing_description
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
          description: Human-readable name
          examples:
            - Missing Description
        fqn:
          type: string
          title: Fqn
          description: Fully qualified name
          examples:
            - violations.missing_description
        dimension:
          $ref: '#/components/schemas/DimensionRef'
          description: Reference to the assessment dimension
        service:
          type: string
          title: Service
          description: Data service name
          examples:
            - production_db
        database:
          anyOf:
            - type: string
            - type: 'null'
          title: Database
          description: Database name
          examples:
            - analytics
        schema:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema
          description: Schema name
          examples:
            - public
        table:
          anyOf:
            - type: string
            - type: 'null'
          title: Table
          description: Table name
          examples:
            - customers
        column:
          anyOf:
            - type: string
            - type: 'null'
          title: Column
          description: Column name
          examples:
            - email
        asset_fqn:
          type: string
          title: Asset Fqn
          description: Fully qualified name of the asset
          examples:
            - production_db.analytics.public.customers.email
        asset_version:
          type: string
          title: Asset Version
          description: Version of the asset
          examples:
            - v1.0.0
        severity:
          type: string
          title: Severity
          description: Violation severity
          examples:
            - high
        status:
          type: string
          title: Status
          description: Current violation status
          examples:
            - open
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: Additional violation details
          examples:
            - actual: 'null'
              expected: not_null
        workflow_run_id:
          type: string
          format: uuid
          title: Workflow Run Id
          description: ID of the workflow run that detected this violation
          examples:
            - 550e8400-e29b-41d4-a716-446655440012
        dq_rule_execution_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Dq Rule Execution Id
          description: Link to DQ rule execution (nullable)
        resolved_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolved By
          description: Username who resolved the violation
          examples:
            - admin
        resolution_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution Notes
          description: Notes about the resolution
          examples:
            - Added missing description to column
        created_at:
          type: string
          title: Created At
          description: When the violation was created
          examples:
            - '2024-01-15T10:30:00Z'
      type: object
      required:
        - id
        - name
        - fqn
        - dimension
        - service
        - asset_fqn
        - asset_version
        - severity
        - status
        - workflow_run_id
        - created_at
      title: ViolationResponse
      description: Response model for a single violation snapshot.
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
          description: Current page number (1-indexed)
        per_page:
          type: integer
          title: Per Page
          description: Items per page
        total:
          type: integer
          title: Total
          description: Total number of items
        total_pages:
          type: integer
          title: Total Pages
          description: Total number of pages
        has_next:
          type: boolean
          title: Has Next
          description: Whether there is a next page
        has_prev:
          type: boolean
          title: Has Prev
          description: Whether there is a previous page
      type: object
      required:
        - page
        - per_page
        - total
        - total_pages
        - has_next
        - has_prev
      title: PaginationMeta
      description: >-
        Standard pagination metadata for list responses.


        This model provides consistent pagination information across all
        paginated

        API responses in the service.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ErrorInfo:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Error code identifier (e.g., 'WORKFLOW_NOT_FOUND',
            'VALIDATION_ERROR')
          examples:
            - WORKFLOW_NOT_FOUND
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
            - >-
              Workflow configuration with id
              '123e4567-e89b-12d3-a456-426614174000' not found
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Additional error details as a dictionary (flexible structure for
            business logic errors)
          examples:
            - workflow_id: 123e4567-e89b-12d3-a456-426614174000
      type: object
      required:
        - code
        - message
      title: ErrorInfo
      description: >-
        Nested error information object.


        Note: This model uses an untyped dict for `details` to match the
        flexible error

        structure used throughout the service layer (see WorkflowServiceError
        and similar).

        This is distinct from ErrorDetail, which is used for structured
        validation errors.
    DimensionRef:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique dimension identifier
          examples:
            - 550e8400-e29b-41d4-a716-446655440011
        name:
          type: string
          title: Name
          description: Dimension name
          examples:
            - accuracy
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
          description: Human-readable name
          examples:
            - Accuracy
        assessment_type:
          type: string
          title: Assessment Type
          description: 'Type of assessment: ''metadata'' or ''data_quality'''
          examples:
            - data_quality
      type: object
      required:
        - id
        - name
        - assessment_type
      title: DimensionRef
      description: Lightweight reference to a dimension (for violation responses only).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token authentication. Include the token in the Authorization
        header as: `Authorization: Bearer <token>`. The JWT must contain valid
        client_id, and project_id claims for tenant isolation and SDK routing.

````