curl --request POST \
--url https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"newCompanyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"legalId": "<string>",
"name": "<string>",
"surname": "<string>",
"birthDate": "2023-12-25",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-12-25",
"internalId": "<string>",
"costCenter": "<string>",
"payrollCompany": "<string>",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
},
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
}
}
'import requests
url = "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate"
payload = {
"newCompanyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"legalId": "<string>",
"name": "<string>",
"surname": "<string>",
"birthDate": "2023-12-25",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-12-25",
"internalId": "<string>",
"costCenter": "<string>",
"payrollCompany": "<string>",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
},
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
}
}
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({
newCompanyId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
email: 'jsmith@example.com',
legalId: '<string>',
name: '<string>',
surname: '<string>',
birthDate: '2023-12-25',
grossSalary: {amountInCents: 4500000, currency: 'EUR'},
hiringDate: '2023-12-25',
internalId: '<string>',
costCenter: '<string>',
payrollCompany: '<string>',
metadata: {department: 'Finance', manager: 'Jane Doe', office: 'Madrid'},
workdayConfiguration: {
daysPerMonth: 22,
workTimePercentage: 100,
numberOfPaychecks: 14,
collectiveAgreementSalary: {amountInCents: 3800000, currency: 'EUR'}
}
})
};
fetch('https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate', 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}/migrate",
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([
'newCompanyId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'email' => 'jsmith@example.com',
'legalId' => '<string>',
'name' => '<string>',
'surname' => '<string>',
'birthDate' => '2023-12-25',
'grossSalary' => [
'amountInCents' => 4500000,
'currency' => 'EUR'
],
'hiringDate' => '2023-12-25',
'internalId' => '<string>',
'costCenter' => '<string>',
'payrollCompany' => '<string>',
'metadata' => [
'department' => 'Finance',
'manager' => 'Jane Doe',
'office' => 'Madrid'
],
'workdayConfiguration' => [
'daysPerMonth' => 22,
'workTimePercentage' => 100,
'numberOfPaychecks' => 14,
'collectiveAgreementSalary' => [
'amountInCents' => 3800000,
'currency' => 'EUR'
]
]
]),
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}/migrate"
payload := strings.NewReader("{\n \"newCompanyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"legalId\": \"<string>\",\n \"name\": \"<string>\",\n \"surname\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-12-25\",\n \"internalId\": \"<string>\",\n \"costCenter\": \"<string>\",\n \"payrollCompany\": \"<string>\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n },\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\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://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"newCompanyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"legalId\": \"<string>\",\n \"name\": \"<string>\",\n \"surname\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-12-25\",\n \"internalId\": \"<string>\",\n \"costCenter\": \"<string>\",\n \"payrollCompany\": \"<string>\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n },\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate")
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 \"newCompanyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"legalId\": \"<string>\",\n \"name\": \"<string>\",\n \"surname\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-12-25\",\n \"internalId\": \"<string>\",\n \"costCenter\": \"<string>\",\n \"payrollCompany\": \"<string>\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n },\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"message": "Employee not found"
}{
"message": "employee conflict"
}{
"message": "Internal server error"
}Migrate employee
curl --request POST \
--url https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"newCompanyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"legalId": "<string>",
"name": "<string>",
"surname": "<string>",
"birthDate": "2023-12-25",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-12-25",
"internalId": "<string>",
"costCenter": "<string>",
"payrollCompany": "<string>",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
},
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
}
}
'import requests
url = "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate"
payload = {
"newCompanyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"legalId": "<string>",
"name": "<string>",
"surname": "<string>",
"birthDate": "2023-12-25",
"grossSalary": {
"amountInCents": 4500000,
"currency": "EUR"
},
"hiringDate": "2023-12-25",
"internalId": "<string>",
"costCenter": "<string>",
"payrollCompany": "<string>",
"metadata": {
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
},
"workdayConfiguration": {
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
}
}
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({
newCompanyId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
email: 'jsmith@example.com',
legalId: '<string>',
name: '<string>',
surname: '<string>',
birthDate: '2023-12-25',
grossSalary: {amountInCents: 4500000, currency: 'EUR'},
hiringDate: '2023-12-25',
internalId: '<string>',
costCenter: '<string>',
payrollCompany: '<string>',
metadata: {department: 'Finance', manager: 'Jane Doe', office: 'Madrid'},
workdayConfiguration: {
daysPerMonth: 22,
workTimePercentage: 100,
numberOfPaychecks: 14,
collectiveAgreementSalary: {amountInCents: 3800000, currency: 'EUR'}
}
})
};
fetch('https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate', 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}/migrate",
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([
'newCompanyId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'email' => 'jsmith@example.com',
'legalId' => '<string>',
'name' => '<string>',
'surname' => '<string>',
'birthDate' => '2023-12-25',
'grossSalary' => [
'amountInCents' => 4500000,
'currency' => 'EUR'
],
'hiringDate' => '2023-12-25',
'internalId' => '<string>',
'costCenter' => '<string>',
'payrollCompany' => '<string>',
'metadata' => [
'department' => 'Finance',
'manager' => 'Jane Doe',
'office' => 'Madrid'
],
'workdayConfiguration' => [
'daysPerMonth' => 22,
'workTimePercentage' => 100,
'numberOfPaychecks' => 14,
'collectiveAgreementSalary' => [
'amountInCents' => 3800000,
'currency' => 'EUR'
]
]
]),
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}/migrate"
payload := strings.NewReader("{\n \"newCompanyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"legalId\": \"<string>\",\n \"name\": \"<string>\",\n \"surname\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-12-25\",\n \"internalId\": \"<string>\",\n \"costCenter\": \"<string>\",\n \"payrollCompany\": \"<string>\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n },\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\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://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"newCompanyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"legalId\": \"<string>\",\n \"name\": \"<string>\",\n \"surname\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-12-25\",\n \"internalId\": \"<string>\",\n \"costCenter\": \"<string>\",\n \"payrollCompany\": \"<string>\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n },\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/migrate")
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 \"newCompanyId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"legalId\": \"<string>\",\n \"name\": \"<string>\",\n \"surname\": \"<string>\",\n \"birthDate\": \"2023-12-25\",\n \"grossSalary\": {\n \"amountInCents\": 4500000,\n \"currency\": \"EUR\"\n },\n \"hiringDate\": \"2023-12-25\",\n \"internalId\": \"<string>\",\n \"costCenter\": \"<string>\",\n \"payrollCompany\": \"<string>\",\n \"metadata\": {\n \"department\": \"Finance\",\n \"manager\": \"Jane Doe\",\n \"office\": \"Madrid\"\n },\n \"workdayConfiguration\": {\n \"daysPerMonth\": 22,\n \"workTimePercentage\": 100,\n \"numberOfPaychecks\": 14,\n \"collectiveAgreementSalary\": {\n \"amountInCents\": 3800000,\n \"currency\": \"EUR\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"message": "Employee not found"
}{
"message": "employee conflict"
}{
"message": "Internal server error"
}Overview
Migrate an employee from one company to another within the same Corporation. This will terminate the employee on the original company and will create a new one on the new company.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 needed for the new company
The id of the destination company
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 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)
{
"department": "Finance",
"manager": "Jane Doe",
"office": "Madrid"
}
Configuration of the employee's workday
Show child attributes
Show child attributes
{
"daysPerMonth": 22,
"workTimePercentage": 100,
"numberOfPaychecks": 14,
"collectiveAgreementSalary": {
"amountInCents": 3800000,
"currency": "EUR"
}
}
Response
Employee migrated successfully
The unique identifier of the employee