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.

Offers are the core decisioning entity in KaireonAI. Each offer represents a recommendation that can be scored, ranked, and delivered to a customer through one or more channels. All offers support soft-delete (a deletedAt timestamp is set instead of permanent removal), version tracking (the version field auto-increments on every update), and audit logging (before/after snapshots are recorded for every CRUD operation).
See the Offers feature page for UI guidance and conceptual overview.

Base path

/api/v1/offers

List offers

GET /api/v1/offers
Returns a paginated list of offers for the current tenant, ordered by creation date (newest first). Each offer includes its creatives, category, and sub-category relations. By default, soft-deleted offers are excluded.

Query parameters

ParameterRequiredTypeDescription
limitNointegerMaximum number of results to return. Default 25.
cursorNostringCursor for keyset pagination. Pass the last id from the previous page.
includeDeletedNostringSet to "true" to include soft-deleted offers in the results.

Response 200

{
  "data": [
    {
      "id": "off_abc123",
      "tenantId": "t_001",
      "name": "Platinum Card Upgrade",
      "status": "active",
      "categoryId": "cat_01",
      "subCategoryId": "sub_01",
      "category": "acquisition",
      "group": "",
      "priority": 75,
      "businessValue": 50,
      "mandatory": false,
      "mandatoryReason": null,
      "mandatoryExpiresAt": null,
      "mandatoryApprovedBy": null,
      "emergencyExcluded": false,
      "description": "Premium card upgrade offer for high-value customers.",
      "shortDesc": "Upgrade to Platinum",
      "eligibility": {},
      "budget": { "maxPerDay": 500 },
      "schedule": {},
      "tags": ["credit-card", "premium"],
      "productType": "credit_card",
      "margin": null,
      "revenueValue": null,
      "metadata": {},
      "version": 1,
      "deletedAt": null,
      "creatives": [],
      "categoryRef": { "id": "cat_01", "name": "Acquisition" },
      "subCategoryRef": null,
      "createdAt": "2026-03-10T12:00:00.000Z",
      "updatedAt": "2026-03-12T09:30:00.000Z"
    }
  ],
  "pagination": {
    "total": 42,
    "limit": 25,
    "hasMore": true,
    "nextCursor": "off_xyz789"
  }
}

Error codes

CodeReason
401Missing or invalid API key / session.
403Insufficient role.
429Rate limit exceeded (2,000 requests / 60 s).

Create an offer

POST /api/v1/offers
Creates a new Offer. Triggers auto-assembly on any active Decision Flows.

Request body

FieldRequiredTypeDescription
nameYesstring (1-255)Unique offer name.
statusNoenumdraft (default), active, paused, archived.
categoryIdNostring | nullID of the parent category.
subCategoryIdNostring | nullID of the parent sub-category.
categoryNostringLegacy category label. Default "engagement".
groupNostringLegacy group label. Default "".
priorityNointeger (0-100)Offer priority. Default 50.
businessValueNonumber (0-100)Business value score. Default 50.
mandatoryNobooleanMark as mandatory (admin-only). Default false.
mandatoryReasonNostring | nullRequired when mandatory is true.
mandatoryExpiresAtNostring | nullISO 8601 expiry. Required when mandatory is true.
mandatoryApprovedByNostring | nullApprover ID. Required when mandatory is true.
emergencyExcludedNobooleanEmergency exclusion flag. Default false.
descriptionNostringFull description.
shortDescNostringShort description for cards/lists.
eligibilityNoobjectEligibility rule config.
budgetNoobjectBudget constraints.
scheduleNoobjectScheduling config.
tagsNostring[]Free-form tags.
productTypeNostringProduct type label (e.g., "credit_card", "loan"). Used by PRIE scoring for relevance matching.
marginNonumberProfit margin value. Feeds into the Impact (I) component of PRIE scoring.
revenueValueNonumberExpected revenue value. Feeds into the Impact (I) component of PRIE scoring.
metadataNoobjectArbitrary key-value metadata.
Setting mandatory to true requires the admin role and all three governance fields: mandatoryReason, mandatoryExpiresAt, and mandatoryApprovedBy.

Example request

{
  "name": "Platinum Card Upgrade",
  "status": "draft",
  "categoryId": "cat_01",
  "priority": 75,
  "description": "Premium card upgrade for high-value customers.",
  "tags": ["credit-card", "premium"],
  "budget": { "maxPerDay": 500 }
}

Response 201

Returns the created offer object with all relations, version: 1, and deletedAt: null. An audit log entry is created with a create action.

Error codes

CodeReason
400Validation error (missing name, invalid fields, mandatory fields missing).
401Missing or invalid API key / session.
403Non-admin trying to create mandatory offer.
409An offer with that name already exists.
415Content-Type is not application/json.

Update an offer

PUT /api/v1/offers
Updates an existing offer. Only provided fields are changed. Triggers auto-assembly on status transitions. The version field is auto-incremented and a before/after audit snapshot is recorded.

Request body

All fields from the create schema are accepted as optional, plus:
FieldRequiredTypeDescription
idYesstringThe offer ID to update.

Example request

{
  "id": "off_abc123",
  "status": "active",
  "priority": 90
}

Response 200

Returns the updated offer object with the incremented version.

Error codes

CodeReason
400Validation error.
401Missing or invalid API key / session.
403Non-admin trying to set mandatory.
409Name conflict.

Delete an offer (soft-delete)

DELETE /api/v1/offers?id={offerId}
Soft-deletes an offer by setting its deletedAt timestamp. Cascade behavior: all associated creatives are also soft-deleted. The version is incremented on the offer and each cascaded creative. An audit log entry is recorded for every affected entity.

Query parameters

ParameterRequiredTypeDescription
idYesstringOffer ID to delete.

Response 200

{
  "success": true,
  "id": "off_abc123",
  "cascaded": 3
}
The cascaded field indicates how many child creatives were also soft-deleted.

Error codes

CodeReason
400Missing id query parameter, entity not found, or entity already deleted.
401Missing or invalid API key / session.
403Insufficient role.
To restore a soft-deleted offer, use POST /api/v1/restore?entityType=offer&id={offerId} (admin only). Restoring an offer does not automatically restore cascaded creatives — you must restore them individually.

Role requirements

MethodMinimum role
GETviewer
POSTeditor
PUTeditor
DELETEeditor

Offers

Learn more about creating and managing offers in the platform UI.