Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Volume constraints limit how many recommendations or deliveries can occur within a time period. They operate at three scopes:
  • Channel: Max emails/day, max push notifications/week
  • Category: Max mandatory communications/week
  • Offer: Max deliveries of a specific offer/month

List Volume Constraints

GET /api/v1/volume-constraints
Returns all volume constraints for the tenant, ordered by creation date (newest first).

Response

{
  "data": [
    {
      "id": "vc_001",
      "tenantId": "tenant_001",
      "name": "Email Campaign Daily Cap 10K",
      "scope": "channel",
      "scopeId": "ch_email",
      "maxVolume": 10000,
      "period": "daily",
      "enabled": true,
      "currentCount": 3245,
      "resetAt": "2026-03-31T00:00:00.000Z",
      "createdAt": "2026-03-15T10:00:00.000Z",
      "updatedAt": "2026-03-30T08:00:00.000Z"
    }
  ],
  "total": 3
}

Create Volume Constraint

POST /api/v1/volume-constraints

Request Body

FieldTypeRequiredDescription
namestringYesHuman-readable name
scopestringYes"offer", "category", or "channel"
scopeIdstringYesID of the scoped entity
maxVolumeintegerYesMaximum count per period (minimum: 1)
periodstringYes"daily", "weekly", or "monthly"
enabledbooleanNoDefault: true

Example

{
  "name": "Email Campaign Daily Cap 10K",
  "scope": "channel",
  "scopeId": "ch_email",
  "maxVolume": 10000,
  "period": "daily",
  "enabled": true
}

Response 201

Returns the created constraint. The currentCount starts at 0 and resetAt is auto-computed based on the period.
{
  "id": "vc_001",
  "name": "Email Campaign Daily Cap 10K",
  "scope": "channel",
  "scopeId": "ch_email",
  "maxVolume": 10000,
  "period": "daily",
  "enabled": true,
  "currentCount": 0,
  "resetAt": "2026-03-31T00:00:00.000Z"
}

Error codes

CodeReason
400Validation error or duplicate constraint (same scope, scopeId, and period).

Update Volume Constraint

PUT /api/v1/volume-constraints
Update an existing constraint. Include id in the body. Only provided fields are updated.

Request Body

FieldTypeRequiredDescription
idstringYesVolume constraint ID
namestringNoUpdated name
scopestringNoUpdated scope
scopeIdstringNoUpdated scope ID
maxVolumeintegerNoUpdated max volume
periodstringNoUpdated period (resets currentCount to 0 and recomputes resetAt)
enabledbooleanNoEnable or disable
Changing the period automatically resets the currentCount to 0 and recomputes the resetAt timestamp.

Response 200

Returns the updated constraint.

Error codes

CodeReason
400Validation error.
404Volume constraint not found (wrong ID or different tenant).

Delete Volume Constraint

DELETE /api/v1/volume-constraints?id={id}

Query Parameters

ParameterTypeRequiredDescription
idstringYesVolume constraint ID to delete

Response 204

Empty body on success.

Error codes

CodeReason
400Missing id parameter.
404Volume constraint not found.

How Volume Constraints Work

  1. When a batch run executes, each delivery increments the currentCount for matching constraints.
  2. If currentCount >= maxVolume, further deliveries for that scope are blocked.
  3. Counters reset automatically at the start of each period:
    • daily: Midnight UTC
    • weekly: Monday midnight UTC
    • monthly: First day of the month, midnight UTC
  4. Volume constraints are checked AFTER qualification and contact policy filtering.

Role requirements

MethodMinimum role
GETviewer
POSTeditor
PUTeditor
DELETEadmin

Example: Insurance Email Campaign

// Max 10,000 emails per day (budget control)
{
  "name": "Email Daily Cap",
  "scope": "channel",
  "scopeId": "email-channel-id",
  "maxVolume": 10000,
  "period": "daily"
}

// Max 5,000 mandatory communications per week
{
  "name": "Mandatory Weekly Cap",
  "scope": "category",
  "scopeId": "mandatory-category-id",
  "maxVolume": 5000,
  "period": "weekly"
}

// Max 2,000 Early Renewal offers per month
{
  "name": "Early Renewal Monthly Cap",
  "scope": "offer",
  "scopeId": "early-renewal-offer-id",
  "maxVolume": 2000,
  "period": "monthly"
}