Skip to main content
See also: Offers concept and configuration for what this API powers, when to call it, and how it is configured.
Actions page showing offers in the Studio module

The Actions page where offers are managed.

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


List 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

Response 200

Error codes


Create an offer

Creates a new Offer. Triggers auto-assembly on any active Decision Flows.

Request body

Setting mandatory to true requires the admin role and all three governance fields: mandatoryReason, mandatoryExpiresAt, and mandatoryApprovedBy. Server-side validations enforce:
  • mandatoryExpiresAt must parse to a valid date and be strictly in the future (creates fail with 400 otherwise).
  • mandatoryApprovedBy must reference a real user in the same tenant.
  • That user must have role admin (rejecting attempts to set non-admin approvers).

Example request

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


Update an offer

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:
Updates enforce the same guards as creates. Turning an offer mandatory via PUT runs the identical governance validation as POSTmandatoryReason, mandatoryExpiresAt (must parse and be strictly in the future), and mandatoryApprovedBy (must be a real admin in the same tenant). You cannot slip a mandatory-override through the update path. Likewise, categoryId / subCategoryId are validated to belong to your tenant — an unknown or cross-tenant id is rejected with 400, not silently linked.

Example request

Response 200

Returns the updated offer object with the incremented version.

Error codes


Delete an offer (soft-delete)

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

Response 200

The cascaded field indicates how many child creatives were also soft-deleted.

Error codes

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.

Single-offer path endpoints

In addition to the collection routes above, each offer is addressable directly by id (or name) at /api/v1/offers/{id}. These path endpoints behave differently from the collection routes in a few important ways, noted below.
There is no POST or PATCH on this path. The {id} segment accepts either the offer UUID or its name.

GET /api/v1/offers/{id}

Returns the bare offer object. Unlike the list endpoint, the response does not include the creatives, categoryRef, or subCategoryRef relations. Returns 404 if no matching, non-deleted offer exists in your tenant. Minimum role viewer.

PUT /api/v1/offers/{id}

Updates a single offer. Only these columns are accepted (any other field in the body is ignored): name, description, shortDesc, priority, status, categoryId, subCategoryId, category, group, productType, businessValue, margin, revenueValue, emergencyExcluded, eligibility, budget, schedule, tags, metadata.
This path cannot set an offer mandatory — the mandatory, mandatoryReason, mandatoryExpiresAt, and mandatoryApprovedBy fields are not in the accepted set and are silently ignored. Use the collection PUT /api/v1/offers (with id in the body) to run the mandatory-override governance path. This path also does not increment the version field.
categoryId / subCategoryId are validated to belong to your tenant (400 otherwise). Returns the updated offer object. Minimum role editor.
Unlike the collection routes, this path does not enforce a JSON Content-Type header, so it returns 400 Invalid JSON (not 415) for a malformed or non-JSON body.

DELETE /api/v1/offers/{id}

Soft-deletes a single offer by setting its deletedAt timestamp. Unlike the collection DELETE, this path does not cascade to child creatives and does not increment the version field.
Returns 404 if no matching, non-deleted offer exists. Minimum role editor.

Role requirements

Offers

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