Skip to main content
GET
/
directory
/
api
/
4.0
/
work-contracts
List work-contracts
curl --request GET \
  --url https://{host}/directory/api/4.0/work-contracts \
  --header 'Authorization: <authorization>'
import requests

url = "https://{host}/directory/api/4.0/work-contracts"

headers = {"Authorization": "<authorization>"}

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

print(response.text)
const options = {method: 'GET', headers: {Authorization: '<authorization>'}};

fetch('https://{host}/directory/api/4.0/work-contracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/directory/api/4.0/work-contracts",
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: <authorization>"
],
]);

$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://{host}/directory/api/4.0/work-contracts"

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

req.Header.Add("Authorization", "<authorization>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{host}/directory/api/4.0/work-contracts")
.header("Authorization", "<authorization>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{host}/directory/api/4.0/work-contracts")

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

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

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "id": 514,
      "ownerId": 416,
      "startsOn": "2021-01-01",
      "endsOn": null,
      "isApplicable": true,
      "establishmentId": 13,
      "spcId": 1,
      "typeId": 1,
      "hiringTypeId": 3,
      "terminationReasonId": null,
      "trialPeriodDays": 120,
      "renewedTrialPeriodDays": null,
      "trialPeriodEndDate": "2021-05-01",
      "trialPeriodEndDate2": null,
      "authorId": 45,
      "lastModifierId": 45,
      "createdAt": "2021-11-08T17:48:18.12",
      "lastModifiedAt": "2024-01-10T12:27:02.22"
    }
  ],
  "count": 1
}
This legacy endpoint has its equivalent in the Lucca API (currently in beta): GET /lucca-api/employments.Career data (department, manager, job title) is now tracked separately through the job-position resource.

Headers

Authorization
string
required

API key. Value must be formatted like so: lucca application={api_key}.

Query Parameters

page
integer

Index of the page to retrieve. Starts at 1.

Required range: x >= 1
limit
integer

Page size (i.e. number of items per page).

Required range: 0 <= x <= 1000
fields.root
string

Retrieve the total number of items across all pages.

Allowed value: "count"
ownerId
integer[]

Only return work-contracts whose employees' ID match one of the given.

Required range: x >= 1
isApplicable
boolean

Only return work-contracts that are considered applicable (true) or not (false). When omitted, both are returned.

isArchived
boolean

Only return archived (true) work-contracts or active (false) ones.

typeId
integer[]

Only return work-contracts which reference one of the given work-contract types IDs.

Required range: x >= 1
establishmentId
integer[]

Only return work-contracts which belong to one of the given establishments IDs.

Required range: x >= 1

Response

OK

items
work-contract · object[]
count
integer
Required range: x >= 0