curl --request PATCH \
--url https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john.smith.updated@example.com",
"name": "John",
"surname": "Smith",
"birthDate": "1985-07-15",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-01-10",
"taxRegime": "general",
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
},
"internalId": "EMP-1234",
"costCenter": "Finance",
"payrollCompany": "Main Branch",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
}
}
'import requests
url = "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}"
payload = {
"email": "john.smith.updated@example.com",
"name": "John",
"surname": "Smith",
"birthDate": "1985-07-15",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-01-10",
"taxRegime": "general",
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
},
"internalId": "EMP-1234",
"costCenter": "Finance",
"payrollCompany": "Main Branch",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john.smith.updated@example.com',
name: 'John',
surname: 'Smith',
birthDate: '1985-07-15',
grossSalary: {amountInCents: 4500000, currency: 'EUR'},
hiringDate: '2023-01-10',
taxRegime: 'general',
workdayConfiguration: {
daysPerMonth: 22,
workTimePercentage: 100,
numberOfPaychecks: 14,
collectiveAgreementSalary: {amountInCents: 3800000, currency: 'EUR'}
},
internalId: 'EMP-1234',
costCenter: 'Finance',
payrollCompany: 'Main Branch',
metadata: {department: 'Finance', manager: 'Jane Doe', office: 'Madrid'}
})
};
fetch('https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}', 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://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john.smith.updated@example.com',
'name' => 'John',
'surname' => 'Smith',
'birthDate' => '1985-07-15',
'grossSalary' => [
'amountInCents' => 4500000,
'currency' => 'EUR'
],
'hiringDate' => '2023-01-10',
'taxRegime' => 'general',
'workdayConfiguration' => [
'daysPerMonth' => 22,
'workTimePercentage' => 100,
'numberOfPaychecks' => 14,
'collectiveAgreementSalary' => [
'amountInCents' => 3800000,
'currency' => 'EUR'
]
],
'internalId' => 'EMP-1234',
'costCenter' => 'Finance',
'payrollCompany' => 'Main Branch',
'metadata' => [
'department' => 'Finance',
'manager' => 'Jane Doe',
'office' => 'Madrid'
]
]),
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://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}"
payload := strings.NewReader("{\n \"email\": \"john.smith.updated@example.com\",\n \"name\": \"John\",\n \"surname\": \"Smith\",\n \"birthDate\": \"1985-07-15\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-01-10\",\n \"taxRegime\": \"general\",\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n },\n \"internalId\": \"EMP-1234\",\n \"costCenter\": \"Finance\",\n \"payrollCompany\": \"Main Branch\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john.smith.updated@example.com\",\n \"name\": \"John\",\n \"surname\": \"Smith\",\n \"birthDate\": \"1985-07-15\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-01-10\",\n \"taxRegime\": \"general\",\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n },\n \"internalId\": \"EMP-1234\",\n \"costCenter\": \"Finance\",\n \"payrollCompany\": \"Main Branch\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john.smith.updated@example.com\",\n \"name\": \"John\",\n \"surname\": \"Smith\",\n \"birthDate\": \"1985-07-15\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-01-10\",\n \"taxRegime\": \"general\",\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n },\n \"internalId\": \"EMP-1234\",\n \"costCenter\": \"Finance\",\n \"payrollCompany\": \"Main Branch\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Employee not found"
}{
"message": "Internal server error"
}Update employee
This endpoint allows you to update an existing employee’s information in the Cobee system. All fields in the request body are optional, so you only need to include the fields you want to update.
curl --request PATCH \
--url https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "john.smith.updated@example.com",
"name": "John",
"surname": "Smith",
"birthDate": "1985-07-15",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-01-10",
"taxRegime": "general",
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
},
"internalId": "EMP-1234",
"costCenter": "Finance",
"payrollCompany": "Main Branch",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
}
}
'import requests
url = "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}"
payload = {
"email": "john.smith.updated@example.com",
"name": "John",
"surname": "Smith",
"birthDate": "1985-07-15",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-01-10",
"taxRegime": "general",
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
},
"internalId": "EMP-1234",
"costCenter": "Finance",
"payrollCompany": "Main Branch",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john.smith.updated@example.com',
name: 'John',
surname: 'Smith',
birthDate: '1985-07-15',
grossSalary: {amountInCents: 4500000, currency: 'EUR'},
hiringDate: '2023-01-10',
taxRegime: 'general',
workdayConfiguration: {
daysPerMonth: 22,
workTimePercentage: 100,
numberOfPaychecks: 14,
collectiveAgreementSalary: {amountInCents: 3800000, currency: 'EUR'}
},
internalId: 'EMP-1234',
costCenter: 'Finance',
payrollCompany: 'Main Branch',
metadata: {department: 'Finance', manager: 'Jane Doe', office: 'Madrid'}
})
};
fetch('https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}', 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://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john.smith.updated@example.com',
'name' => 'John',
'surname' => 'Smith',
'birthDate' => '1985-07-15',
'grossSalary' => [
'amountInCents' => 4500000,
'currency' => 'EUR'
],
'hiringDate' => '2023-01-10',
'taxRegime' => 'general',
'workdayConfiguration' => [
'daysPerMonth' => 22,
'workTimePercentage' => 100,
'numberOfPaychecks' => 14,
'collectiveAgreementSalary' => [
'amountInCents' => 3800000,
'currency' => 'EUR'
]
],
'internalId' => 'EMP-1234',
'costCenter' => 'Finance',
'payrollCompany' => 'Main Branch',
'metadata' => [
'department' => 'Finance',
'manager' => 'Jane Doe',
'office' => 'Madrid'
]
]),
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://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}"
payload := strings.NewReader("{\n \"email\": \"john.smith.updated@example.com\",\n \"name\": \"John\",\n \"surname\": \"Smith\",\n \"birthDate\": \"1985-07-15\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-01-10\",\n \"taxRegime\": \"general\",\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n },\n \"internalId\": \"EMP-1234\",\n \"costCenter\": \"Finance\",\n \"payrollCompany\": \"Main Branch\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john.smith.updated@example.com\",\n \"name\": \"John\",\n \"surname\": \"Smith\",\n \"birthDate\": \"1985-07-15\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-01-10\",\n \"taxRegime\": \"general\",\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n },\n \"internalId\": \"EMP-1234\",\n \"costCenter\": \"Finance\",\n \"payrollCompany\": \"Main Branch\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john.smith.updated@example.com\",\n \"name\": \"John\",\n \"surname\": \"Smith\",\n \"birthDate\": \"1985-07-15\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-01-10\",\n \"taxRegime\": \"general\",\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n },\n \"internalId\": \"EMP-1234\",\n \"costCenter\": \"Finance\",\n \"payrollCompany\": \"Main Branch\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Employee not found"
}{
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the company
The unique identifier of the employee
Body
Employee data to be updated
The employee's email address
The employee's legal identifier
The employee's first name
The employee's surname
The employee's date of birth in ISO 8601 format (YYYY-MM-DD)
The employee's gross salary details
Show child attributes
Show child attributes
{
"amountInCents": 4500000,
"currency": "EUR"
}
The date when the employee was hired in ISO 8601 format (YYYY-MM-DD)
The employee's tax regime
general, basque, navarrese, biscayan Configuration of the employee's workday
Show child attributes
Show child attributes
{
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
}
Your internal identifier for the employee
The cost centre associated with this employee
The company handling the employee's payroll, if different from the main company
Additional metadata for the employee (key-value pairs)
The Single Sign-On internal identifier for the employee
Response
Employee successfully updated