Skip to main content
POST
JavaScript

Authorizations

X-API-KEY
string
header
required

Headers

Tenant-ID
string

The tenant identifier for multi-tenant organisations. Required when the organisation has multi-tenancy enabled. Pass your own internal customer ID for the tenant. Ignored for single-tenant organisations.

Path Parameters

systemId
string<uuid>
required

The UUID of the points system.

Body

application/json
Required array length: 1 - 100 elements
type
enum<string>
required

The type of trigger.

Available options:
metric,
achievement,
streak,
time,
user_creation
Example:

"metric"

points
integer
required

The number of points to award or deduct when the trigger fires. Cannot be zero.

Example:

10

status
enum<string>
default:inactive

The status of the trigger. Defaults to 'inactive'.

Available options:
active,
inactive
Example:

"inactive"

userAttributes
object[] | null

Optional user attribute filters for the trigger.

metricId
string<uuid>

Required if type is metric. The UUID of the metric.

metricThreshold
integer

Required if type is metric. The metric increment that triggers the points.

Required range: x >= 1
eventAttributes
object[] | null

Optional event attribute filters. Only permitted if type is metric.

achievementId
string<uuid>

Required if type is achievement. The UUID of the achievement.

streakLength
integer

Required if type is streak. The number of streak periods that triggers the points.

Required range: x >= 1
timeUnit
enum<string>

Required if type is time. The unit for the time interval.

Available options:
hours,
days
timeInterval
integer

Required if type is time. The number of time units between recurring awards.

Required range: x >= 1
blockIfOutOfPoints
boolean
default:false

Whether to block metric events that would reduce the user's points below zero. Defaults to false.

Response

Request was valid but no triggers were created (all items had issues).

Response containing created triggers and any per-item issues.

created
AdminPointsTrigger · object[]
required

Array of successfully created triggers.

issues
AdminIssue · object[]
required

Array of issues encountered during trigger creation.