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

# Get Contractor Employees

> Returns a paginated list of employees for a specific contractor.



## OpenAPI

````yaml https://api.shovels.ai/spec/v2/openapi.production.yaml get /contractors/{id}/employees
openapi: 3.1.0
info:
  title: The Shovels API v2
  description: >

    The Shovels REST API makes it easy for technology developers in the
    property, climate, and

    construction industries to access detailed information about building
    permits, contractors and

    construction activity. Our API is designed to be intuitive and fast. We look
    forward to seeing what

    you build with it:

    [let us
    know](https://docs.google.com/forms/d/e/1FAIpQLSfs5Z6NZyPdnRpL96bMduH95OhfFZgLz9Hkc0-Y7pukUxSLxQ/viewform)

    and we'll check it out!


    ## Key Features

    The API offers access to two primary objects: **Permits** and
    **Contractors**.

    - **Permits**: Official documents issued by city or county authorities
    required before commencing

    construction or alterations to a building.

    - **Contractors**: Skilled professionals in the building trades who
    undertake permitted

    construction projects on various properties.


    And some additional resources:

    - **Lists**: Endpoints for predefined values like tags and property types
    for query parameters.

    - **Addresses**: Endpoint for searching and resolving valid US addresses.

    - **Meta**: Endpoints for metadata about the API and the data behind it.


    ## Getting started


    To begin using the API, please contact our sales team at

    [sales@shovels.ai](mailto:sales@shovels.ai) or grab a

    [free API key](https://app.shovels.ai/create-account/).


    > **Info**: The free API key has a limited number of calls.

    If you hit the limit and need more, please reach out to
    [sales@shovels.ai](mailto:sales@shovels.ai)

    or call us at [1-800-511-7457](tel:+18005117457).


    ### Authentication

    Our API uses a straightforward header-based authentication method:

    ```

    X-API-Key: YOUR_API_KEY_HERE

    ```


    Example Request:


    ```sh

    curl -X GET "https://api.shovels.ai/v2/meta/release" \
            -H "X-API-Key: YOUR_API_KEY_HERE"
    ```


    ## API Details


    ### Quick Overview


    A few quick details about our API:


    | Type                |
    Description                                                                |

    |---------------------|----------------------------------------------------------------------------|

    | SSL only            | We require that all requests are done over
    SSL.                            |

    | UTF-8 encoding      | We use UTF-8
    everywhere.                                                   |

    | Method              | GET for all read
    calls.                                                    |

    | Date format         | All dates in the API are strings in the following
    format: YYYY-MM-DD.      |


    ### Response Types


    The API supports the following response codes:


    | Code | Description |

    |------|-------------|

    | **200 OK** | Everything worked as expected. |

    | **400 Bad Request** | There was something wrong with your request.
    Double-check your input. |

    | **401 Unauthorized** | You need to log in to access this. Make sure your
    API key is correct. |

    | **402 Payment Required** | You will get this error if your reach your
    trial API call limit. |

    | **403 Forbidden** | You don't have permission to access this. |

    | **404 Not Found** | We couldn't find what you're looking for. Check the
    URL or resource ID. |

    | **422 Unprocessable Entity** | There's an issue with the data you
    sent.         Check [Error Handling](#error-handling) if you get this error.
    |

    | **429 Too Many Requests** | You're sending requests too quickly. Slow down
    and try again later. |

    | **500 Internal Server Error** | Yikes, something went wrong on our end.
    Please let us know         at [support@shovels.ai](support@shovels.ai) |


    ### Data Format


    The API returns data in JSON format, either as pages or single objects.


    Paginated responses have the following structure:

    ```json

    {
      "items": [...],
      "size": 50,
      "next_cursor": "eyJkYXR..." | null
    }

    ```

    Where objects are returned as an array in the 'items' field.


    ### Cursor-Based Pagination


    The API uses cursor-based pagination for all paginated endpoints. This
    method uses an opaque

    cursor token to maintain your position in the result set, offering better
    performance,

    consistency, and stability, especially for large datasets.


    ```json

    {
      "items": [...],
      "size": 50,
      "next_cursor": "eyJkYXR.lIjoiMjA.yMy0"
    }

    ```


    To use cursor-based pagination:

    - For the first page: Simply make a request without any pagination
    parameters (or optionally
      specify `size` to control page size)
    - For subsequent pages: Include the `next_cursor` value from the previous
    response using the
      `cursor` parameter

    Example:

    ```

    GET /v2/permits/search?size=10

    GET /v2/permits/search?size=10&cursor=eyJkYXR.lIjoiMjA.yMy0

    ```


    When there are no more results, the `next_cursor` value will be `null`.


    ### Versioning


    The current version of the API is v2, which is reflected in the endpoints
    URL structure:

    `/v2/`. We plan to evolve our API by releasing new versions to ensure
    backward compatibility while

    maintaining a steady pace of continuous improvements.


    ### Error Handling


    Proper error messages and HTTP codes are provided to help you troubleshoot
    issues effectively. Refer

    to the [Response Types](#response-types) section for an overview of HTTP
    error codes and how to

    handle them. Below we describe how to interpret HTTP 422 code.


    #### 422 Unprocessable Entity

    A 422 Unprocessable Entity response occurs when the server understands the
    request but cannot

    process it due to invalid data. This helps you identify issues with your
    input.


    The response includes:


    - **loc**: The location of the error. The first value indicates the location
    and the second
      specifies the problematic field. Common values for the first value include:
        - **body**: The error is in the request body.
        - **query**: The error is in the query parameters.
        - **path**: The error is in the URL path.
        - **header**: The error is in the request headers.
    - **msg**: A message describing the error.

    - **type**: The type of error.


    This information helps you correct your request by pinpointing the exact
    issue. Here are some

    examples:


    **Request Body Error**

    ```json

    {
      "detail": [
        {
          "loc": ["body", "first_name"],
          "msg": "Field is required",
          "type": "value_error.missing"
        }
      ]
    }

    ```


    **Query Parameter Error**

    ```json

    {
      "detail": [
        {
          "loc": ["query", "page"],
          "msg": "Page must be a positive integer",
          "type": "type_error.integer"
        }
      ]
    }

    ```

    **Path Parameter Error**

    ```json

    {
      "detail": [
        {
          "loc": ["path", "id"],
          "msg": "Invalid ID format",
          "type": "value_error.id"
        }
      ]
    }

    ```

    **Header Error**

    ```json

    {
      "detail": [
        {
          "loc": ["header", "X-API-Key"],
          "msg": "API key is missing",
          "type": "value_error.missing"
        }
      ]
    }

    ```

    These examples show how different types of errors are reported, helping you
    to diagnose and fix

    issues in your API requests.


    ## Credit Limits


    API usage is tracked using credits. Each record returned counts as one
    credit.


    ### Response Headers


    Successful JSON responses that return records include credit headers:

    - `X-Credits-Request`: Credits consumed by this request

    - `X-Credits-Limit`: Your monthly credit limit (omitted if unlimited)

    - `X-Credits-Remaining`: Credits remaining in your limit (omitted if
    unlimited)


    ### Checking Usage


    Use `GET /v2/usage` to check your current credit usage:


    ```json

    {
      "credits_used": 847293,
      "credit_limit": 1000000
    }

    ```


    ### Exceeding Limits


    When you exceed your credit limit, the API returns HTTP 402:


    ```json

    {
      "detail": {
        "error": "Monthly credit limit exceeded.",
        "limit": 1000000
      }
    }

    ```


    Credits are calculated on a rolling 30-day window. Usage older than 30 days
    automatically falls off.
  version: 2.0.0
servers:
  - url: https://api.shovels.ai/v2
    description: Shovels API
security: []
tags:
  - name: Meta
    description: Endpoints that provide information about the API and the data.
  - name: Lists
    description: >-
      Predefined lists of values and categories, such as tags and property
      types, which can be utilized as query parameters in other API
      interactions.
  - name: Permits
    description: >-
      Official documents issued by cities or counties before construction or
      alteration of a building can begin.
  - name: Contractors
    description: >-
      Licensed professionals who do permitted work on residential and commercial
      buildings.
  - name: Addresses
    description: US address ID resolution, lookup and metrics endpoints.
  - name: Cities
    description: City ID resolution, lookup and metrics endpoints.
  - name: Counties
    description: County ID resolution, lookup and metrics endpoints.
  - name: Jurisdictions
    description: Jurisdiction ID resolution, lookup and metrics endpoints.
  - name: States
    description: State metrics endpoints.
  - name: Usage
    description: Credit usage tracking.
paths:
  /contractors/{id}/employees:
    get:
      tags:
        - Contractors
        - Contractors
        - Contractors
      summary: Get Contractor Employees
      description: Returns a paginated list of employees for a specific contractor.
      operationId: get_contractor_employees_contractors__id__employees_get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Contractor ID
            description: Filter by the specified contractor ID.
          description: Filter by the specified contractor ID.
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Cursor for pagination
            title: Cursor
          description: Cursor for pagination
        - name: size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 50
            title: Size
      responses:
        '200':
          description: A list of employees associated with the contractor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedEmployeesResponse'
              example:
                items:
                  - id: aa145cd32c95f69b95e9233f6a957a32
                    contractor_id: 8wKHB2ZNf
                    name: John Smith
                    street_no: '123'
                    street: Oak Avenue
                    city: San Francisco
                    zip_code: '94105'
                    zip_code_ext: '1234'
                    state: CA
                    phone: (415) 555-0123
                    email: john.smith@personal.com
                    business_email: j.smith@company.com
                    linkedin_url: https://linkedin.com/in/johnsmith
                    homeowner: 'Y'
                    gender: M
                    age_range: 35-44
                    is_married: true
                    has_children: true
                    income_range: $120,000 to $149,999
                    net_worth: $150,000 to $249,999
                    job_title: Senior Solar Installation Technician
                    seniority_level: Senior
                    department: Installation
                  - id: 73744cd32c95f69b95e9233f6a957d90
                    contractor_id: 8wKHB2ZNf
                    name: Sarah Johnson
                    street_no: '456'
                    street: Pine Street
                    city: Oakland
                    zip_code: '94611'
                    zip_code_ext: '5678'
                    state: CA
                    phone: (510) 555-0456
                    email: sarah.j@personal.com
                    business_email: s.johnson@company.com
                    linkedin_url: https://linkedin.com/in/sarahjohnson
                    homeowner: 'N'
                    gender: F
                    age_range: 25-34
                    is_married: false
                    has_children: false
                    income_range: $75,000 to $100,000
                    net_worth: $150,000 to $249,999
                    job_title: Project Manager
                    seniority_level: Mid
                    department: Operations
                size: 2
                next_cursor: eyJjb250cmFjdG9yX2l
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PaginatedEmployeesResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Employees'
          type: array
          title: Items
          description: The list of items returned in the response following given criteria.
        size:
          type: integer
          title: Size
          description: The number of items returned in the response.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: The cursor for retrieving the next page of results.
        total_count:
          anyOf:
            - $ref: '#/components/schemas/TotalCount'
            - type: 'null'
          description: >-
            Total result count (capped at 10,000). Present on first-page
            responses when include_count=true. null if the count query timed
            out.
      type: object
      required:
        - items
        - size
        - next_cursor
      title: PaginatedEmployeesResponse
      description: Schema for paginated employees list response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Employees:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the person.
        contractor_id:
          type: string
          title: Contractor Id
          description: The contractor identifier this employee belongs to.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Full name of the employee.
        street_no:
          anyOf:
            - type: string
            - type: 'null'
          title: Street No
          description: Street number of employee's address.
        street:
          anyOf:
            - type: string
            - type: 'null'
          title: Street
          description: Street name of employee's address.
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: City of employee's address.
        zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code
          description: ZIP code of employee's address.
        zip_code_ext:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code Ext
          description: ZIP code extension.
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: State of employee's address.
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
          description: Employee's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Employee's personal email.
        business_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Business Email
          description: Employee's business email.
        linkedin_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedin Url
          description: Employee's LinkedIn profile URL.
        homeowner:
          anyOf:
            - type: string
            - type: 'null'
          title: Homeowner
          description: Homeowner status.
        gender:
          anyOf:
            - type: string
            - type: 'null'
          title: Gender
          description: Gender of the employee.
        age_range:
          anyOf:
            - type: string
            - type: 'null'
          title: Age Range
          description: Age range of the employee.
        is_married:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Married
          description: Marital status of the employee.
        has_children:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Children
          description: Whether the employee has children.
        income_range:
          anyOf:
            - type: string
            - type: 'null'
          title: Income Range
          description: Income range of the employee.
        net_worth:
          anyOf:
            - type: string
            - type: 'null'
          title: Net Worth
          description: Net worth range of the employee.
        job_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Title
          description: Current job title of the employee.
        seniority_level:
          anyOf:
            - type: string
            - type: 'null'
          title: Seniority Level
          description: Seniority level in the organization.
        department:
          anyOf:
            - type: string
            - type: 'null'
          title: Department
          description: Department the employee works in.
      type: object
      required:
        - id
        - contractor_id
      title: Employees
      description: Employees table.
    TotalCount:
      properties:
        value:
          type: integer
          minimum: 0
          title: Value
          description: The count value, capped at 10,000.
        relation:
          type: string
          enum:
            - eq
            - gte
          title: Relation
          description: >-
            "eq" means value is the exact count. "gte" means the actual count is
            at least 10,000 (the cap).
      type: object
      required:
        - value
        - relation
      title: TotalCount
      description: >-
        Capped result count with Elasticsearch-style {value, relation} shape.


        When the exact count is known and within COUNT_CAP, relation is "eq".

        When the count exceeds COUNT_CAP, value is COUNT_CAP and relation is
        "gte",

        meaning "greater than or equal to COUNT_CAP".
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````