curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/cases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "alta",
"details": {
"start_date": "2026-12-01",
"activity": "Diseño gráfico para empresas"
},
"note": "Empieza a facturar el 1 de diciembre.",
"submit": true
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/cases"
payload = {
"kind": "alta",
"details": {
"start_date": "2026-12-01",
"activity": "Diseño gráfico para empresas"
},
"note": "Empieza a facturar el 1 de diciembre.",
"submit": True
}
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({
kind: 'alta',
details: {start_date: '2026-12-01', activity: 'Diseño gráfico para empresas'},
note: 'Empieza a facturar el 1 de diciembre.',
submit: true
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/cases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "modelo",
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"deadline": "2023-12-25",
"current_version": 123,
"approved_version": 123,
"payment_url": "<string>",
"information_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"id": "<string>",
"kind": "document",
"label": "<string>"
}
]
},
"messages": [
{
"author": "company",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"url": "<string>"
}
],
"external_reference": "<string>",
"completed_on": "2023-12-25",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax service is not active for this company",
"code": "tax_service_required",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}Open a case
Opens a case of a kind from List case kinds, with details that match the kind’s schema, and sends it to Melso’s professionals when submit is true and the plan covers it.
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/cases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "alta",
"details": {
"start_date": "2026-12-01",
"activity": "Diseño gráfico para empresas"
},
"note": "Empieza a facturar el 1 de diciembre.",
"submit": true
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/cases"
payload = {
"kind": "alta",
"details": {
"start_date": "2026-12-01",
"activity": "Diseño gráfico para empresas"
},
"note": "Empieza a facturar el 1 de diciembre.",
"submit": True
}
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({
kind: 'alta',
details: {start_date: '2026-12-01', activity: 'Diseño gráfico para empresas'},
note: 'Empieza a facturar el 1 de diciembre.',
submit: true
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/cases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "modelo",
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"deadline": "2023-12-25",
"current_version": 123,
"approved_version": 123,
"payment_url": "<string>",
"information_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"id": "<string>",
"kind": "document",
"label": "<string>"
}
]
},
"messages": [
{
"author": "company",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"url": "<string>"
}
],
"external_reference": "<string>",
"completed_on": "2023-12-25",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "lines[0].vat_rate must be 21, 10, 4 or 0",
"code": "invalid_invoice",
"request_id": "req_01JAB3K9X2"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax service is not active for this company",
"code": "tax_service_required",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}payment_url.Authorizations
Your partner secret key, mk_live_… for real companies or mk_test_…
for test companies. Keep it on your servers. See
Authentication.
Headers
A unique key, such as a UUID, that makes a retried create safe. Reusing a key with a different body is refused.
255Path Parameters
The company's ID. Every company-scoped call works in exactly this company.
Body
modelo: prepare and file one AEAT form for one period (details
model, period); an empresa cannot ask for the 130, 131 or 100.
alta: register an autónomo with the AEAT and the Social Security
(details start_date, activity). renta: an autónomo's annual income
tax return, modelo 100 (details year, joint). constitucion_sl:
incorporate an S.L. or S.L.U., paid once by the owner before Melso
starts. More kinds are added over time; read them from List case kinds.
modelo, alta, renta, constitucion_sl The kind's details, as its details_schema describes them.
400020Send it to Melso at once when the plan covers it.
Response
The case.
modelo: prepare and file one AEAT form for one period (details
model, period); an empresa cannot ask for the 130, 131 or 100.
alta: register an autónomo with the AEAT and the Social Security
(details start_date, activity). renta: an autónomo's annual income
tax return, modelo 100 (details year, joint). constitucion_sl:
incorporate an S.L. or S.L.U., paid once by the owner before Melso
starts. More kinds are added over time; read them from List case kinds.
modelo, alta, renta, constitucion_sl draft: not sent yet. review: Melso's professionals are working on
it. info: they asked the company for something
(information_request). approval: a draft waits for the company's
approval. filing: approved, being filed. done: filed, with the
administration's external_reference. cancelled: withdrawn before
filing.
draft, review, info, approval, filing, done, cancelled Where the owner pays a service kind before Melso starts.
What the professionals need from the company, with the items to answer.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The professionals' drafts, the company's documents and the filing receipts.
Show child attributes
Show child attributes
The administration's reference for what was filed. Always present once done.