Skip to main content
POST
/
contract
/
v1
/
contracts
Create a contract
curl --request POST \
  --url https://api-{region}.sesametime.com/contract/v1/contracts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "employeeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "startAt": "2023-12-25",
  "endAt": "2023-12-25",
  "code": "<string>",
  "comment": "<string>",
  "jobChargeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "contractTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "agreementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "degreeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "workDayTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "socialSecurityNumber": "<string>",
  "trialPeriod": {
    "trialPeriodType": "months",
    "quantity": "6"
  },
  "cbo": "<string>",
  "remoteWork": true,
  "seniorityDate": "2023-12-25",
  "jobLevel": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "jobPositionDescription": "<string>",
  "weeklyHours": 123,
  "maxLegalWeeklyHours": 123,
  "maxLegalAnnualHours": 123,
  "percentageWorkDay": 123,
  "fte": 123,
  "workDays": [
    {
      "hour": 123
    }
  ]
}
'
import requests

url = "https://api-{region}.sesametime.com/contract/v1/contracts"

payload = {
"employeeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startAt": "2023-12-25",
"endAt": "2023-12-25",
"code": "<string>",
"comment": "<string>",
"jobChargeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agreementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"degreeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workDayTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"socialSecurityNumber": "<string>",
"trialPeriod": {
"trialPeriodType": "months",
"quantity": "6"
},
"cbo": "<string>",
"remoteWork": True,
"seniorityDate": "2023-12-25",
"jobLevel": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"jobPositionDescription": "<string>",
"weeklyHours": 123,
"maxLegalWeeklyHours": 123,
"maxLegalAnnualHours": 123,
"percentageWorkDay": 123,
"fte": 123,
"workDays": [{ "hour": 123 }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
employeeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
startAt: '2023-12-25',
endAt: '2023-12-25',
code: '<string>',
comment: '<string>',
jobChargeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contractTypeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agreementId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
degreeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
workDayTypeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
socialSecurityNumber: '<string>',
trialPeriod: {trialPeriodType: 'months', quantity: '6'},
cbo: '<string>',
remoteWork: true,
seniorityDate: '2023-12-25',
jobLevel: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
jobPositionDescription: '<string>',
weeklyHours: 123,
maxLegalWeeklyHours: 123,
maxLegalAnnualHours: 123,
percentageWorkDay: 123,
fte: 123,
workDays: [{hour: 123}]
})
};

fetch('https://api-{region}.sesametime.com/contract/v1/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://api-{region}.sesametime.com/contract/v1/contracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'employeeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'startAt' => '2023-12-25',
'endAt' => '2023-12-25',
'code' => '<string>',
'comment' => '<string>',
'jobChargeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contractTypeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agreementId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'degreeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'workDayTypeId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'socialSecurityNumber' => '<string>',
'trialPeriod' => [
'trialPeriodType' => 'months',
'quantity' => '6'
],
'cbo' => '<string>',
'remoteWork' => true,
'seniorityDate' => '2023-12-25',
'jobLevel' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'jobPositionDescription' => '<string>',
'weeklyHours' => 123,
'maxLegalWeeklyHours' => 123,
'maxLegalAnnualHours' => 123,
'percentageWorkDay' => 123,
'fte' => 123,
'workDays' => [
[
'hour' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api-{region}.sesametime.com/contract/v1/contracts"

payload := strings.NewReader("{\n \"employeeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"startAt\": \"2023-12-25\",\n \"endAt\": \"2023-12-25\",\n \"code\": \"<string>\",\n \"comment\": \"<string>\",\n \"jobChargeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractTypeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agreementId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"degreeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workDayTypeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"socialSecurityNumber\": \"<string>\",\n \"trialPeriod\": {\n \"trialPeriodType\": \"months\",\n \"quantity\": \"6\"\n },\n \"cbo\": \"<string>\",\n \"remoteWork\": true,\n \"seniorityDate\": \"2023-12-25\",\n \"jobLevel\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"jobPositionDescription\": \"<string>\",\n \"weeklyHours\": 123,\n \"maxLegalWeeklyHours\": 123,\n \"maxLegalAnnualHours\": 123,\n \"percentageWorkDay\": 123,\n \"fte\": 123,\n \"workDays\": [\n {\n \"hour\": 123\n }\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-{region}.sesametime.com/contract/v1/contracts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"employeeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"startAt\": \"2023-12-25\",\n \"endAt\": \"2023-12-25\",\n \"code\": \"<string>\",\n \"comment\": \"<string>\",\n \"jobChargeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractTypeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agreementId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"degreeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workDayTypeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"socialSecurityNumber\": \"<string>\",\n \"trialPeriod\": {\n \"trialPeriodType\": \"months\",\n \"quantity\": \"6\"\n },\n \"cbo\": \"<string>\",\n \"remoteWork\": true,\n \"seniorityDate\": \"2023-12-25\",\n \"jobLevel\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"jobPositionDescription\": \"<string>\",\n \"weeklyHours\": 123,\n \"maxLegalWeeklyHours\": 123,\n \"maxLegalAnnualHours\": 123,\n \"percentageWorkDay\": 123,\n \"fte\": 123,\n \"workDays\": [\n {\n \"hour\": 123\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-{region}.sesametime.com/contract/v1/contracts")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"employeeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"startAt\": \"2023-12-25\",\n \"endAt\": \"2023-12-25\",\n \"code\": \"<string>\",\n \"comment\": \"<string>\",\n \"jobChargeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractTypeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agreementId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"degreeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workDayTypeId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"socialSecurityNumber\": \"<string>\",\n \"trialPeriod\": {\n \"trialPeriodType\": \"months\",\n \"quantity\": \"6\"\n },\n \"cbo\": \"<string>\",\n \"remoteWork\": true,\n \"seniorityDate\": \"2023-12-25\",\n \"jobLevel\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"jobPositionDescription\": \"<string>\",\n \"weeklyHours\": 123,\n \"maxLegalWeeklyHours\": 123,\n \"maxLegalAnnualHours\": 123,\n \"percentageWorkDay\": 123,\n \"fte\": 123,\n \"workDays\": [\n {\n \"hour\": 123\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "c6bd9090-06ec-48e5-a3bc-22181cf0a6c9",
    "startAt": "2021-12-13",
    "endAt": "2022-12-13",
    "startDate": "2021-12-13",
    "endDate": "2022-12-13",
    "comment": "",
    "code": "",
    "jobChargeId": "c6bd9090-06ec-48e5-a3bc-22181cf0a6c9",
    "jobChargeName": "the name of the job charge",
    "contractTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "contractTypeName": "<string>",
    "agreementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "agreementName": "<string>",
    "degreeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "degreeName": "<string>",
    "workDayTypeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workDayTypeName": "<string>",
    "socialSecurityNumber": "<string>",
    "trialPeriodType": "<string>",
    "trialPeriodQuantity": 123,
    "seniorityDate": "2022-12-13",
    "percentageWorkDay": 123,
    "weeklyHours": 123,
    "cbo": "",
    "remoteWork": true,
    "jobLevelId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "jobLevelName": "<string>",
    "jobPositionDescription": "<string>",
    "maxLegalWeeklyHours": 123,
    "maxLegalAnnualHours": 123,
    "fte": 123,
    "workDays": [
      {
        "day": "monday",
        "hours": 8
      }
    ]
  },
  "meta": {
    "currentPage": 1,
    "lastPage": 1,
    "total": 1,
    "perPage": 1
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Contract object that needs to be created

employeeId
string<uuid>
required

The ID of the employee

startAt
string<date>
required

Start date of contract

endAt
string<date>

end date of contract

code
string

Code of the contract

comment
string

Comments

jobChargeId
string<uuid>

The ID of the job charge

contractTypeId
string<uuid>

The ID of the agreement

agreementId
string<uuid>

The ID of the agreement

degreeId
string<uuid>

The ID of the degree

workDayTypeId
string<uuid>

The ID of the work type

socialSecurityNumber
string

The social security number

trialPeriod
object
cbo
string
Pattern: ^\d{4}(-\d{2})?$
remoteWork
boolean

Remote work

seniorityDate
string<date>

Seniority date

jobLevel
string<uuid>

The job level

jobPositionDescription
string

The job position description

weeklyHours
number<float>

Weekly working hours

Max legal weekly working hours

Max legal annual working hours

percentageWorkDay
number<float>

Percentage of workday

fte
number<float>

The FTE value should be between 0 and 1

workDays
object[]

Response

200 - application/json
data
object
meta
object