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.

Outcome types define the vocabulary of customer responses in the platform. Each outcome type has a classification (positive, negative, or neutral) and a category (impression or response). System-default outcome types are auto-seeded on first access. All outcome types 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 Outcome Types feature page for UI guidance and conceptual overview.

Base path

/api/v1/outcome-types

List outcome types

GET /api/v1/outcome-types
Returns all outcome types for the current tenant, ordered by ordinal (ascending). If no outcome types exist, the system defaults are automatically seeded. By default, soft-deleted outcome types are excluded.

Query parameters

ParameterRequiredTypeDescription
includeDeletedNostringSet to "true" to include soft-deleted outcome types in the results.

System defaults

KeyNameClassificationCategory
impressionImpressionneutralimpression
clickClickpositiveresponse
dismissDismissnegativeresponse
acceptAcceptpositiveresponse
convertConvertpositiveresponse
not_presentedNot Presentedneutralimpression
requested_infoRequested More Infopositiveresponse
not_interestedNot Interestednegativeresponse
expiredExpiredneutralimpression
deferredDeferredneutralresponse

Response 200

Returns a flat array (not paginated) of all outcome types.
[
  {
    "id": "ot_001",
    "tenantId": "t_001",
    "key": "click",
    "name": "Click",
    "description": "",
    "classification": "positive",
    "category": "response",
    "isSystem": true,
    "ordinal": 1,
    "status": "active",
    "version": 1,
    "deletedAt": null,
    "createdAt": "2026-03-10T12:00:00.000Z",
    "updatedAt": "2026-03-10T12:00:00.000Z"
  }
]

Error codes

CodeReason
401Missing or invalid API key / session.
403Insufficient role.

Create an outcome type

POST /api/v1/outcome-types
Creates a custom outcome type. Custom types have isSystem: false and can be fully edited or deleted.

Request body

FieldRequiredTypeDescription
keyYesstring (1-255)Unique key identifier (e.g., "purchased", "bounced").
nameYesstring (1-255)Display name.
descriptionNostringDescription. Default "".
classificationNoenumpositive, negative, neutral. Default "neutral".
categoryNoenumimpression, response. Default "response".
ordinalNointeger (>= 0)Sort order. Default 99.
statusNoenumdraft, active (default), paused, archived.

Example request

{
  "key": "purchased",
  "name": "Purchased",
  "classification": "positive",
  "category": "response",
  "ordinal": 10
}

Response 201

Returns the created outcome type object with version: 1 and deletedAt: null. An audit log entry is created with a create action.

Error codes

CodeReason
400Validation error (missing key or name).
401Missing or invalid API key / session.
403Insufficient role (requires editor or admin).
415Content-Type is not application/json.

Update an outcome type

PUT /api/v1/outcome-types
Updates an existing outcome type. Only provided fields are changed. The version field is auto-incremented and a before/after audit snapshot is recorded.
System outcome types (isSystem: true) only allow editing name, description, and ordinal. The key, classification, category, and status fields are locked for system types.

Request body

FieldRequiredTypeDescription
idYesstringThe outcome type ID to update.
keyNostringUpdated key (custom types only).
nameNostringUpdated display name.
descriptionNostringUpdated description.
classificationNoenumUpdated classification (custom types only).
categoryNoenumUpdated category (custom types only).
ordinalNointegerUpdated sort order.
statusNoenumUpdated status (custom types only).

Response 200

Returns the updated outcome type object with the incremented version.

Error codes

CodeReason
400Validation error.
401Missing or invalid API key / session.
403Insufficient role.
404Outcome type not found.

Delete an outcome type (soft-delete)

DELETE /api/v1/outcome-types?id={outcomeTypeId}
Soft-deletes a custom outcome type by setting its deletedAt timestamp. System outcome types cannot be deleted.

Query parameters

ParameterRequiredTypeDescription
idYesstringOutcome type ID to delete.

Response 200

{
  "deleted": true
}

Error codes

CodeReason
400Missing id query parameter, entity not found, or entity already deleted.
401Missing or invalid API key / session.
403Cannot delete system outcome types.
404Outcome type not found.
To restore a soft-deleted outcome type, use POST /api/v1/restore?entityType=outcomeType&id={outcomeTypeId} (admin only).

Role requirements

MethodMinimum role
GETviewer
POSTeditor
PUTeditor
DELETEeditor