beel_upsert_custom_field
Create or update a company custom field by key, keeping existing archive and suggestion settings when omitted. Repeat calls safely to seed a catalogue without undoing manual changes.
Instructions
Creates the custom field with this key, or updates it if the company already has one.
Repeating the request leaves the same state, so it is safe to run on every deployment to
seed a catalogue.
Status:
201when the field is created,200when it already existed.Key: it is the path, never the body, and it never changes. To stop using a field, archive it (
is_archived: true); fields are never deleted.Archive state: omitting
is_archivedkeeps the current one, so repeating the request never reactivates a field someone archived.Suggestions: omitting
suggest_valueskeeps the current setting; a new field starts withtrue. Usefalsefor a value that changes on every invoice, such as an order number: invoices store the text as sent and no options are created. Turning it off deletes no option, and turning it back on offers them again.Options: the response carries the common options of the field, or none when
suggest_valuesisfalse.
BeeL API endpoint: PUT /v1/companies/{company_id}/custom-fields/{key} (reference: https://docs.beel.es)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"company_id": "<company_id>",
"key": "<key>",
"body": "<body>"
},
"name": "beel_upsert_custom_field"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. | |
| body | Yes | ||
| company_id | Yes | Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. |