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

# Find the GL and WC codes the agency writes for a class

> The general liability and workers compensation class codes the agency's AMS 360 book wrote for a class, most used first, with the description the agency entered and the states each was written in. Use it when someone asks which codes to use for a kind of business, and pass state_id once they name a state: one state read also serves every code's whole-book counts, states, carriers and rate.



## OpenAPI

````yaml /openapi.generated.json get /records/class-knowledge/rollups/rating-codes
openapi: 3.1.0
info:
  description: >-
    Public API reference. Generated from apps/engine/openapi.yaml by make
    docs-openapi-write. Do not edit.
  title: Nexio platform API
  version: '1'
servers:
  - url: https://api.usenexio.com
security: []
tags:
  - name: Access
  - name: Catalog
  - name: Conversations
  - name: Documents
  - name: Engines
  - name: Events
  - name: Feedback
  - name: Graph
  - name: Records
  - name: Roadmap
  - name: Runs
  - name: Webhooks
  - name: accounts
  - name: actions
  - name: activities
  - name: activity-feed
  - name: attachments
  - name: audit
  - name: benefit-plans
  - name: billing-transactions
  - name: carrier_documents
  - name: certificate-holders
  - name: certificate_drafts
  - name: certificates
  - name: change_feed
  - name: claims
  - name: classes
  - name: codes
  - name: commission_facts
  - name: connections
  - name: contacts
  - name: contingencies
  - name: conversations
  - name: customer
  - name: customer_contacts
  - name: deals
  - name: dependents
  - name: document_extractions
  - name: documents
  - name: drivers
  - name: eforms
  - name: employees
  - name: events
  - name: feature_requests
  - name: form-templates
  - name: invoices
  - name: leads
  - name: line_schedules_other
  - name: loss_history
  - name: machines
  - name: markets
  - name: motor-carriers
  - name: notes
  - name: opportunities
  - name: opportunity-signals
  - name: pages
  - name: personal_lines_detail
  - name: placement_choices
  - name: placement_feedback
  - name: placements
  - name: policies
  - name: policy_parties
  - name: policy_personnel
  - name: policy_transactions
  - name: premium_rows
  - name: procedures
  - name: proposals
  - name: quote_comparisons
  - name: quotes
  - name: records
  - name: register-views
  - name: renewal-entries
  - name: risk_review_choices
  - name: rollups
  - name: seats
  - name: sec-filings
  - name: service_agreements
  - name: submissions
  - name: suspenses
  - name: tasks
  - name: umbrella_underlying
  - name: underwriting_questions
  - name: uploaded_documents
  - name: vehicles
  - name: workflows
paths:
  /records/class-knowledge/rollups/rating-codes:
    get:
      tags:
        - markets
      summary: Find the GL and WC codes the agency writes for a class
      description: >-
        The general liability and workers compensation class codes the agency's
        AMS 360 book wrote for a class, most used first, with the description
        the agency entered and the states each was written in. Use it when
        someone asks which codes to use for a kind of business, and pass
        state_id once they name a state: one state read also serves every code's
        whole-book counts, states, carriers and rate.
      operationId: getClassKnowledgeRatingCodes
      parameters:
        - description: >-
            The member the read is made for (a WorkOS user id). Unset keeps the
            org-wide posture the key alone grants.
          in: header
          name: Nexio-Act-As
          schema:
            description: >-
              The member the read is made for (a WorkOS user id). Unset keeps
              the org-wide posture the key alone grants.
            type: string
        - description: >-
            The acting member's verified email, lowercased. Ignored without
            Nexio-Act-As.
          in: header
          name: Nexio-Act-As-Email
          schema:
            description: >-
              The acting member's verified email, lowercased. Ignored without
              Nexio-Act-As.
            type: string
        - description: The calling application (workbench).
          in: header
          name: Nexio-Consumer
          schema:
            description: The calling application (workbench).
            type: string
        - description: The calling application's build.
          in: header
          name: Nexio-Consumer-Build
          schema:
            description: The calling application's build.
            type: string
        - description: The access vocabulary hash the calling build was generated against.
          in: header
          name: Nexio-Consumer-Vocabulary
          schema:
            description: >-
              The access vocabulary hash the calling build was generated
              against.
            type: string
        - description: >-
            A caller-chosen request id, echoed in the Nexio-Request-Id response
            header.
          in: header
          name: Nexio-Request-Id
          schema:
            description: >-
              A caller-chosen request id, echoed in the Nexio-Request-Id
              response header.
            type: string
        - description: >-
            The caller's remaining budget for this request, in whole
            milliseconds (1 to 10 digits, greater than zero), relative to
            receipt. The engine stops work at the shorter of this and the
            route's own budget, and answers 504 request_timeout when it expires.
            A value above the route budget is capped to it; a malformed value is
            ignored.
          in: header
          name: Nexio-Timeout
          schema:
            description: >-
              The caller's remaining budget for this request, in whole
              milliseconds (1 to 10 digits, greater than zero), relative to
              receipt. The engine stops work at the shorter of this and the
              route's own budget, and answers 504 request_timeout when it
              expires. A value above the route budget is capped to it; a
              malformed value is ignored.
            type: string
        - description: >-
            An id of GET /records/classes (a 2022 NAICS code). Customers whose
            NAICS falls under it, or whose SIC the Census concordances carry
            into it, form the cohort.
          explode: false
          in: query
          name: class_id
          required: true
          schema:
            description: >-
              An id of GET /records/classes (a 2022 NAICS code). Customers whose
              NAICS falls under it, or whose SIC the Census concordances carry
              into it, form the cohort.
            type: string
        - description: >-
            A two-letter USPS state code. Adds each code's counts in the state
            (in_state) and narrows carriers and rates to it; codes, whole-book
            counts, descriptions and states never narrow. Each code also carries
            the whole book's carriers and rate in book_carriers and book_rate,
            so no second read without state_id is needed.
          explode: false
          in: query
          name: state_id
          schema:
            description: >-
              A two-letter USPS state code. Adds each code's counts in the state
              (in_state) and narrows carriers and rates to it; codes, whole-book
              counts, descriptions and states never narrow. Each code also
              carries the whole book's carriers and rate in book_carriers and
              book_rate, so no second read without state_id is needed.
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookClasses'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Bad Request
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Not Found
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: Service Unavailable
      security:
        - bearer: []
components:
  schemas:
    BookClasses:
      additionalProperties: false
      properties:
        carriers_withheld:
          description: >-
            True for a seat that does not read the estate evidence: each code's
            carriers (at least 3 customers each) and median rate per exposure
            unit (at least 5 single-class policies) are then absent.
          type: boolean
        lines:
          items:
            $ref: '#/components/schemas/BookClassLine'
          type:
            - array
            - 'null'
        naics:
          type: string
        sic:
          type: string
        source:
          $ref: '#/components/schemas/BookClassesSource'
        state:
          type: string
        status:
          description: >-
            no_rows_for_state: the book wrote the codes, but no policy in the
            asked state carries any of them. A warehouse outage is a 503
            refusal, never an empty answer.
          enum:
            - ok
            - no_book_rows
            - no_rows_for_state
          type: string
      required:
        - naics
        - sic
        - state
        - status
        - source
        - carriers_withheld
        - lines
      type: object
    Problem:
      additionalProperties: false
      properties:
        code:
          description: >-
            The stable machine-readable error code, UPPER_SNAKE_CASE, one
            meaning forever.
          enum:
            - INVALID_ARGUMENT
            - UNAUTHENTICATED
            - CAPABILITY_DENIED
            - NOT_VISIBLE_OR_ABSENT
            - IDEMPOTENT_REQUEST_IN_FLIGHT
            - ETAG_MISMATCH
            - VALIDATION_FAILED
            - IDEMPOTENCY_KEY_PAYLOAD_MISMATCH
            - SOURCE_UNAVAILABLE
            - RATE_LIMITED
            - INTERNAL
            - DEADLINE_EXCEEDED
            - UNAVAILABLE
            - CLIENT_CLOSED_REQUEST
          type: string
        detail:
          description: A human-readable sentence about this occurrence.
          type: string
        details:
          description: >-
            Structured detail for the reason (for example which owner selection
            rule failed). A Records refusal names its reason code in
            details.reason; a projection refusal (SOURCE_UNAVAILABLE) also names
            its closed subtype in details.subtype (admission_pending, no_build,
            binding_changed, agency_admission_unbounded,
            authority_coordinates_changed, guard_absent, derivation_unaccepted),
            and only admission_pending, which clears by itself, also carries
            details.retry_after_ms, equal to retry_after_ms and the Retry-After
            header.
        errors:
          description: Each invalid parameter, for INVALID_ARGUMENT.
          items:
            $ref: '#/components/schemas/ProblemError'
          type:
            - array
            - 'null'
        instance:
          description: The request path this occurrence answered.
          type: string
        reason:
          description: >-
            The finer cause within the code, UPPER_SNAKE_CASE (for example
            SCOPE_UNAVAILABLE under CAPABILITY_DENIED).
          type: string
        request_id:
          description: The request id, as echoed in the Nexio-Request-Id response header.
          type: string
        retry_after_ms:
          description: When a retry may succeed, the wait before it.
          format: int64
          type: integer
        status:
          description: The HTTP status code.
          format: int64
          type: integer
        title:
          description: The HTTP status phrase.
          type: string
        type:
          description: A URI naming the problem type, derived from the code.
          type: string
      required:
        - type
        - title
        - status
        - code
        - request_id
      type: object
    BookClassLine:
      additionalProperties: false
      properties:
        base_share:
          description: >-
            The share of the line's customers in the whole book that are in the
            class, to four places: the base a code's class_share is read
            against.
          format: double
          type: number
        codes:
          items:
            $ref: '#/components/schemas/BookClassCode'
          type:
            - array
            - 'null'
        in_state:
          anyOf:
            - $ref: '#/components/schemas/BookClassLineInState'
              description: >-
                The class's policies and customers on the line in the asked
                state, over every code the book wrote, not only the codes
                listed; null when no state was asked.
            - type: 'null'
        line:
          enum:
            - general_liability
            - workers_comp
          type: string
      required:
        - line
        - base_share
        - in_state
        - codes
      type: object
    BookClassesSource:
      additionalProperties: false
      properties:
        kind:
          type: string
        label:
          type: string
        read_at:
          format: date-time
          type: string
        window:
          type: string
      required:
        - kind
        - label
        - read_at
        - window
      type: object
    ProblemError:
      additionalProperties: false
      properties:
        location:
          description: Where the input was, for example query.limit.
          type: string
        message:
          type: string
        value: {}
      required:
        - message
      type: object
    BookClassCode:
      additionalProperties: false
      properties:
        all_customers:
          format: int64
          type: integer
        all_policies:
          description: Policies in the whole book that carry the code.
          format: int64
          type: integer
        book_carriers:
          description: >-
            The code's carriers over the whole book, present only when a state
            is asked and the whole book names one. Absent when
            carriers_withheld.
          items:
            $ref: '#/components/schemas/BookClassCarrier'
          type:
            - array
            - 'null'
        book_rate:
          $ref: '#/components/schemas/BookClassRate'
          description: >-
            The code's rate over the whole book, present only when a state is
            asked and the whole book clears the floor. Absent when
            carriers_withheld.
        carriers:
          description: Absent when carriers_withheld. Narrowed to the asked state.
          items:
            $ref: '#/components/schemas/BookClassCarrier'
          type:
            - array
            - 'null'
        class_share:
          description: >-
            The share of the code's customers in the whole book that are in the
            class (cohort_customers over all_customers), to three places.
          format: double
          type: number
        code:
          type: string
        cohort_customers:
          format: int64
          type: integer
        cohort_policies:
          description: >-
            Policies of the class's customers that carry the code, in the whole
            book.
          format: int64
          type: integer
        description:
          description: >-
            The most common description the agency entered for the code in AMS
            360, over the whole book; null when all_customers is under 3.
          type:
            - string
            - 'null'
        description_basis:
          enum:
            - agency_entered
          type: string
        fit:
          description: >-
            class: the class holds a clearly larger share of the code's
            customers than of the line's, so the code describes the class's own
            work. companion: a code the class carries alongside its own, used
            across the book.
          enum:
            - class
            - companion
          type: string
        in_state:
          anyOf:
            - $ref: '#/components/schemas/BookClassInState'
              description: >-
                The code's counts in the asked state; null when no state was
                asked.
            - type: 'null'
        premium_basis:
          enum:
            - gross_sales
            - payroll
            - total_cost
            - area
            - units
            - unknown
          type: string
        rate:
          anyOf:
            - $ref: '#/components/schemas/BookClassRate'
              description: >-
                Absent when carriers_withheld; null below the floor. Narrowed to
                the asked state.
            - type: 'null'
        scheme:
          enum:
            - iso_gl
            - ncci
            - state_bureau
            - carrier
          type: string
        states:
          description: Where the whole book wrote the code, most policies first.
          items:
            $ref: '#/components/schemas/BookClassState'
          type:
            - array
            - 'null'
      required:
        - code
        - scheme
        - description
        - description_basis
        - fit
        - class_share
        - cohort_policies
        - cohort_customers
        - all_policies
        - all_customers
        - in_state
        - premium_basis
        - states
      type: object
    BookClassLineInState:
      additionalProperties: false
      properties:
        cohort_customers:
          format: int64
          type: integer
        cohort_policies:
          format: int64
          type: integer
      required:
        - cohort_policies
        - cohort_customers
      type: object
    BookClassCarrier:
      additionalProperties: false
      properties:
        customers:
          format: int64
          type: integer
        name:
          type: string
      required:
        - name
        - customers
      type: object
    BookClassRate:
      additionalProperties: false
      properties:
        median:
          format: double
          type: number
        policies:
          format: int64
          type: integer
        unit:
          type: string
      required:
        - median
        - unit
        - policies
      type: object
    BookClassInState:
      additionalProperties: false
      properties:
        all_customers:
          format: int64
          type: integer
        all_policies:
          description: Policies in the whole book that carry the code in the state.
          format: int64
          type: integer
        cohort_customers:
          format: int64
          type: integer
        cohort_policies:
          description: Policies of the class's customers that carry the code in the state.
          format: int64
          type: integer
      required:
        - cohort_policies
        - cohort_customers
        - all_policies
        - all_customers
      type: object
    BookClassState:
      additionalProperties: false
      properties:
        policies:
          format: int64
          type: integer
        state:
          type: string
      required:
        - state
        - policies
      type: object
  securitySchemes:
    bearer:
      description: The org's platform API key.
      scheme: bearer
      type: http

````

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