Save the CRM module configuration (tenant:crm:admin or tenant:settings:write)
PUT /api/crm/v1/config
Module: CRM · operationId: saveCrmConfig · Tag: Configuration · Auth: access token (Authorization: Bearer <accessToken>)
Replaces the CRM settings: fields left out get their default. The NFON phone book
settings stay as they are; invalid custom field definitions are refused with 400
(invalid_custom_fields); a nfon object in the body is ignored (use saveNfonConfig).
Request body
application/json (required)
active(boolean): Marks the CRM module as set up for the tenant (getCrmConfigStatus); the API does not refuse requests of an inactive module.customFields(object): The tenant's own fields of leads and opportunities.lead(array of CustomFieldDef): Fields of leads.key(string, required): Lower-case letters, digits,-or_.kind(string, required): Field type. (one oftext,longtext,number,date,datetime,bool,select,multiselect,user,url)label(string, required): Label shown in forms.options(array of object): Choices ofselectandmultiselectfields (required there).label(string, required): Label shown in forms.value(string, required): Stored value.color(string): Display colour.
required(boolean): A value is required on write. (defaultfalse)
opportunity(array of CustomFieldDef): Fields of opportunities.key(string, required): Lower-case letters, digits,-or_.kind(string, required): Field type. (one oftext,longtext,number,date,datetime,bool,select,multiselect,user,url)label(string, required): Label shown in forms.options(array of object): Choices ofselectandmultiselectfields (required there).label(string, required): Label shown in forms.value(string, required): Stored value.color(string): Display colour.
required(boolean): A value is required on write. (defaultfalse)
defaultLeadSource(string): Source of new leads created without one. (default"MANUAL"; max length 64)leadAutoScoring(boolean): New leads without ascoreget the data quality score;false: 0. (defaulttrue)leadRetentionMonths(integer): Months after which a daily job anonymisesLOSTleads andNEW/CONTACTEDleads without change or activity (see Model); 0 is off. (default0; max 120)vatCheckEnabled(boolean):falsemakesvalidateVatIdanswer409(vat_check_disabled). (defaulttrue)
Example:
{
"active": true,
"customFields": {
"lead": [
{
"key": "branche",
"kind": "text",
"label": "Branche"
}
],
"opportunity": []
},
"defaultLeadSource": "MANUAL",
"leadAutoScoring": true,
"leadRetentionMonths": 24,
"vatCheckEnabled": true
}
Responses
- 200 Saved (
application/json) - 400 Invalid input (
invalid):fieldnames the first invalid field,details.fieldsevery one (JSON paths for bodies, parameter names for the query). Some refusals have their own code (invalid_sort,invalid_stages,invalid_custom_fields,convert_target_required,invalid_csv, …). (application/json) - 401 Missing, invalid or expired token (no body).
- 403 The token lacks the permission (
insufficient permissions) or has no active tenant. (application/json) - 500 Unexpected error; details are only logged. (
application/json)
Fields of the 200 answer:
status(string): (one ofsaved)
Example 200 answer:
{
"status": "saved"
}
Example request
curl -X PUT 'https://api.mbcom.cloud/api/crm/v1/config' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"active":true,"customFields":{"lead":[{"key":"branche","kind":"text","label":"Branche"}],"opportunity":[]},"defaultLeadSource":"MANUAL","leadAutoScoring":true,"leadRetentionMonths":24,"vatCheckEnabled":true}'