curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}/contracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "initial",
"start_date": "2026-12-01",
"code": "100",
"account": "acc_1",
"occupation": "5120",
"position": "Cocinera",
"group": 7,
"weekly_hours": "40",
"full_time_hours": "40"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}/contracts"
payload = {
"event": "initial",
"start_date": "2026-12-01",
"code": "100",
"account": "acc_1",
"occupation": "5120",
"position": "Cocinera",
"group": 7,
"weekly_hours": "40",
"full_time_hours": "40"
}
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({
event: 'initial',
start_date: '2026-12-01',
code: '100',
account: 'acc_1',
occupation: '5120',
position: 'Cocinera',
group: 7,
weekly_hours: '40',
full_time_hours: '40'
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}/contracts', 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"
}Create a contract
Registers an employee’s contract, extension or conversion.
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}/contracts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "initial",
"start_date": "2026-12-01",
"code": "100",
"account": "acc_1",
"occupation": "5120",
"position": "Cocinera",
"group": 7,
"weekly_hours": "40",
"full_time_hours": "40"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}/contracts"
payload = {
"event": "initial",
"start_date": "2026-12-01",
"code": "100",
"account": "acc_1",
"occupation": "5120",
"position": "Cocinera",
"group": 7,
"weekly_hours": "40",
"full_time_hours": "40"
}
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({
event: 'initial',
start_date: '2026-12-01',
code: '100',
account: 'acc_1',
occupation: '5120',
position: 'Cocinera',
group: 7,
weekly_hours: '40',
full_time_hours: '40'
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/employees/{employee_id}/contracts', 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"
}Authorizations
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.
Headers
A unique key of yours, such as a UUID, that makes a retried create
safe. For 24 hours a retry with the same key and body gets the first
answer again, with Idempotent-Replayed: true. The same key with
another body answers 422 idempotency_key_reused; while the first
request runs, 409 idempotency_key_in_use. A 5xx answer is not
kept, so its retry runs again. See Conventions.
255Path Parameters
Body
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.