For AI agents: markdown of this page — /docs-content-en/entities/recurring-deals/aggregate.md documentation index — /llms.txt

Aggregate

POST /v1/recurring-deals/aggregate

Uses the generic aggregation contract.

Response fields

Field Type Meaning
success boolean Success flag
data object Count, aggregates and groups under the aggregation contract

Example

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/recurring-deals/aggregate" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"aggregate":[{"field":"*","function":"count"}]}'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/recurring-deals/aggregate" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"aggregate":[{"field":"*","function":"count"}]}'

JavaScript — personal key

javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/recurring-deals/aggregate', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({"aggregate":[{"field":"*","function":"count"}]}),
})
const result = await response.json()
if (!result.success) throw new Error(result.error.message)
console.log(result.data)

JavaScript — OAuth application

javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/recurring-deals/aggregate', {
  method: 'POST',
  headers: { 'X-Api-Key': 'YOUR_APP_KEY', 'Authorization': 'Bearer USER_SESSION_TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({"aggregate":[{"field":"*","function":"count"}]}),
})
const result = await response.json()
if (!result.success) throw new Error(result.error.message)
console.log(result.data)

Errors

HTTP Code Condition
401 MISSING_API_KEY API key missing
403 SCOPE_DENIED crm scope missing
400 INVALID_PARAMS Invalid ID, enum or value shape
403 BITRIX_ACCESS_DENIED Bitrix24 refused access
422 BITRIX_ERROR Original Bitrix24 business refusal or plan limitation

System errors. Batch sub-call errors are returned within the batch result.

MCP: generic entity tools with entity: "recurring-deals"; expose uses call_api with POST and this path.

See also