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

# Get a violation

> Citation items OSHA issued in one inspection, under OSHA’s column names in camelCase, ordered by citation ID. Reads one citation item, including a deleted one. Needs the OSHA dataset enabled for your organization. Read-only; private, no-store. 



## OpenAPI

````yaml /openapi.json get /insurance/osha/inspections/{activityNr}/violations/{citationId}
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.canary.effectiveai.app/api/v2
    description: Canary
security:
  - bearerAuth: []
paths:
  /insurance/osha/inspections/{activityNr}/violations/{citationId}:
    get:
      tags:
        - OSHA
      summary: Get a violation
      description: >-
        Citation items OSHA issued in one inspection, under OSHA’s column names
        in camelCase, ordered by citation ID. Reads one citation item, including
        a deleted one. Needs the OSHA dataset enabled for your organization.
        Read-only; private, no-store. 
      operationId: getOshaViolation
      parameters:
        - schema:
            type: string
            pattern: ^\d{1,12}$
            description: Inspection activity number.
          required: true
          description: Inspection activity number.
          name: activityNr
          in: path
        - schema:
            type: string
            pattern: ^[A-Za-z0-9]{1,12}$
            description: Citation ID within the inspection, such as 01001.
          required: true
          description: Citation ID within the inspection, such as 01001.
          name: citationId
          in: path
      responses:
        '200':
          description: One violation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2OshaViolation'
        '400':
          description: >-
            invalid_request for invalid, unknown or repeated inputs;
            invalid_cursor means restart the list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: >-
            dataset_not_enabled: the OSHA dataset is not enabled for this
            organization. Other credential restrictions use forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: 'not_found: no such employer, site or OSHA row.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '500':
          description: Unexpected server failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: A dependency is unavailable; respect Retry-After.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2OshaViolation:
      type: object
      properties:
        activityNr:
          type: string
          nullable: true
        citationId:
          type: string
          nullable: true
        deleteFlag:
          type: string
          nullable: true
        standard:
          type: string
          nullable: true
        violType:
          type: string
          nullable: true
        issuanceDate:
          type: string
          nullable: true
        abateDate:
          type: string
          nullable: true
        abateComplete:
          type: string
          nullable: true
        currentPenalty:
          type: number
          nullable: true
        initialPenalty:
          type: number
          nullable: true
        contestDate:
          type: string
          nullable: true
        finalOrderDate:
          type: string
          nullable: true
        nrInstances:
          type: number
          nullable: true
        nrExposed:
          type: number
          nullable: true
        rec:
          type: string
          nullable: true
        gravity:
          type: string
          nullable: true
        emphasis:
          type: string
          nullable: true
        hazcat:
          type: string
          nullable: true
        ftaInspNr:
          type: string
          nullable: true
        ftaIssuanceDate:
          type: string
          nullable: true
        ftaPenalty:
          type: number
          nullable: true
        ftaContestDate:
          type: string
          nullable: true
        ftaFinalOrderDate:
          type: string
          nullable: true
        hazsub1:
          type: string
          nullable: true
        hazsub2:
          type: string
          nullable: true
        hazsub3:
          type: string
          nullable: true
        hazsub4:
          type: string
          nullable: true
        hazsub5:
          type: string
          nullable: true
        loadDt:
          type: string
          nullable: true
        id:
          type: string
          description: The citation ID, unique within the inspection.
        employerId:
          type: string
          nullable: true
          pattern: ^emp_[0-9a-f]{20}$
          description: >-
            Employer Effective matched this row to, or null if it could not
            place it.
        siteId:
          type: string
          nullable: true
          pattern: ^site_[0-9a-f]{20}$
          description: Site Effective matched this row to, or null.
        sourceFile:
          $ref: '#/components/schemas/V2OshaSourceFile'
      required:
        - activityNr
        - citationId
        - deleteFlag
        - standard
        - violType
        - issuanceDate
        - abateDate
        - abateComplete
        - currentPenalty
        - initialPenalty
        - contestDate
        - finalOrderDate
        - nrInstances
        - nrExposed
        - rec
        - gravity
        - emphasis
        - hazcat
        - ftaInspNr
        - ftaIssuanceDate
        - ftaPenalty
        - ftaContestDate
        - ftaFinalOrderDate
        - hazsub1
        - hazsub2
        - hazsub3
        - hazsub4
        - hazsub5
        - loadDt
        - id
        - employerId
        - siteId
        - sourceFile
      description: >-
        One citation item from an inspection. Fields are OSHA’s own column names
        in camelCase, with values as OSHA publishes them.
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
            dataset:
              type: string
              enum:
                - naic
                - osha
              description: Dataset needed for dataset_not_enabled.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: >-
                Where to add the product to your account, for
                product_access_required.
          required:
            - code
    V2OshaSourceFile:
      type: object
      properties:
        url:
          type: string
          description: OSHA or DOL file or API page the row was read from.
        sha256:
          type: string
          description: SHA-256 of that file as Effective downloaded it.
        retrievedAt:
          type: string
          description: When Effective downloaded it (RFC 3339).
      required:
        - url
        - sha256
        - retrievedAt
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.