> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.modex.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.modex.com/_mcp/server.

# Get company workforce

GET https://api.modex.com/v1/resources/companies/{company_id}/workforce

Loan officer headcount for a company over a timeframe, with monthly detail.

**Query parameters:**

| Parameter | Description |
|---|---|
| `timeframe` | `3`, `6`, `9`, `12` (months), `ytd`, or a year from `2019` to `2025`. Default `12`. Anything else returns 400. |

**Response fields:**

| Field | Type | Description |
|---|---|---|
| `timeframe` | string | The timeframe used |
| `total.headcount` | integer | Loan officers at the end of the last month |
| `total.arrivals` | integer | Loan officers who joined during the timeframe |
| `total.departures` | integer | Loan officers who left during the timeframe |
| `total.change_count` | integer | Last month's headcount minus the first month's |
| `total.change` | number | `change_count` as a fraction of the first month's headcount, rounded to 2 places (`0.1` = +10%) |
| `producing.*` | | Same fields, counting only loan officers with recorded loan production |
| `months[]` | array | One row per month, oldest first |
| `months[].period` | date | First day of the month |
| `months[].headcount`, `arrivals`, `departures` | integer | That month's figures |
| `months[].producing_headcount`, `producing_arrivals`, `producing_departures` | integer | Same, producing loan officers only |

A company with no employment history returns zeros and an empty `months` array.

Reference: https://docs.modex.com/api-reference/mortgage-data/companies/show-company-workforce

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `company_id` (string, required)

### Query parameters

- `timeframe` (integer, optional) — Workforce window: 3, 6, 9, 12, ytd, or a calendar year 2019–2025. Defaults to 12.

## Response

### 200

OK

- `timeframe` (string, optional) — The timeframe used
- `total` (V1ResourcesCompaniesCompanyIdWorkforceGetResponsesContentApplicationJsonSchemaTotal, optional) — Totals for the timeframe, counting all loan officers.
- `producing` (V1ResourcesCompaniesCompanyIdWorkforceGetResponsesContentApplicationJsonSchemaProducing, optional) — Same totals, counting only loan officers with recorded loan production.
- `months` (list of V1ResourcesCompaniesCompanyIdWorkforceGetResponsesContentApplicationJsonSchemaMonthsItems, optional) — One row per month, oldest first.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (ApiErrorError, required)

## Types

### V1ResourcesCompaniesCompanyIdWorkforceGetResponsesContentApplicationJsonSchemaTotal

Totals for the timeframe, counting all loan officers.

- `headcount` (integer, optional) — Loan officers at the end of the last month
- `arrivals` (integer, optional) — Loan officers who joined during the timeframe
- `departures` (integer, optional) — Loan officers who left during the timeframe
- `change_count` (integer, optional) — Last month's headcount minus the first month's
- `change` (double, optional) — `change_count` as a fraction of the first month's headcount, rounded to 2 places (`0.1` = +10%)

### V1ResourcesCompaniesCompanyIdWorkforceGetResponsesContentApplicationJsonSchemaProducing

Same totals, counting only loan officers with recorded loan production.

- `headcount` (integer, optional)
- `arrivals` (integer, optional)
- `departures` (integer, optional)
- `change_count` (integer, optional)
- `change` (double, optional)

### V1ResourcesCompaniesCompanyIdWorkforceGetResponsesContentApplicationJsonSchemaMonthsItems

- `period` (date, optional) — First day of the month
- `headcount` (integer, optional) — That month's figures
- `arrivals` (integer, optional)
- `departures` (integer, optional)
- `producing_headcount` (integer, optional) — Same, producing loan officers only
- `producing_arrivals` (integer, optional)
- `producing_departures` (integer, optional)

### ApiErrorError

- `type` (string, required) — Error category: invalid_request, authentication_error, permission_error, not_found, rate_limit_error, or api_error.
- `code` (string, required) — Specific error code. Same as `type`, except `validation_error` for request-body validation failures.
- `message` (string, required) — Human-readable explanation.
- `details` (map from string to list of string, optional) — Validation errors only: each invalid field mapped to its messages.

## Examples

**Response**

```json
{
  "timeframe": "12",
  "total": {
    "headcount": 343,
    "arrivals": 67,
    "departures": 34,
    "change_count": 31,
    "change": 0.1
  },
  "producing": {
    "headcount": 296,
    "arrivals": 49,
    "departures": 20,
    "change_count": 28,
    "change": 0.1
  },
  "months": [
    {
      "period": "2025-10-01",
      "headcount": 312,
      "arrivals": 6,
      "departures": 4,
      "producing_headcount": 268,
      "producing_arrivals": 4,
      "producing_departures": 3
    },
    {
      "period": "2025-11-01",
      "headcount": 315,
      "arrivals": 5,
      "departures": 2,
      "producing_headcount": 271,
      "producing_arrivals": 4,
      "producing_departures": 1
    },
    {
      "period": "2025-12-01",
      "headcount": 311,
      "arrivals": 2,
      "departures": 6,
      "producing_headcount": 270,
      "producing_arrivals": 2,
      "producing_departures": 3
    },
    {
      "period": "2026-01-01",
      "headcount": 318,
      "arrivals": 9,
      "departures": 2,
      "producing_headcount": 274,
      "producing_arrivals": 6,
      "producing_departures": 2
    },
    {
      "period": "2026-02-01",
      "headcount": 322,
      "arrivals": 7,
      "departures": 3,
      "producing_headcount": 277,
      "producing_arrivals": 5,
      "producing_departures": 2
    },
    {
      "period": "2026-03-01",
      "headcount": 327,
      "arrivals": 8,
      "departures": 3,
      "producing_headcount": 281,
      "producing_arrivals": 6,
      "producing_departures": 2
    },
    {
      "period": "2026-04-01",
      "headcount": 331,
      "arrivals": 6,
      "departures": 2,
      "producing_headcount": 285,
      "producing_arrivals": 5,
      "producing_departures": 1
    },
    {
      "period": "2026-05-01",
      "headcount": 334,
      "arrivals": 5,
      "departures": 2,
      "producing_headcount": 288,
      "producing_arrivals": 4,
      "producing_departures": 1
    },
    {
      "period": "2026-06-01",
      "headcount": 333,
      "arrivals": 3,
      "departures": 4,
      "producing_headcount": 288,
      "producing_arrivals": 2,
      "producing_departures": 2
    },
    {
      "period": "2026-07-01",
      "headcount": 338,
      "arrivals": 7,
      "departures": 2,
      "producing_headcount": 292,
      "producing_arrivals": 5,
      "producing_departures": 1
    },
    {
      "period": "2026-08-01",
      "headcount": 340,
      "arrivals": 4,
      "departures": 2,
      "producing_headcount": 294,
      "producing_arrivals": 3,
      "producing_departures": 1
    },
    {
      "period": "2026-09-01",
      "headcount": 343,
      "arrivals": 5,
      "departures": 2,
      "producing_headcount": 296,
      "producing_arrivals": 3,
      "producing_departures": 1
    }
  ]
}
```

**SDK Code**

```python 12 months
import requests

url = "https://api.modex.com/v1/resources/companies/company_id/workforce"

querystring = {"timeframe":"12"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript 12 months
const url = 'https://api.modex.com/v1/resources/companies/company_id/workforce?timeframe=12';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 12 months
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modex.com/v1/resources/companies/company_id/workforce?timeframe=12"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 12 months
require 'uri'
require 'net/http'

url = URI("https://api.modex.com/v1/resources/companies/company_id/workforce?timeframe=12")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 12 months
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.modex.com/v1/resources/companies/company_id/workforce?timeframe=12")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 12 months
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.modex.com/v1/resources/companies/company_id/workforce?timeframe=12', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 12 months
using RestSharp;

var client = new RestClient("https://api.modex.com/v1/resources/companies/company_id/workforce?timeframe=12");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 12 months
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modex.com/v1/resources/companies/company_id/workforce?timeframe=12")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```