Update an employee
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"active": true,
"profile": {
"nif": "<string>",
"naf": "<string>",
"category": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_salary": "121.00",
"salary_type": "<string>",
"reta": true,
"administrator": true,
"tax": {}
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}"
payload = {
"name": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"active": True,
"profile": {
"nif": "<string>",
"naf": "<string>",
"category": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_salary": "121.00",
"salary_type": "<string>",
"reta": True,
"administrator": True,
"tax": {}
}
}
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({
name: '<string>',
start_date: '2023-12-25',
end_date: '2023-12-25',
active: true,
profile: {
nif: '<string>',
naf: '<string>',
category: '<string>',
group: 6,
weekly_hours: '<string>',
full_time_hours: '<string>',
annual_salary: '121.00',
salary_type: '<string>',
reta: true,
administrator: true,
tax: {}
}
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"start_date": "2023-12-25",
"active": true,
"end_date": "2023-12-25",
"settled_on": "2023-12-25",
"incomplete": [
"<string>"
],
"profile": {
"nif": "<string>",
"naf": "<string>",
"category": "<string>",
"group": 6,
"contract": "indefinido",
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_salary": "121.00",
"salary_type": "<string>",
"reta": true,
"administrator": true,
"tax": {}
}
}Employees
Update an employee
Changes an employee: only the fields sent change.
PATCH
/
companies
/
{company_id}
/
employees
/
{employee_id}
Update an employee
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"active": true,
"profile": {
"nif": "<string>",
"naf": "<string>",
"category": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_salary": "121.00",
"salary_type": "<string>",
"reta": true,
"administrator": true,
"tax": {}
}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}"
payload = {
"name": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"active": True,
"profile": {
"nif": "<string>",
"naf": "<string>",
"category": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_salary": "121.00",
"salary_type": "<string>",
"reta": True,
"administrator": True,
"tax": {}
}
}
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({
name: '<string>',
start_date: '2023-12-25',
end_date: '2023-12-25',
active: true,
profile: {
nif: '<string>',
naf: '<string>',
category: '<string>',
group: 6,
weekly_hours: '<string>',
full_time_hours: '<string>',
annual_salary: '121.00',
salary_type: '<string>',
reta: true,
administrator: true,
tax: {}
}
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"start_date": "2023-12-25",
"active": true,
"end_date": "2023-12-25",
"settled_on": "2023-12-25",
"incomplete": [
"<string>"
],
"profile": {
"nif": "<string>",
"naf": "<string>",
"category": "<string>",
"group": 6,
"contract": "indefinido",
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_salary": "121.00",
"salary_type": "<string>",
"reta": true,
"administrator": true,
"tax": {}
}
}Beta. Melso does not serve this operation yet, and its fields can still change. See what is live.
profile only the keys sent change, and tax replaces the whole modelo 145. Send active: false with end_date for a leaver.Authorizations
companyApiKeypartnerApiKey
A company API key, mk_live_…, that the company's owner creates in the
Melso app under Settings, Connect your AI, API keys. It works in that
one company with the owner's authority. Test keys (mk_test_…) are not
issued. Keep the key on your servers. See
Authentication.
Path Parameters
Body
application/json
Response
The employee.