> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Melso MCP: https://mcp.melso.ai/mcp (OAuth; one company per connection). Documentation-search MCP: https://docs.melso.ai/mcp; it does not act on customer accounts. Melso API: https://api.melso.ai/v1, with a company API key or a partner key (early access); invoicing is live and the other operations are marked beta.
>
> Use the live tool list and respect company membership. Ask the person to approve the exact invoice or tax return version in the signed-in app. Melso's professionals prepare and file included returns after approval; an AI assistant does not file. A prepared file or an approval is not evidence of filing: only the AEAT's reference and receipt are. Keep credentials out of chat and logs.

# Acting for your companies

> Call any Melso API endpoint for one of your companies with your partner key: the company's id goes in the path.

> [!NOTE]
>
> **Early access.** Your firm's owner or an admin creates partner keys in the Melso console, under **Settings** › **Developers**.

Your partner key works in every company of your firm. To act for one of them,
call the [Melso API](https://docs.melso.ai/api/overview.md) with your partner key and put that
company's `id` in the path. There is no other parameter and no second set of
endpoints: the reference is the same for a company and for you.

```bash theme={null}
curl https://api.melso.ai/v1/companies/$COMPANY_ID/fiscal-profile \
  -H "Authorization: Bearer $MELSO_PARTNER_KEY"
```

The same call with a company's own key works only in that company.

## Find your companies

[List companies](https://docs.melso.ai/api/reference/companies/list-companies.md) answers every
company of your firm, newest first. Each one carries your `external_id`.

```bash theme={null}
curl https://api.melso.ai/v1/companies \
  -H "Authorization: Bearer $MELSO_PARTNER_KEY"
```

Store each company's `id` beside your own record when you
[create it](https://docs.melso.ai/api/partner/reference/create-company.md), so you rarely need to list.

## Permissions

Each key has only the permissions chosen when it was created. A call without
the permission it needs answers `403` `missing_permission` and names it in
`permission`. Each `:write` includes its `:read`.

| Permission | Endpoints |
| - | - |
| `companies:read`, `companies:write` | [Create a company](https://docs.melso.ai/api/partner/reference/create-company.md) and [list companies](https://docs.melso.ai/api/reference/companies/list-companies.md) |
| `incorporations:read`, `incorporations:write` | [Incorporations](https://docs.melso.ai/api/partner/reference/list-incorporations.md) and identity verifications |
| `fiscal_profile:read`, `fiscal_profile:write` | [Fiscal profile](https://docs.melso.ai/api/reference/fiscal-profile/get-fiscal-profile.md) |
| `certificates:read`, `certificates:write` | [Digital certificate](https://docs.melso.ai/api/reference/digital-certificate/get-certificate.md) |
| `books:read`, `books:write` | [Expenses](https://docs.melso.ai/api/reference/expenses/create-expense.md), [income](https://docs.melso.ai/api/reference/income/create-income.md), [documents](https://docs.melso.ai/api/reference/documents/upload-document.md) and [VAT book imports](https://docs.melso.ai/api/reference/vat-book-imports/create-book-import.md) |
| `invoicing:read`, `invoicing:write` | [Customers](https://docs.melso.ai/api/reference/customers/list-customers.md) and [invoices](https://docs.melso.ai/api/reference/invoices/list-invoices.md). A partner key keeps customers and drafts; issuing and voiding stay with the company. |
| `taxes:read`, `taxes:write` | [Tax returns](https://docs.melso.ai/api/reference/tax-returns/list-tax-returns.md), and [approving them](https://docs.melso.ai/api/partner/guides/approvals.md) where your firm has delegated approval |
| `payroll:read`, `payroll:write` | [Payroll](https://docs.melso.ai/api/reference/payroll-runs/list-payroll-runs.md): settings, employees, contracts, runs, payslips, Social Security, leaves and strikes |
| `webhooks:read`, `webhooks:write` | [Webhook endpoints](https://docs.melso.ai/api/partner/reference/create-webhook-endpoint.md) and [events](https://docs.melso.ai/api/partner/reference/list-events.md) |

## What only a person of the company does

Melso never acts on a company's behalf where the law asks for its consent:

* **Approving a tax return.** A person of the company approves its exact
  version, [in your product](https://docs.melso.ai/api/partner/guides/approvals.md) or on a Melso page.
  Melso's professionals then file it.
* **Signing before a notary**, for an [S.L. incorporation](https://docs.melso.ai/api/partner/guides/incorporation.md).
* **Verifying their identity**, for an [incorporation](https://docs.melso.ai/api/partner/guides/identity.md).

## Errors

| Status | `code` | Meaning |
| - | - | - |
| `403` | `missing_permission` | The key lacks the permission named in `permission`. |
| `404` | `not_found` | The company is not your firm's, or the object does not exist in it. |

See [Limits and errors](https://docs.melso.ai/api/partner/limits.md) for the rest.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.