Get Leave Types
curl --request GET \
--url https://api.projectcor.com/v1/company/leaves-types \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.projectcor.com/v1/company/leaves-types"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.projectcor.com/v1/company/leaves-types', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/company/leaves-types';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/company/leaves-types",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.projectcor.com/v1/company/leaves-types"
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(string(body))
}{
"total": 2,
"perPage": 20,
"page": 1,
"lastPage": 1,
"data": [
{
"id": 111,
"name": "Custom leave",
"type_code": "CODE",
"company_id": 111,
"created_at": "2024-12-06T13:02:53.000Z",
"updated_at": "2024-12-06T13:02:53.000Z",
"deleted_at": null,
"icon_name": "icon name"
},
{
"id": 12,
"name": "flexday",
"type_code": "UL12",
"company_id": null,
"created_at": "2022-09-14T12:09:10.000Z",
"updated_at": "2024-07-15T17:16:56.000Z",
"deleted_at": null,
"icon_name": "Loveseat"
}
]
}Leave Types
Get Leave Types
Retrieves a paginated list of default and custom leave types for your company. By default, responses are paginated with 20 items per page.
GET
/
company
/
leaves-types
Get Leave Types
curl --request GET \
--url https://api.projectcor.com/v1/company/leaves-types \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.projectcor.com/v1/company/leaves-types"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.projectcor.com/v1/company/leaves-types', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/company/leaves-types';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/company/leaves-types",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.projectcor.com/v1/company/leaves-types"
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(string(body))
}{
"total": 2,
"perPage": 20,
"page": 1,
"lastPage": 1,
"data": [
{
"id": 111,
"name": "Custom leave",
"type_code": "CODE",
"company_id": 111,
"created_at": "2024-12-06T13:02:53.000Z",
"updated_at": "2024-12-06T13:02:53.000Z",
"deleted_at": null,
"icon_name": "icon name"
},
{
"id": 12,
"name": "flexday",
"type_code": "UL12",
"company_id": null,
"created_at": "2022-09-14T12:09:10.000Z",
"updated_at": "2024-07-15T17:16:56.000Z",
"deleted_at": null,
"icon_name": "Loveseat"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Page number (default: 1). Set to false to disable pagination.
Number of items per page (default: 20).
Response
200 - application/json
Paginated list of leave types
Was this page helpful?
⌘I

