Para agentes de IA: markdown desta página — /docs-content-en/entities/crm-card-config.md índice da documentação — /llms.txt
Os artigos da documentação estão disponíveis atualmente em inglês.
CRM card layout
Manage the field layout in CRM entity cards: leads, deals, contacts, companies, and smart processes. Lets you read the current configuration of sections and fields, overwrite it, reset it to defaults, or force the common layout on all employees. A layout has no separate numeric id: it is addressed by a set of values — object type entityTypeId, scope scope, employee userId, and qualifiers extras.
Bitrix24 API: crm.item.details.configuration.*
Scope: crm
Get card layout
GET /v1/crm/card-config/:entityTypeId
Returns the current layout of card sections and fields for the given CRM object type and scope. The response contains an array of sections, or null if no explicit configuration exists yet.
Path parameter
| Parameter | Type | Description |
|---|---|---|
entityTypeId |
number | CRM object type:1 — lead2 — deal3 — contact4 — company7 — quote31 — invoicesmart process — numeric type ID from GET /v1/smart-processes, field entityTypeId |
Query parameters
| Parameter | Type | Description |
|---|---|---|
scope |
string | Layout scope: P — personal (default), C — common |
userId |
number | Employee whose personal layout to read. Defaults to the API key owner. Only meaningful with scope=P. Source: GET /v1/users |
dealCategoryId |
number | Deal pipeline, deals only (entityTypeId=2). Source: GET /v1/categories/2 |
categoryId |
number | Smart process pipeline, smart processes only. Source: GET /v1/categories/:entityTypeId |
leadCustomerType |
number | Lead type, leads only (entityTypeId=1): 1 — simple, 2 — repeat |
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/crm/card-config/2?scope=C&dealCategoryId=9" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/crm/card-config/2?scope=C&dealCategoryId=9" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/crm/card-config/2?scope=C&dealCategoryId=9', {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { success, data } = await res.json()
if (data === null) {
console.log('No explicit layout — the default layout is used')
} else {
console.log('Sections in the layout:', data.length)
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/crm/card-config/2?scope=C&dealCategoryId=9', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data |
array | null | Array of layout sections. null — no explicit configuration exists yet |
data[].name |
string | Internal section name |
data[].title |
string | Displayed section title |
data[].type |
string | Always section |
data[].elements |
array | Section fields in display order |
data[].elements[].name |
string | CRM field name in Bitrix24 format |
data[].elements[].optionFlags |
string | Field flag: "0" — regular, "1" — customer field |
data[].elements[].options |
object | Options of a specific field, if set |
Response example
Layout set explicitly:
{
"success": true,
"data": [
{
"name": "main",
"title": "About the deal",
"type": "section",
"elements": [
{ "name": "TITLE", "optionFlags": "0" },
{ "name": "STAGE_ID", "optionFlags": "0" },
{ "name": "OPPORTUNITY_WITH_CURRENCY", "optionFlags": "0" }
]
}
]
}
No explicit configuration for the scope yet:
{
"success": true,
"data": null
}
Error response example
400 — invalid scope value:
{
"success": false,
"error": {
"code": "INVALID_SCOPE",
"message": "scope must be \"P\" (personal) or \"C\" (common)."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_ENTITY_TYPE_ID |
entityTypeId in the path is not a positive integer |
| 400 | INVALID_SCOPE |
scope is not P or C |
| 400 | INVALID_USER_ID |
userId is not a positive integer |
| 400 | INVALID_DEAL_CATEGORY_ID |
dealCategoryId is not a positive integer |
| 400 | INVALID_CATEGORY_ID |
categoryId is not a positive integer |
| 400 | INVALID_LEAD_CUSTOMER_TYPE |
leadCustomerType is not 1 or 2 |
| 422 | BITRIX_ERROR |
Bitrix24 did not recognize the object type — for example, for a nonexistent entityTypeId. The message is in error.message |
| 403 | SCOPE_DENIED |
The API key does not have the crm scope |
| 401 | TOKEN_MISSING |
The API key has no configured tokens |
For the full list of common API errors, see Errors.
Known specifics
data: null differs from an empty layout. null means no explicit configuration exists for the given scope yet, and the card is drawn with the built-in default layout. An empty array [] means an explicitly saved empty layout. Handle the data === null branch separately in your code.
In the response, optionFlags comes as a string. For previously saved layouts the flag value is returned as the string "0" or "1". When writing via PUT the flag is passed as a number.