> This page is for version API (default).
> For other versions, use one of these documentation indexes:
> - API (default): https://docs.getthera.com/api/llms.txt
> - API + Legacy Read: https://docs.getthera.com/api-legacy-read/llms.txt
> - API + Legacy Full: https://docs.getthera.com/api-legacy-full/llms.txt

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

# Get Time Off Policies By Company

GET https://api.getthera.com/companies/{companyId}/timeoff-policies

Returns all time off policies for a company along with their contractor associations and default policy ids, sourced from the time off policy table. Use this instead of reading timeOffSettings off the company object.

Reference: https://docs.getthera.com/thera-api/payroll/timeoff-api/get-time-off-policies-by-company

## Authentication

- `X-Thera-API-Key` header (required) — API Key authentication via header

## Servers

- `https://api.getthera.com` (Production, default)
- `https://api.staging.getthera.com` (Staging)

## Request

### Path parameters

- `companyId` (string, required)

## Response

### 200

- `policies` (list of TimeOffPolicy, required)
- `defaultTimeOffPolicies` (set of string, required)
- `associatedUserIdsByPolicyId` (map from string to set of string, required)

## Types

### TimeOffPolicy

- `id` (string, required)
- `policyName` (string, required)
- `payType` (enum, required)
  - Allowed values: `UNPAID`, `PAID`, `US_HOLIDAY`
- `leaveType` (string, required)
- `allowanceType` (AllowanceType, required)
- `midYearJoiningAllowance` (enum, required)
  - Allowed values: `FULL_AMOUNT`, `PRORATED_AMOUNT`
- `accrualType` (map from enum to enum, required) — Whether the policy allowance is per month or per year
  - Allowed values: `MONTHLY`, `ANNUAL`
- `autoDeductEnabled` (map from enum to boolean, required) — Whether to automatically create deductions for PTO overages
- `createdByUserId` (string, required)
- `creationTimestamp` (long, required)
- `lastUpdationTimestamp` (long, required)
- `timeOffPolicyAddedFor` (set of enum, required)
  - Allowed values: `EMPLOYEE`, `CONTRACTOR`
- `deletionDetails` (TimeOffTerminationDetails, optional)
- `holidayDefinitions` (list of Holiday, optional)
- `accrualConfigByEmploymentType` (map from enum to AccrualConfig, optional)
- `carryoverConfigByEmploymentType` (map from enum to CarryoverConfig, optional)
- `negativeBalanceBehaviorByEmploymentType` (map from enum to enum, optional)
  - Allowed values: `BLOCK`, `WARN`, `APPROVAL_QUEUE`

### AllowanceType

- `type`: `limitedAllowance`
  - `allowedNumberOfDays` (double, required)
- `type`: `unlimitedAllowance`

### TimeOffTerminationDetails

- `terminatingUserId` (string, required)
- `deletionTimestamp` (long, required)

### Holiday

- `id` (string, required)
- `name` (string, required)
- `type` (enum, required)
  - Allowed values: `FEDERAL`, `CUSTOM`
- `enabled` (boolean, required)
- `dateRule` (string, optional)
- `startDate` (date, optional)
- `endDate` (date, optional)
- `createdBy` (string, optional)
- `createdAt` (long, optional)

### AccrualConfig

V2 accrual configuration. You set basis + frequency + annualAllowance, and ratePerPeriod = annualAllowance / periodsPerYear is derived. For HOURS_WORKED, 1 day = 8 hours.

- `basis` (enum, required)
  - Allowed values: `CALENDAR`, `HOURS_WORKED`
- `frequency` (enum, required)
  - Allowed values: `DAILY`, `WEEKLY`, `BIWEEKLY`, `SEMI_MONTHLY`, `MONTHLY`, `ANNUALLY`, `PER_PAY_CYCLE`
- `ratePerPeriod` (double, required) — Derived: annualAllowance / periodsPerYear. In hours if HOURS_WORKED, days if CALENDAR.
- `annualAllowance` (double, optional) — Total allowance per year. In hours if basis=HOURS_WORKED (e.g. 576), in days if basis=CALENDAR (e.g. 20). ratePerPeriod is derived from this.
- `accrualCap` (double, optional) — Accruals pause once balance reaches this cap (in days). Null = no cap.
- `waitingPeriodDays` (integer, optional) — Days from hire date before first accrual runs (probation period).
- `cliffDays` (integer, optional) — Days from hire before a one-time cliff grant fires. No incremental accrual before cliff.
- `cliffGrantDays` (double, optional) — Lump-sum days granted when cliff vesting triggers.
- `anniversaryTiers` (list of AnniversaryAccrualTier, optional) — Ordered tenure-based accrual rate overrides. On each accrual date, the tier with the highest yearsOfService that is \<= the employee's full years of service is applied.
- `accrualHoursEarned` (double, optional) — PTO hours granted each time a full accrualPerHoursWorked hours of work is completed (e.g. 2 in '2 hours per 50 worked'). Set with accrualPerHoursWorked this defines the accrual: the grant is all-or-nothing per completed block, never a proportion of a partial one.
- `accrualPerHoursWorked` (double, optional) — Hours that must be worked to earn accrualHoursEarned PTO hours (e.g. 50 in '2 hours per 50 worked'). Nothing is granted until a full block completes, so 2 per 50 grants 2 hours at 50 worked hours and nothing at 25. Hours left over carry forward and count towards the next block across payroll runs.

### CarryoverConfig

Defines how unused balance behaves at year-end rollover for a given employment type.

- `type` (enum, required)
  - Allowed values: `NONE`, `FULL`, `CAPPED`
- `carryoverCapDays` (double, optional) — Max days that carry forward. Only relevant when type = CAPPED.
- `rolloverMonthDay` (string, optional) — MM-DD when rollover occurs. Defaults to 01-01 (Jan 1).
- `carriedDaysExpiryMonthDay` (string, optional) — MM-DD by which carried days must be used (e.g. 03-31). Null = carried days never expire.

### AnniversaryAccrualTier

A tenure-based override for the accrual rate. Applied once the employee has served at least yearsOfService full years.

- `yearsOfService` (integer, required) — Minimum full years of service before this tier applies (e.g. 3 means Year 3+).
- `ratePerPeriod` (double, required) — Days accrued per frequency period at this tenure tier.

## Examples

**Response**

```json
{
  "policies": [
    {
      "id": "id",
      "policyName": "policyName",
      "payType": "UNPAID",
      "leaveType": "leaveType",
      "allowanceType": {
        "type": "limitedAllowance",
        "allowedNumberOfDays": 1.1
      },
      "midYearJoiningAllowance": "FULL_AMOUNT",
      "accrualType": {
        "EMPLOYEE": "MONTHLY"
      },
      "autoDeductEnabled": {
        "EMPLOYEE": true
      },
      "createdByUserId": "createdByUserId",
      "creationTimestamp": 1000000,
      "lastUpdationTimestamp": 1000000,
      "timeOffPolicyAddedFor": [
        "EMPLOYEE"
      ],
      "deletionDetails": {
        "terminatingUserId": "terminatingUserId",
        "deletionTimestamp": 1000000
      },
      "holidayDefinitions": [
        {
          "id": "id",
          "name": "name",
          "type": "FEDERAL",
          "enabled": true,
          "dateRule": "dateRule",
          "startDate": "2023-01-15",
          "endDate": "2023-01-15",
          "createdBy": "createdBy",
          "createdAt": 1000000
        },
        {
          "id": "id",
          "name": "name",
          "type": "FEDERAL",
          "enabled": true,
          "dateRule": "dateRule",
          "startDate": "2023-01-15",
          "endDate": "2023-01-15",
          "createdBy": "createdBy",
          "createdAt": 1000000
        }
      ],
      "accrualConfigByEmploymentType": {
        "EMPLOYEE": {
          "basis": "CALENDAR",
          "frequency": "DAILY",
          "ratePerPeriod": 1.1,
          "annualAllowance": 1.1,
          "accrualCap": 1.1,
          "waitingPeriodDays": 1,
          "cliffDays": 1,
          "cliffGrantDays": 1.1,
          "anniversaryTiers": [
            {
              "yearsOfService": 1,
              "ratePerPeriod": 1.1
            },
            {
              "yearsOfService": 1,
              "ratePerPeriod": 1.1
            }
          ],
          "accrualHoursEarned": 1.1,
          "accrualPerHoursWorked": 1.1
        }
      },
      "carryoverConfigByEmploymentType": {
        "EMPLOYEE": {
          "type": "NONE",
          "carryoverCapDays": 1.1,
          "rolloverMonthDay": "rolloverMonthDay",
          "carriedDaysExpiryMonthDay": "carriedDaysExpiryMonthDay"
        }
      },
      "negativeBalanceBehaviorByEmploymentType": {
        "EMPLOYEE": "BLOCK"
      }
    },
    {
      "id": "id",
      "policyName": "policyName",
      "payType": "UNPAID",
      "leaveType": "leaveType",
      "allowanceType": {
        "type": "limitedAllowance",
        "allowedNumberOfDays": 1.1
      },
      "midYearJoiningAllowance": "FULL_AMOUNT",
      "accrualType": {
        "EMPLOYEE": "MONTHLY"
      },
      "autoDeductEnabled": {
        "EMPLOYEE": true
      },
      "createdByUserId": "createdByUserId",
      "creationTimestamp": 1000000,
      "lastUpdationTimestamp": 1000000,
      "timeOffPolicyAddedFor": [
        "EMPLOYEE"
      ],
      "deletionDetails": {
        "terminatingUserId": "terminatingUserId",
        "deletionTimestamp": 1000000
      },
      "holidayDefinitions": [
        {
          "id": "id",
          "name": "name",
          "type": "FEDERAL",
          "enabled": true,
          "dateRule": "dateRule",
          "startDate": "2023-01-15",
          "endDate": "2023-01-15",
          "createdBy": "createdBy",
          "createdAt": 1000000
        },
        {
          "id": "id",
          "name": "name",
          "type": "FEDERAL",
          "enabled": true,
          "dateRule": "dateRule",
          "startDate": "2023-01-15",
          "endDate": "2023-01-15",
          "createdBy": "createdBy",
          "createdAt": 1000000
        }
      ],
      "accrualConfigByEmploymentType": {
        "EMPLOYEE": {
          "basis": "CALENDAR",
          "frequency": "DAILY",
          "ratePerPeriod": 1.1,
          "annualAllowance": 1.1,
          "accrualCap": 1.1,
          "waitingPeriodDays": 1,
          "cliffDays": 1,
          "cliffGrantDays": 1.1,
          "anniversaryTiers": [
            {
              "yearsOfService": 1,
              "ratePerPeriod": 1.1
            },
            {
              "yearsOfService": 1,
              "ratePerPeriod": 1.1
            }
          ],
          "accrualHoursEarned": 1.1,
          "accrualPerHoursWorked": 1.1
        }
      },
      "carryoverConfigByEmploymentType": {
        "EMPLOYEE": {
          "type": "NONE",
          "carryoverCapDays": 1.1,
          "rolloverMonthDay": "rolloverMonthDay",
          "carriedDaysExpiryMonthDay": "carriedDaysExpiryMonthDay"
        }
      },
      "negativeBalanceBehaviorByEmploymentType": {
        "EMPLOYEE": "BLOCK"
      }
    }
  ],
  "defaultTimeOffPolicies": [
    "defaultTimeOffPolicies"
  ],
  "associatedUserIdsByPolicyId": {
    "associatedUserIdsByPolicyId": [
      "associatedUserIdsByPolicyId"
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.getthera.com/companies/companyId/timeoff-policies"

headers = {"X-Thera-API-Key": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://api.getthera.com/companies/companyId/timeoff-policies';
const options = {method: 'GET', headers: {'X-Thera-API-Key': '<apiKey>'}};

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.getthera.com/companies/companyId/timeoff-policies"

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

	req.Header.Add("X-Thera-API-Key", "<apiKey>")

	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.getthera.com/companies/companyId/timeoff-policies")

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

request = Net::HTTP::Get.new(url)
request["X-Thera-API-Key"] = '<apiKey>'

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.getthera.com/companies/companyId/timeoff-policies")
  .header("X-Thera-API-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getthera.com/companies/companyId/timeoff-policies', [
  'headers' => [
    'X-Thera-API-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.getthera.com/companies/companyId/timeoff-policies");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Thera-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Thera-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getthera.com/companies/companyId/timeoff-policies")! 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()
```