> This page is for HR.

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

# Get Position Codes

GET https://api.paylocity.com/apiHub/positionManagement/v1/companies/{companyId}/positions

**Summary Description**

The GET Position Codes List by Company ID endpoint, retrieves a comprehensive list of Position Codes from the Paylocity system with each call. Position codes are alphanumeric or numeric designations employed by corporations to classify and oversee various job responsibilities and positions within their workforce. These codes fulfill several crucial functions in the domains of human resources, talent management, and organizational structure.
Pagination can be achieved by using the "positions" parameter and specifying the values of "limit" and "offset" to decide the quantity of records to be retrieved. The utilization of the "limit" option permits the user to restrict the quantity of rows that are retrieved from a query, whereas the "offset" option enables the omission of a designated number of rows preceding the commencement of the result set. The utilization of both the limit and offset parameters in a query allows for the skipping of rows as well as the restriction of the number of rows returned.

**Use Cases**

- Human Resources Management: HR departments often use position codes to categorize and manage job roles within an organization. The API can facilitate the creation, updating, and retrieval of position codes, ensuring that job roles are accurately documented and maintained.
- Payroll and Compensation Management: Position codes are crucial for determining salary scales and compensation packages. The API can be used to link position codes with salary information, simplifying payroll processing and compensation management.
- Recruitment and Onboarding: When hiring new employees, organizations can use the API to identify vacant positions and manage the recruitment process more efficiently. It can help HR teams keep track of available job roles and their requirements.
- Compliance and Reporting: Many regulatory agencies require organizations to report on specific job roles and positions. The API can assist in generating compliance reports by providing access to accurate position code data.


Reference: https://paylocity.ferndocs.com/hr/api-reference/latest/paylocity-ap-is/company-level-information-payroll-hr/get-position-codes

## Authentication

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

## Request

### Path parameters

- `companyId` (string, required)

### Query parameters

- `includeTotalCount` (boolean, optional) — A boolean value representing whether the API should return the total number of resources available (even though only a subset may be returned). When includeTotalCount=true, then the X-Pcty-Total-Count response header should be added to the response and will specify the total number of records available. APIs that support X-Pcty-Total-Count should include this parameter in their specification.
- `limit` (integer, optional) — Number of position codes per page. **Default Value:** 20 **Maximum Value:** 100
- `offset` (integer, optional) — Pagination offset.

### Headers

- `testMode` (boolean, optional) — If true all responses are mocked and generated randomly.
- `Accept` (string, optional)

## Response

### 200

Successful response

- `positions` (list of map from string to any, required)
- `totalCount` (integer, optional)

## Examples

**Response**

```json
{
  "positions": [
    {}
  ],
  "totalCount": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions"

querystring = {"includeTotalCount":"true","limit":"20","offset":"0"}

headers = {
    "testMode": "true",
    "Accept": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```javascript
const url = 'https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions?includeTotalCount=true&limit=20&offset=0';
const options = {
  method: 'GET',
  headers: {testMode: 'true', Accept: 'application/json', Authorization: 'Bearer <token>'}
};

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

```go
package main

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

func main() {

	url := "https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions?includeTotalCount=true&limit=20&offset=0"

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

	req.Header.Add("testMode", "true")
	req.Header.Add("Accept", "application/json")
	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
require 'uri'
require 'net/http'

url = URI("https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions?includeTotalCount=true&limit=20&offset=0")

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

request = Net::HTTP::Get.new(url)
request["testMode"] = 'true'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions?includeTotalCount=true&limit=20&offset=0")
  .header("testMode", "true")
  .header("Accept", "application/json")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions?includeTotalCount=true&limit=20&offset=0', [
  'headers' => [
    'Accept' => 'application/json',
    'Authorization' => 'Bearer <token>',
    'testMode' => 'true',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions?includeTotalCount=true&limit=20&offset=0");
var request = new RestRequest(Method.GET);
request.AddHeader("testMode", "true");
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "testMode": "true",
  "Accept": "application/json",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.paylocity.com/apiHub/positionManagement/v1/companies/companyId/positions?includeTotalCount=true&limit=20&offset=0")! 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()
```