---
title: "Get license for a specific NPN"
url: "https://developer.agentsync.io/apis/producer-sync-api/versions/bd45d597-3d48-4686-84a0-951d85a33e1e/operations/getLicensesByNpn"
---

> Full API specification: https://developer.agentsync.io/apis/producer-sync-api/versions/bd45d597-3d48-4686-84a0-951d85a33e1e.md

# Get license for a specific NPN

`GET` `/v2/entities/{npn}/licenses`

Operation ID: `getLicensesByNpn`

Returns all licenses associated with a specific NPN. If you're not already subscribed, this request will automatically subscribe you to the NPN.

## Path parameters

- `npn` (string, required) - National Producer Number (npn) of the data to return

## Query parameters

- `states` (array, optional) - comma separated list of states abbreviations (must be 2 characters) - this will filter on the `forState` field
- `active` (boolean, optional) - `true` or `false` indicating a search for active licenses (in its absence, both active and inactive licenses will be returned)
- `loaCodes` (string, optional) - comma separated list of LOA codes to filter licenses. This will return all licenses that match at least one of the specified LOA codes.
- `loaCategories` (array, optional) - comma seperated list of loa categories - this will filter on the `loaMapping.categories` array (it will return all records containing at least one of the values passed)
- `updatedSince` (string, date, optional) - limits results to those that have an updated date equivalent to or after to the date provided (YYYY-MM-DD) - this will filter on the `updatedAt` field
- `includeDeleted` (boolean, optional) - specifiy whether or not deleted records should be included in the response - this will filter on the `niprDeleted` field
- `size` (integer, int64, optional) - the number of objects on the page (min = 1 / max = 1,000)

## Responses

- `200` - Success
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found
- `405` - Method Not Allowed
- `429` - Too Many Requests
- `500` - Internal Server Error
- `504` - Gateway Timeout

## OpenAPI definition

```yaml
openapi: 3.1.1
info:
  title: ProducerSync API
  version: v2.68.24
servers:
  - url: https://api.sandbox.agentsync.io
    description: Sandbox
paths:
  /v2/entities/{npn}/licenses:
    get:
      tags:
        - Producer Licenses and LOAs
      x-internal: false
      x-audience:
        - customer
      operationId: getLicensesByNpn
      summary: Get license for a specific NPN
      description: >
        Returns all licenses associated with a specific NPN. If you're not
        already subscribed, this request will automatically subscribe you to the
        NPN.
      parameters:
        - $ref: "#/components/parameters/npnPathParam"
        - $ref: "#/components/parameters/statesParam"
        - $ref: "#/components/parameters/activeParam"
        - $ref: "#/components/parameters/loaCodesParam"
        - $ref: "#/components/parameters/loaCategoriesParam"
        - $ref: "#/components/parameters/updatedSinceParam"
        - $ref: "#/components/parameters/includeDeletedParam"
        - $ref: "#/components/parameters/sizeParam"
      responses:
        "200":
          description: Success
          content:
            application/hal+json:
              schema:
                type: object
                properties:
                  embedded:
                    type: object
                    properties:
                      licenses:
                        type: array
                        items:
                          $ref: "#/components/schemas/LicensesV2Response"
          headers:
            ratelimit-limit:
              $ref: "#/components/headers/ratelimit-limit"
            ratelimit-remaining:
              $ref: "#/components/headers/ratelimit-remaining"
            ratelimit-reset:
              $ref: "#/components/headers/ratelimit-reset"
        "400":
          $ref: "#/components/responses/400BadRequest"
        "401":
          $ref: "#/components/responses/401Unauthorized"
        "403":
          $ref: "#/components/responses/403Forbidden"
        "404":
          $ref: "#/components/responses/404NotFound"
        "405":
          $ref: "#/components/responses/405MethodNotAllowed"
        "429":
          $ref: "#/components/responses/429TooManyRequests"
        "500":
          $ref: "#/components/responses/500InternalServerError"
        "504":
          $ref: "#/components/responses/504GatewayTimeout"
components:
  parameters:
    npnPathParam:
      name: npn
      in: path
      description: National Producer Number (npn) of the data to return
      required: true
      schema:
        type: string
        example: "123456789"
    statesParam:
      name: states
      in: query
      description: comma separated list of states abbreviations (must be 2 characters)
        - this will filter on the `forState` field
      required: false
      schema:
        type: array
        items:
          type: string
      style: form
      explode: false
      example:
        - MO
        - CA
        - CO
    activeParam:
      name: active
      in: query
      description: >
        `true` or `false` indicating a search for active licenses (in its
        absence, both active and inactive licenses will be returned)
      required: false
      schema:
        type: boolean
        example: false
    loaCodesParam:
      name: loaCodes
      in: query
      description: comma separated list of LOA codes to filter licenses. This will
        return all licenses that match at least one of the specified LOA codes.
      required: false
      schema:
        type: string
        example: 12,3
    loaCategoriesParam:
      name: loaCategories
      in: query
      description: comma seperated list of loa categories - this will filter on the
        `loaMapping.categories` array (it will return all records containing at
        least one of the values passed)
      required: false
      schema:
        type: array
        items:
          type: string
      style: form
      explode: false
      example:
        - casualty
        - property
    updatedSinceParam:
      name: updatedSince
      in: query
      description: limits results to those that have an updated date equivalent to or
        after to the date provided (YYYY-MM-DD) - this will filter on the
        `updatedAt` field
      required: false
      schema:
        type: string
        format: date
        pattern: yyyy-MM-dd
        example: 2024-10-15
    includeDeletedParam:
      name: includeDeleted
      in: query
      description: specifiy whether or not deleted records should be included in the
        response - this will filter on the `niprDeleted` field
      required: false
      schema:
        type: boolean
        default: true
    sizeParam:
      name: size
      in: query
      description: the number of objects on the page (min = 1 / max = 1,000)
      required: false
      schema:
        type: integer
        format: int64
        default: 250
        minimum: 1
        maximum: 1000
  schemas:
    LicensesV2Response:
      allOf:
        - type: object
          properties:
            licenseLoas:
              type: array
              items:
                $ref: "#/components/schemas/LicenseLoaV2"
            agentTypes:
              type: array
              items:
                type: string
                example: Producer
            niprDeleted:
              type: boolean
              example: false
              description: Indicates if the license was marked deleted by NIPR.
    LicenseLoaV2:
      type: object
      description: Container for a list of license records in version 2
      properties:
        licenseLoas:
          type: array
          description: A list of license objects
          items:
            allOf:
              - type: object
  headers:
    ratelimit-limit:
      description: Maximum number of requests allowed in the current window
      schema:
        type: integer
    ratelimit-remaining:
      description: Number of requests remaining in the current window
      schema:
        type: integer
    ratelimit-reset:
      description: Time when the rate limit will reset
      schema:
        type: integer
  responses:
    400BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              timestamp:
                type: integer
                example: 1742929112
              status:
                type: integer
                example: 400
              error:
                type: string
                example: Bad Request
              message:
                type: string
                example: Invalid parameter values provided - {parameter}:[{invalid values}]
              path:
                type: string
                example: "{endpoint_path}"
    401Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthorized
    403Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              timestamp:
                type: integer
                example: 1742935636
              status:
                type: integer
                example: 403
              path:
                type: string
                example: "{requested endpoint}"
              error:
                type: string
                example: Forbidden
    404NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              timestamp:
                type: integer
                example: 1742929112
              status:
                type: integer
                example: 404
              error:
                type: string
                example: Not Found
              message:
                type: string
                example: Error message describing what was not found
              path:
                type: string
                example: "{requested endpoint}"
    405MethodNotAllowed:
      description: Method Not Allowed
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                example: about:blank
              status:
                type: integer
                example: 405
              detail:
                type: string
                example: Method 'PUT' is not supported.
              instance:
                type: string
                example: "{requested endpoint}"
    429TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: API rate limit exceeded
    500InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              timestamp:
                type: integer
                example: 1613510729601
              status:
                type: integer
                example: 500
              error:
                type: string
                example: Internal Server Error
              message:
                type: string
                example: Error message describing why this was a server error.
              path:
                type: string
                example: "{requested endpoint}"
    504GatewayTimeout:
      description: Gateway Timeout
```
