Replace a contract
curl --request PUT \
--url https://api.melso.ai/v1/companies/{company_id}/contracts/{contract_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"code": "<string>",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"end_date": "2023-12-25",
"account": "<string>",
"occupation": "<string>",
"position": "<string>",
"duties": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_hours": "<string>",
"document": {}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/contracts/{contract_id}"
payload = {
"start_date": "2023-12-25",
"code": "<string>",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"end_date": "2023-12-25",
"account": "<string>",
"occupation": "<string>",
"position": "<string>",
"duties": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_hours": "<string>",
"document": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-12-25',
code: '<string>',
previous_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
end_date: '2023-12-25',
account: '<string>',
occupation: '<string>',
position: '<string>',
duties: '<string>',
group: 6,
weekly_hours: '<string>',
full_time_hours: '<string>',
annual_hours: '<string>',
document: {}
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/contracts/{contract_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"event": "initial",
"start_date": "2023-12-25",
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"end_date": "2023-12-25",
"account": "<string>",
"occupation": "<string>",
"position": "<string>",
"duties": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_hours": "<string>",
"document": {},
"contrata_status": "pending"
}Contracts
Replace a contract
Replaces a registered contract whole.
PUT
/
companies
/
{company_id}
/
contracts
/
{contract_id}
Replace a contract
curl --request PUT \
--url https://api.melso.ai/v1/companies/{company_id}/contracts/{contract_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"code": "<string>",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"end_date": "2023-12-25",
"account": "<string>",
"occupation": "<string>",
"position": "<string>",
"duties": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_hours": "<string>",
"document": {}
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/contracts/{contract_id}"
payload = {
"start_date": "2023-12-25",
"code": "<string>",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"end_date": "2023-12-25",
"account": "<string>",
"occupation": "<string>",
"position": "<string>",
"duties": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_hours": "<string>",
"document": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-12-25',
code: '<string>',
previous_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
end_date: '2023-12-25',
account: '<string>',
occupation: '<string>',
position: '<string>',
duties: '<string>',
group: 6,
weekly_hours: '<string>',
full_time_hours: '<string>',
annual_hours: '<string>',
document: {}
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/contracts/{contract_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"event": "initial",
"start_date": "2023-12-25",
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"end_date": "2023-12-25",
"account": "<string>",
"occupation": "<string>",
"position": "<string>",
"duties": "<string>",
"group": 6,
"weekly_hours": "<string>",
"full_time_hours": "<string>",
"annual_hours": "<string>",
"document": {},
"contrata_status": "pending"
}Beta. Melso does not serve this operation yet, and its fields can still change. See what is live.
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
A contract as the SEPE and the Social Security know it. Send only what the person confirmed.
Response
The contract.
A contract as the SEPE and the Social Security know it. Send only what the person confirmed.