---
title: "List the producers your organization may see, or look one up by NPN"
url: "https://developer-staging.agentsync.io/apis/platform-api/versions/8177e94d-86f2-48a5-8ed6-d5fbcb69f38a/operations/listProducers"
---

> Full API specification: https://developer-staging.agentsync.io/apis/platform-api/versions/8177e94d-86f2-48a5-8ed6-d5fbcb69f38a.md

# List the producers your organization may see, or look one up by NPN

`GET` `/v1/producers`

Operation ID: `listProducers`

Without npn, returns one page of the producers your organization may see: the persons holding a contract assignment that is not terminated under a contract your organization is a party to, then the persons holding an active producer role at your organization. A terminated contract assignment does not make a producer visible; pending, active, suspended and inactive ones do. Each producer appears once in a walk over unchanging data; a producer who gains or loses a contract assignment while you page can be missed or listed twice. A page holds at most 100 producers, whatever page_size asks for above that, and can hold fewer, or none, with a next page still to come: continue while page.nextToken is present. A page token is signed for your organization and the status filter it was handed out with, and is a 400 with any other. With npn, returns the producer holding that National Producer Number, as a list of at most one, when your organization may see them. An NPN no person holds gets the same answer as a producer your organization may not see: a 404, or the 422 of a roster too large to search, so the answer never tells whether the NPN is held. npn cannot be combined with status or page_token. Responses are sent with Cache-Control: no-store.

## Query parameters

- `npn` (string, optional) - Look up the producer holding this National Producer Number. Not one to ten digits, or zero, is a 400.
- `status` (string, optional) - Only the producers with this status. Cannot be combined with npn.
- `page_size` (integer, optional) - Items per page. Defaults to 50; a value above 200 is clamped to 200. A non-numeric or non-positive value is a 400.
- `page_token` (string, optional) - Opaque token from a previous response's page.nextToken. Send it with the same filters as the request that returned it: it is signed for them. A token that is malformed, altered, sent with other filters, or longer than 1024 bytes is a 400.

## Responses

- `200` - One page of the producers your organization may see, or, with npn, the producer holding it.
- `400` - A parameter is missing, malformed or out of range (code parameter_invalid).
- `401` - The request has no bearer token, or the token is malformed, expired or wrongly signed (code token_invalid). Every /v1 path answers this without a valid token, including paths no route serves. The response carries WWW-Authenticate: Bearer.
- `403` - The token is valid but the API will not serve it. The code says why: caller_not_service_account (the token identifies a person; only service account tokens are accepted), caller_claims_missing (the token lacks a usable org_id or service_account_id claim), scope_missing (the token lacks the route's product scope, named in the details entry whose param is "scope"), or role_missing (the service account no longer holds a role at its organization that may call the route).
- `404` - No producer your organization may see matches (code producer_not_found): the person holds no contract assignment that is not terminated under your organization's contracts and no producer role at it. A person or NPN that does not exist gets the same answer.
- `422` - The producer holds no contract assignment that is not terminated under your organization's contracts, and your organization's producer roster is longer than the API searches for them (code producer_roster_too_large). An NPN no person holds gets the same answer. Retrying does not help.
- `503` - A platform service this API depends on is unavailable (code service_unavailable).

## OpenAPI definition

```yaml
openapi: 3.1.1
info:
  title: AgentSync Platform API
  version: 0.0.1
servers:
  - url: https://api.{environment}.agentsync.io/platform
    description: AgentSync API gateway
    variables:
      environment:
        default: sandbox
        enum:
          - sandbox
paths:
  /v1/producers:
    get:
      operationId: listProducers
      summary: List the producers your organization may see, or look one up by NPN
      description: >-
        Without npn, returns one page of the producers your organization may
        see: the persons holding a contract assignment that is not terminated
        under a contract your organization is a party to, then the persons
        holding an active producer role at your organization. A terminated
        contract assignment does not make a producer visible; pending, active,
        suspended and inactive ones do. Each producer appears once in a walk
        over unchanging data; a producer who gains or loses a contract
        assignment while you page can be missed or listed twice. A page holds at
        most 100 producers, whatever page_size asks for above that, and can hold
        fewer, or none, with a next page still to come: continue while
        page.nextToken is present. A page token is signed for your organization
        and the status filter it was handed out with, and is a 400 with any
        other.


        With npn, returns the producer holding that National Producer Number, as
        a list of at most one, when your organization may see them. An NPN no
        person holds gets the same answer as a producer your organization may
        not see: a 404, or the 422 of a roster too large to search, so the
        answer never tells whether the NPN is held. npn cannot be combined with
        status or page_token.


        Responses are sent with Cache-Control: no-store.
      security:
        - oauth2:
            - platform.producers.read
      parameters:
        - name: npn
          in: query
          description: Look up the producer holding this National Producer Number. Not one
            to ten digits, or zero, is a 400.
          required: false
          schema:
            type: string
            pattern: ^[0-9]{1,10}$
          example: "12345678"
        - name: status
          in: query
          description: Only the producers with this status. Cannot be combined with npn.
          required: false
          schema:
            type: string
            enum:
              - active
              - deactivated
          example: active
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageToken"
      responses:
        "200":
          description: One page of the producers your organization may see, or, with npn,
            the producer holding it.
          headers:
            Cache-Control:
              description: Always no-store, since the response carries persons' data.
              schema:
                type: string
              example: no-store
          content:
            application/json:
              schema:
                type: object
                description: A page of producers.
                required:
                  - items
                  - page
                properties:
                  items:
                    type: array
                    description: The producers on this page; with npn, the one holding it.
                    items:
                      $ref: "#/components/schemas/ProducerSummary"
                  page:
                    $ref: "#/components/schemas/Page"
              example:
                items:
                  - id: person_01h455vb4pex5vsknk084sn02q
                    npn: 12345678
                    status: active
                    firstName: Jane
                    lastName: Smith
                    preferredFirstName: null
                page:
                  nextToken: eyJrIjoicHJvZHVjZXJzIn0.c2lnbmF0dXJl
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/ProducerNotFound"
        "422":
          $ref: "#/components/responses/ProducerRosterTooLarge"
        "503":
          $ref: "#/components/responses/ServiceUnavailable"
security:
  - oauth2:
      - platform.producers.read
components:
  parameters:
    PageSize:
      name: page_size
      in: query
      description: Items per page. Defaults to 50; a value above 200 is clamped to
        200. A non-numeric or non-positive value is a 400.
      required: false
      schema:
        type: integer
        minimum: 1
        default: 50
      example: 100
    PageToken:
      name: page_token
      in: query
      description: "Opaque token from a previous response's page.nextToken. Send it
        with the same filters as the request that returned it: it is signed for
        them. A token that is malformed, altered, sent with other filters, or
        longer than 1024 bytes is a 400."
      required: false
      schema:
        type: string
      example: eyJrIjoiZXhhbXBsZSJ9
  schemas:
    ProducerSummary:
      type: object
      description: "A producer your organization may see: a person holding a contract
        assignment that is not terminated under one of its contracts, or an
        active producer role at it. The names are null when the person has no
        profile."
      required:
        - id
        - npn
        - status
        - firstName
        - lastName
        - preferredFirstName
      properties:
        id:
          $ref: "#/components/schemas/PersonId"
          description: The producer's person TypeID.
        npn:
          type:
            - integer
            - "null"
          format: int64
          description: The producer's National Producer Number. Null when none is on file.
          example: 12345678
        status:
          type: string
          description: deactivated once the person has been deactivated, else active.
          enum:
            - active
            - deactivated
          example: active
        firstName:
          type:
            - string
            - "null"
          description: The producer's legal first name.
          example: Jane
        lastName:
          type:
            - string
            - "null"
          description: The producer's legal last name.
          example: Smith
        preferredFirstName:
          type:
            - string
            - "null"
          description: The first name the producer goes by, when it differs.
          example: Janie
      example:
        id: person_01h455vb4pex5vsknk084sn02q
        npn: 12345678
        status: active
        firstName: Jane
        lastName: Smith
        preferredFirstName: null
    Page:
      type: object
      description: Pagination metadata of a collection response. nextToken is absent
        on the last page; pass it back as the page_token query parameter to
        continue.
      properties:
        nextToken:
          type: string
          description: Opaque token for the next page.
          example: eyJrIjoiZXhhbXBsZSJ9
      example:
        nextToken: eyJrIjoiZXhhbXBsZSJ9
    PersonId:
      type: string
      description: A person's ID, a TypeID with the prefix person.
      pattern: ^person_[0-7][0-9a-hjkmnp-tv-z]{25}$
      example: person_01h455vb4pex5vsknk084sn02q
    Error:
      type: object
      description: "The canonical error envelope. Every error the API writes carries a
        machine-readable code as the first details entry, the one whose param is
        \"code\"; branch on that, not on the message. There are two exceptions,
        both 500s the service could not build a normal error for: the platform's
        panic recovery writes an empty body, and a failure to encode a response
        writes {\"message\": \"internal server error\"} with no details. Treat a
        500 without a code as internal_error. A 429 from the API gateway, in
        front of the API, carries a message only; treat any 429 as a signal to
        slow down."
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable summary of why the request failed.
          example: invalid page_size
        details:
          type: array
          description: 'The code entry {"param": "code", "message": "<code>"} first, then
            entries that name the offending request parameter. Present on every
            error the service writes except the two code-less 500s described
            above, so it is not marked required.'
          items:
            $ref: "#/components/schemas/ErrorDetail"
      example:
        message: invalid page_size
        details:
          - param: code
            message: parameter_invalid
          - param: page_size
            message: must be a positive integer
    ErrorDetail:
      type: object
      description: "One entry of an error's details: the error code, or a request
        parameter and what is wrong with it."
      required:
        - param
        - message
      properties:
        param:
          type: string
          description: The parameter the entry is about, or "code" for the error code.
          example: code
        message:
          type: string
          description: For param "code", the error code; otherwise what is wrong with the
            parameter.
          example: parameter_invalid
      example:
        param: code
        message: parameter_invalid
  responses:
    BadRequest:
      description: A parameter is missing, malformed or out of range (code
        parameter_invalid).
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: invalid page_size
            details:
              - param: code
                message: parameter_invalid
              - param: page_size
                message: must be a positive integer
    Unauthorized:
      description: "The request has no bearer token, or the token is malformed,
        expired or wrongly signed (code token_invalid). Every /v1 path answers
        this without a valid token, including paths no route serves. The
        response carries WWW-Authenticate: Bearer."
      headers:
        WWW-Authenticate:
          description: The authentication scheme the API expects.
          schema:
            type: string
          example: Bearer
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: invalid or missing bearer token
            details:
              - param: code
                message: token_invalid
    Forbidden:
      description: "The token is valid but the API will not serve it. The code says
        why: caller_not_service_account (the token identifies a person; only
        service account tokens are accepted), caller_claims_missing (the token
        lacks a usable org_id or service_account_id claim), scope_missing (the
        token lacks the route's product scope, named in the details entry whose
        param is \"scope\"), or role_missing (the service account no longer
        holds a role at its organization that may call the route)."
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: token lacks the required scope
            details:
              - param: code
                message: scope_missing
              - param: scope
                message: platform.contracts.read
    ProducerNotFound:
      description: "No producer your organization may see matches (code
        producer_not_found): the person holds no contract assignment that is not
        terminated under your organization's contracts and no producer role at
        it. A person or NPN that does not exist gets the same answer."
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: producer not found
            details:
              - param: code
                message: producer_not_found
    ProducerRosterTooLarge:
      description: The producer holds no contract assignment that is not terminated
        under your organization's contracts, and your organization's producer
        roster is longer than the API searches for them (code
        producer_roster_too_large). An NPN no person holds gets the same answer.
        Retrying does not help.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: your organization's producer roster is too large to search for this
              producer
            details:
              - param: code
                message: producer_roster_too_large
    ServiceUnavailable:
      description: A platform service this API depends on is unavailable (code
        service_unavailable).
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: service unavailable
            details:
              - param: code
                message: service_unavailable
  securitySchemes:
    oauth2:
      type: oauth2
      description: "How to get the access token: the client-credentials flow, with the
        client ID and secret AgentSync issued for your organization. The token
        host follows the environment, auth.<environment>.agentsync.io. Request
        only the scopes your integration needs."
      flows:
        clientCredentials:
          tokenUrl: https://auth.sandbox.agentsync.io/oauth2/token
          scopes:
            platform.organizations.read: Read organizations.
            platform.contracts.read: Read contracts.
            platform.contract-assignments.read: Read contract assignments.
            platform.producers.read: Read producers.
            platform.tasks.read: Read tasks.
            platform.requirement-sets.read: Read requirement sets.
```
