A Singapore Government Agency Website

GovRewards Tenant API Specifications (1.0)

Download OpenAPI specification:Download

GovRewards Tenant API Specifications

Authentication & Authorization

For all endpoints, you will need to authenticate requests using the OAuth2.0 Client Credentials Grant flow.

First, you need to obtain an access token by authenticating with the OAuth2.0 authorization server using your client credentials (client ID and client secret). This token is short-lived and must be used to sign your requests. The process involves the following steps:

1. Obtain Access Token

2. Use Access Token

  • Once you have the access token, include it in the Authorization header of your HTTP requests to the API endpoints.
  • The token should be prefixed with the type Bearer.

Example Request to Obtain Access Token

POST /oauth2/token HTTP/2
Host: apps.auth.rewards.gov.sg
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET

Example Response

{
  "access_token": "YOUR_ACCESS_TOKEN",
  "token_type": "Bearer",
  "expires_in": 3600
}

Idempotency

Idempotency ensures repeated identical requests produce the same result without causing unintended side effects. This is particularly vital for operations where network issues or client retries might lead to multiple identical requests being sent. By adhering to idempotency, our API guarantees that actions such as creating or updating resources can be performed safely multiple times without altering the final outcome beyond the first successful request. Implementing idempotency enhances the reliability, predictability, and robustness of our API, providing a consistent and dependable user experience.

Only POST endpoints which accept the header x-idempotency-key can have idempotent requests. DELETE and GET are idempotent by design so they do not require the header.

Including an x-idempotency-key header makes request idempotent. It has several properties:

  • The x-idempotency-key is required for endpoints that accepts this header.

  • Each idempotency key is valid for 24 hours.

  • The idempotency key has to be a valid UUID.

  • Calling subsequent requests with the same x-idempotency-key within the 24-hour window will return an idempotent-replayed header. These subsequent requests will not cause duplicate transactions.

  • When the idempotent-replayed header is returned, the HTTP status code of the response will match the first request's response HTTP status code.


Rate Limiting

To ensure fair use and maintain system stability, the GovRewards API implements rate limiting at the tenant level.

Rate Limit Configuration

Plan Requests per Second Time Window (TTL) Block Duration (Seconds) Description
tenant-basic 1000 1 second 5 seconds Default tenant-level throttling

Note: Additional throttlers and adjustments to the rate limits may be introduced as the platform evolves.

Response Headers for Rate Limiting

Every API response will include the following headers:

Header Description Example Value
X-RateLimit-Limit-<PLAN> The maximum number of requests allowed in the time window. Only shown when the rate limit has not been exceeded. 1000
X-RateLimit-Remaining-<PLAN> The number of requests remaining in the current window. Only shown when the rate limit has not been exceeded. 0
X-RateLimit-Reset-<PLAN> The number of seconds until the rate limit resets. Only shown when the rate limit has not been exceeded. 1
Retry-After-<PLAN> The number of seconds to wait before retrying after a block. Only shown when the rate limit has been exceeded. 5

Rate Limit Exceeded Response

If the rate limit is exceeded, the API will respond with:

HTTP Status: 429 Too Many Requests
Example Response:

{
  "error": {
    "reasonCode": "too_many_requests",
    "description": "The request failed because the rate limit for this endpoint has been exceeded.",
    "details": []
  },
  "requestId": "88fcd476-e3a2-43c1-b290-31fbdb91aebe"
}

Client-Toggled Feature Flags

Client-toggled feature flags are feature flags that can be enabled by the API client per request. This allows tenants to test and enable a new feature at their own timing. These feature flags will only be available for a period of time, after which, the feature will be enabled by default.

Usage

To enable a client-toggled feature flag, add the header x-feature-flags: feature_flag_1,feature_flag_2 to the request. If the feature flag is supported for the API endpoint, it will be added to the response header. Otherwise, it will be ignored.

For example, if feature_flag_1 and feature_flag_2 are passed in, but only feature_flag_1 is supported by the API endpoint, the response header will be x-feature-flags-enabled: feature_flag_1.

Example Request

curl --header "x-feature-flags: feature_flag_1,feature_flag_2" https://api.rewards.gov.sg/api/v1/campaigns

Example Response Header (Only feature_flag_1 is supported)

x-feature-flags-enabled: feature_flag_1

Supported Feature Flags

There are no supported client-toggled feature flags at the moment.


Error Reason Codes

Reason Codes Description
validation_error The request could not be processed due to invalid or missing parameters, or issues with the request body.
forbidden Access to the requested resource is forbidden.
unauthorized Access to the requested resource is unauthorized.
resource_already_exists A conflict occurred while attempting to fulfill your request. The resource you are trying to create already exists.
internal_server_error An unexpected error occurred on the server while processing your request.
not_found_error The requested resource could not be found.
partner_not_found The requested partner could not be found.
campaign_not_found The requested campaign could not be found.
tenant_not_found The requested tenant could not be found.
non_disburseplus_tenant The requested tenant is not allowed to use Disburse Plus
account_not_found The requested account could not be found.
rule_not_found The requested rule could not be found.
objective_not_found The requested objective could not be found.
action_not_found The requested action could not be found.
transaction_not_found The requested points transaction could not be found.
redemption_item_not_found The requested redemption item could not be found.
redemption_item_provider_config_not_found The requested redemption item provider config could not be found
not_implemented The request could not be processed due to functionality not implemented.
redemption_rule_violation The request failed because it did not meet the specified redemption rule.
unprocessable_entity The request was well-formed but was unable to process the contained instructions.
insufficient_points The request failed because of insufficient points.
redemption_item_not_activated The requested redemption item is not active.
redemption_item_provider_not_configured The requested redemption item has no provider configured.
insufficient_quantity_available The requested redemption item has insufficient quantity available for redemption.
db_write_retries_exceeded The system has exceeded the maximum number of retries for writing to the database. This may indicate a persistent issue with the database or high contention on the resource.
account_inactive The requested account is not active.
batch_processing_failed Batch processing has failed
webhook_not_found The requested webhook could not be found.
max_webhook_limit_hit The request failed because the maximum number of webhooks for this campaign has been reached.
user_not_found The requested user could not be found.
same_account_transfer The request failed because the sender and receiver accounts cannot be the same if they are from the same campaign.
tenant_owner_already_assigned The request failed because the tenant has already been assigned to an owner.
max_redemptions_limit_hit The request failed because the maximum number of redemptions for this item and account have been reached.
max_credentials_limit_hit The request failed because the maximum number of allowed credentials have been reached.
user_already_admin The request failed because this user has already been assigned as admin.
action_provider_not_found The requested action provider could not be found.
formsg_already_exists The request failed because the provided FormSG form already exists.
campaign_tier_not_found The requested campaign tier could not be found.
duplicate_campaign_id The request failed because a duplicate campaign ID was found.
duplicate_account_identifiers The request failed because a duplicate account identifier was found.
duplicate_tier_priorities The list of tiers cannot have duplicate priorities.
duplicate_tier_ids The list of tiers cannot have duplicate ids.
incorrect_tier_count Incorrect number of tiers provided.
too_many_requests The request failed because the rate limit for this endpoint has been exceeded.

Conditions

Conditions define the criteria that must be met for an action to be valid, such as redeeming a reward. Each condition consists of a name, an operator, and a value, which are evaluated to determine eligibility.

Name Details
account.tier Description: The value provided should be the ID of a campaign tier.
Allowed Rule Types: REDEMPTION
Allowed Operators: in, notIn
action Description: The value provided should be the name of the action.
Allowed Rule Types: ALLOTMENT
Allowed Operators: equal
formSG.formId Description: The value provided should be the form ID of the FormSG.
Allowed Rule Types: ALLOTMENT
Allowed Operators: equal
goventry.venue Description: The value provided should be the name of a GovEntry venue.
Allowed Rule Types: ALLOTMENT
Allowed Operators: equal

build.1.9.21

Webhook Events

ObjectiveCompletedWebhookEventDataEntity

identifier
required
string

The identifier of this account.

required
object

Completed objective details.

{
  • "identifier": "test@example.com",
  • "objective": {
    }
}

PointsTargetMetWebhookEventDataEntity

identifier
required
string

The identifier of this account.

pointsAdded
required
number

The total amount of points added to the account for this campaign.

pointsTargets
required
Array of numbers

The points target(s) met for this campaign. If a single points credit transaction meets multiple points targets, this array will contain all the points targets that were met.

metAt
required
string

Date and time when the points target was met.

{
  • "identifier": "test@example.com",
  • "pointsAdded": 100,
  • "pointsTargets": [
    ],
  • "metAt": "2024-03-06T00:00:00+08:00"
}

AccountTierChangedWebhookEventDataEntity

identifier
required
string

The identifier of this account.

required
object or null

The account's tier before the update. If the account had no previous tier, this value will be null.

required
object

The account's updated tier after the change.

changedAt
required
string

The updated timestamp of the campaign tier

{
  • "identifier": "test@example.com",
  • "previousTier": {
    },
  • "newTier": {
    },
  • "changedAt": "2023-11-22T16:57:12+08:00"
}

General

Get version

Retrieve version of API server

Authorizations:
bearer

Responses

Accounts

Add an account identifier to multiple campaigns

Operations

Add an account identifier to multiple campaigns.

Authorizations:
bearer
Request Body schema: application/json
required

Payload for adding an account to multiple campaigns.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

required
Array of objects (CampaignInfoDTO)

List of campaigns to add this account to.

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com",
  • "campaigns": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List account details for all or one campaigns

Operations

Retrieve account details for all or one campaigns.

Authorizations:
bearer
query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

campaignId
any

Campaign ID

Request Body schema: application/json
required
identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

Account Actions

Retrieve all actions

Operations

Retrieve all actions

Authorizations:
bearer
query Parameters
campaignId
string
Example: campaignId=f39854be-46f2-492f-9dd8-042e5719f05f

The identifier of the campaign

status
string
Enum: "PROCESSED" "FAILED" "PENDING"
Example: status=PENDING

Indicates the current status of the evaluation process, with detailed reasons available in the 'evaluationReason' field. Possible values include:

  • PENDING: The evaluation has started and the system is still processing the necessary rules and actions.
  • PROCESSED: The evaluation has been successfully completed, and the outcome is finalized.
  • FAILED: The evaluation could not be completed due to an error or issue.
evaluationReason
string or null
Enum: "RULES_NOT_FOUND" "OBJECTIVE_NOT_FOUND" "RULES_PARSING_ERROR" "INVALID_ACTION" "MAX_TRIES_HIT" "NO_VALID_OUTCOMES" "ERROR_OCCURRED" null
Example: evaluationReason=MAX_TRIES_HIT

The reason for the evaluation result. Possible values include:

PROCESSED:

  • null: The evaluation was successful and points were allotted.
  • RULES_NOT_FOUND: The evaluation was processed but no rules were found to evaluate against.
  • INVALID_ACTION: The evaluation was processed but the action did not meet any criteria. No points were allotted.
  • MAX_TRIES_HIT: The evaluation was processed but the maximum number of allowed attempts for the specified participant was reached. No points were allotted.
  • NO_VALID_OUTCOMES: The evaluation was processed but none of the conditions resulted in a valid outcome. No points were allotted.

FAILED:

  • OBJECTIVE_NOT_FOUND: The evaluation failed because objective could not be found using the provided objectiveId.
  • RULES_PARSING_ERROR: The evaluation failed because the campaign's rule was missing a ruleId, preventing proper parsing.
  • INVALID_ACTION: The evaluation failed as the campaign's rule has undefined points and objectiveId.
  • ERROR_OCCURRED: The evaluation failed due to an unexpected error.
fromDate
string
Example: fromDate=2023-11-23T00:00:00+08:00

The start date and time for filtering actions by their creation timestamp. Only actions created on or after this date will be included in the results.

toDate
string
Example: toDate=2023-11-23T23:59:59+08:00

The end date and time for filtering actions by their creation timestamp. Only actions created before or on this date will be included in the results.

offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Register action

Operations

Register action for an account in a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

header Parameters
x-idempotency-key
required
string

Idempotency Key. Must be a valid uuid. Refer to the section "Idempotency" for more information.

Request Body schema: application/json
required

Payload for registering action for an account in a campaign.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

name
required
string

Name of the action. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com",
  • "name": "action_a"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Register actions

Operations

Register actions in a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

header Parameters
x-idempotency-key
required
string

Idempotency Key. Must be a valid uuid. Refer to the section "Idempotency" for more information.

Request Body schema: application/json
required

Payload for registering actions in a campaign.

required
Array of objects (RegisterActionDTO)

List of actions to be registered

Responses

Request samples

Content type
application/json
{
  • "actions": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List account actions for specific campaign

Operations

Retrieve account actions for specific campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
includeAdditionalDetails
boolean
Default: false

To indicate if additional details should be fetched and included in the response. If set to true, the response will include the related objectives and transactions under the accountObjectives field. Defaults to false.

offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Request Body schema: application/json
required
identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

Get actions details by external reference Id

Operations

Retrieve actions with their associated objectives

Authorizations:
bearer
path Parameters
externalReferenceId
required
string
campaignId
required
any

Campaign ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Account Objectives

List all completed objective

Operations

List all completed objectives for an account by campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Request Body schema: application/json
required

Payload for retrieving all completed objective for an account by campaign.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

Account Transactions

List account transactions for specific campaign

Operations

Retrieve account transactions for specific campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
type
string
Enum: "ALLOT" "REDEEM" "EXPIRE" "TRANSFER_IN" "TRANSFER_OUT" "DEDUCT"
Example: type=ALLOT

The type of transaction

offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Request Body schema: application/json
required
identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

List account transactions actions for specific campaign

Operations

Retrieve account transactions actions for specific campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
type
string
Enum: "ALLOT" "REDEEM" "EXPIRE" "TRANSFER_IN" "TRANSFER_OUT" "DEDUCT"
Example: type=ALLOT

The type of transaction

fromDate
string
Example: fromDate=2023-11-23T00:00:00+08:00

The start date and time for filtering transactions or actions by their creation timestamp. Only transactions or actions created on or after this date will be included in the results.

toDate
string
Example: toDate=2023-11-23T23:59:59+08:00

The end date and time for filtering transactions or actions by their creation timestamp. Only transactions or actions created before or on this date will be included in the results.

offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Request Body schema: application/json
required
identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

Action Providers

Add an action provider

Management

Add an action provider

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for adding an action provider

provider
required
string
Value: "FORMSG"

Action provider type

required
FormSGActionProviderConfig (object)

Provider configuration

description
string or null

Description of this action provider. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

Responses

Request samples

Content type
application/json
{
  • "provider": "FORMSG",
  • "providerConfig": {
    },
  • "description": "Description for FormSG"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all action providers for a campaign

Management

Retrieve all action providers for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Update action provider

Management

Update action provider for a campaign.

Authorizations:
bearer
path Parameters
providerId
required
any

Action Provider ID

campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating an action provider for a campaign. Available fields for update: description, providerConfig

description
string or null

Description of this action provider. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

required
FormSGActionProviderConfig (object)

Provider configuration

Responses

Request samples

Content type
application/json
{
  • "description": "Description for FormSG",
  • "providerConfig": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Campaigns

Create campaign

Management

Create a new campaign for a tenant.

Authorizations:
bearer
Request Body schema: application/json
required

Payload for creating a campaign.

sid
required
string

Short ID of the campaign. Only lowercase alphanumeric and underscores of length 3 to 20 characters are allowed.

name
required
string

Name of the campaign. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the campaign. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

pointsTargets
Array of numbers

One or more target amount of points that each participant should achieve. Please take note of the following points:

  • A webhook event POINTS_TARGET_MET will be triggered each time any of the points target is met if this campaign has a configured webhook.
  • A maximum of 10 point targets can be set per campaign.
  • Set [] to remove all points target. Defaults to [] (i.e. no points target).
  • The value of pointsTarget must be an integer between 1 and 1000000.
  • The array will be automatically sorted in ascending order.

Responses

Request samples

Content type
application/json
{
  • "sid": "my_campaign",
  • "name": "Campaign A",
  • "description": "Description for campaign A",
  • "pointsTargets": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all campaigns

Management

Retrieve details for all campaigns associated to a specific tenant.

Authorizations:
bearer
query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get campaign details

Management

Retrieve details for a specific campaign

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update campaign

Management

Update an existing campaign for a tenant.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating a campaign. Either name or description should be provided.

name
string

Name of the campaign. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the campaign. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

pointsTargets
Array of numbers

One or more target amount of points that each participant should achieve. Please take note of the following points:

  • A webhook event POINTS_TARGET_MET will be triggered each time any of the points target is met if this campaign has a configured webhook.
  • A maximum of 10 point targets can be set per campaign.
  • Set [] to remove all points target. Defaults to [] (i.e. no points target).
  • The value of pointsTarget must be an integer between 1 and 1000000.
  • The array will be automatically sorted in ascending order.

Responses

Request samples

Content type
application/json
{
  • "name": "Campaign A",
  • "description": "Description for campaign A",
  • "pointsTargets": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create an account for a specified campaign

Operations

Create an account for a specified campaign. The account created will automatically be whitelisted for the campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for creating an account for a specified campaign.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

metadata
object
Default: {}

metadata for this account for this specified campaign. Metadata must be stored as a key-value pair, with both key and value as a valid string.

key: Only lowercase alphanumeric and underscores of length 3 to 20 characters are allowed.

value: Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

A maximum of 20 metadata key-value pairs are allowed.

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an account for a specified campaign

Operations

Update an account for a specified campaign. Currently only the account metadata can be updated.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating an account for a specified campaign.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

metadata
object
Default: {}

metadata for this account for this specified campaign. Metadata must be stored as a key-value pair, with both key and value as a valid string.

key: Only lowercase alphanumeric and underscores of length 3 to 20 characters are allowed.

value: Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

A maximum of 20 metadata key-value pairs are allowed.

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all accounts in a campaign

Retrieve all accounts for a specific campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
q
string

Search via query string

isActive
boolean

Filter accounts by active status

offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Create a list of accounts for a specified campaign

Operations

Create a list of accounts for a specified campaign. The accounts created will automatically be whitelisted for the campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for creating accounts for a specified campaign.

required
Array of objects (CreateAccountDTO)

Responses

Request samples

Content type
application/json
{
  • "accounts": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Deactivate an account for a specified campaign

Management

Deactivate an account for a specified campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload to deactivate an account for a specified campaign.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Activate an account for a specified campaign

Management

Activate an account for a specified campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload to activate an account for a specified campaign.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List the leaderboard of active users for a specific campaign based on total points credited to the account

Operations

Retrieve the leaderboard of active users for a specific campaign based on total points credited to the account. This only includes ALLOT and TRANSFER_IN transactions.

Cache behaviors:

  • The leaderboard data is cached for 5 minutes to improve performance.
  • The response includes a x-cache-expire-at header, which indicates when the cache will expire. Clients can use this to decide whether to wait for the next refresh or invalidate the cache manually.

Note: Deactivated accounts will not be included in the leaderboard.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

List the leaderboard of active users for a specific campaign based on total points credited to the account and a set of identifiers

Operations

Retrieve the leaderboard of active users based on a set of identifiers for a specific campaign based on total points credited to the account. This only includes ALLOT and TRANSFER_IN transactions.

Cache behaviors:

  • The leaderboard data is cached for 5 minutes to improve performance.
  • The response includes a x-cache-expire-at header, which indicates when the cache will expire. Clients can use this to decide whether to wait for the next refresh or invalidate the cache manually.

Note: Deactivated accounts will not be included in the leaderboard.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload with list of account identifiers to query leaderboard rank

required
Array of objects (RetrieveAccountDTO)

Responses

Request samples

Content type
application/json
{
  • "accounts": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

Transfer points between accounts

Operations

Transfers points from the sender account to the receiver account, provided both accounts belong to the same tenant.

Note: Points transferred from the sender to the receiver will not have expiry date and the transfer will take immediate effect.

Authorizations:
bearer
Request Body schema: application/json
required
required
object

Sender account details

required
object

Receiver account details

points
required
number

Number of points to transfer from the sender account to the receiver account. The value of points must be an integer between 1 and 9,999

Responses

Request samples

Content type
application/json
{
  • "sender": {
    },
  • "receiver": {
    },
  • "points": 1
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get metrics for a campaign

Management

Retrieve metrics for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required
metricsToInclude
Array of strings
Items Enum: "ACTIONS" "OBJECTIVES_COMPLETED" "REDEMPTIONS" "ACCOUNTS" "POINTS_TRANSACTIONS"

Metrics to include in the response. If not provided, all metrics will be included.

fromDate
string

The start date and time for filtering records by their creation timestamp. Only metrics from records created on or after this date will be included in the results.

toDate
string

The end date and time for filtering records by their creation timestamp. Only metrics from records created on or before this date will be included in the results.

Responses

Request samples

Content type
application/json
{
  • "metricsToInclude": [
    ],
  • "fromDate": "2025-01-01T00:00:00+08:00",
  • "toDate": "2025-01-31T23:59:59+08:00"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Campaign Tiers

Create a campaign tier

Management

Create a campaign tier

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for adding a campaign tier

name
required
string

Name of the campaign tier. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the campaign tier. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

isActive
required
boolean

Status to enable/disable this tier

priority
required
number

Priority of campaign tier. Determines the order of which the participant is assigned a tier when calculating. A higher priority (i.e. larger integer) is of higher importance and will be assigned first if conditions are met. For e.g. Gold (3) > Silver (2) > Bronze (1). The value of priority must be an integer between 1 and 50

required
object

Conditions to meet before achieving this tier. Note that the conditions are operated on an "AND" basis, meaning all conditions must be met

Responses

Request samples

Content type
application/json
{
  • "name": "Bronze",
  • "description": "Description for the Bronze Tier",
  • "isActive": true,
  • "priority": 1,
  • "conditions": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all campaign tiers for a campaign

Management

Retrieve all campaign tiers for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Update campaign tier

Management

Update campaign tier for a campaign.

Authorizations:
bearer
path Parameters
tierId
required
any

Campaign Tier ID

campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating a campaign tier for a campaign. Available fields for update: name, description, isActive, conditions

name
string

Name of the campaign tier. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the campaign tier. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

isActive
boolean

Status to enable/disable this tier

object

Conditions to meet before achieving this tier. Note that the conditions are operated on an "AND" basis, meaning all conditions must be met

Responses

Request samples

Content type
application/json
{
  • "name": "Bronze",
  • "description": "Description for the Bronze Tier",
  • "isActive": true,
  • "conditions": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update priority of campaign tiers

Management

Update priority of campaign tiers for a campaign

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating the priority of campaign tiers for a campaign.

required
Array of objects (UpdateCampaignTierPriorityDTO)

List of tiers to update. Must have the same number of elements as the number of tiers configured for the campaign.

Responses

Request samples

Content type
application/json
{
  • "tiers": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Internal Events

List all internal events

Management

Retrieve internal events for a tenant for triaging. Currently, internal events only include the following events:

  • webhook.send.failed

  • redemption.provider_request.failed

  • formsg.webhook.received.failed

  • goventry.webhook.received.failed

  • account.tier_evaluation.failed

    Note: Internal events are available for up to 90 days only.

Authorizations:
bearer
query Parameters
campaignId
string
Example: campaignId=f39854be-46f2-492f-9dd8-042e5719f05f

The identifier of the campaign

fromDate
required
string
Example: fromDate=2023-11-23T00:00:00+08:00

The start date and time for filtering internal events by their creation timestamp. Only internal events created on or after this date will be included in the results.

toDate
required
string
Example: toDate=2023-11-23T23:59:59+08:00

The end date and time for filtering internal events by their creation timestamp. Only internal events created before or on this date will be included in the results.

type
string
Enum: "webhook.send.failed" "redemption.provider_request.failed" "formsg.webhook.received.failed" "goventry.webhook.received.failed" "account.tier_evaluation.failed"
Example: type=redemption.provider_request.failed
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Objectives

Create objective

Management

Create a new objectives for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for creating a objective for a campaign.

name
required
string

Name of the objective. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the objective. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

Responses

Request samples

Content type
application/json
{
  • "name": "Objective A",
  • "description": "Description for objective A"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all objectives for a campaign

Management

Retrieve all objectives for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
includeRules
boolean
Default: false

To indicate if rules linked to the objective should be fetched and included in the response. If set to true, the response will include the linked rules under the rules field. Defaults to false.

q
any

Search query

offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Update objective

Management

Update objectives name/description for a campaign.

Authorizations:
bearer
path Parameters
objectiveId
required
any

Objective ID

campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating an objective for a campaign. Either name or objective should be provided.

name
string

Name of the objective. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the objective. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

Responses

Request samples

Content type
application/json
{
  • "name": "Objective A",
  • "description": "Description for objective A"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get objective for a campaign

Management

Retrieve objective and its linked rules for a campaign.

Authorizations:
bearer
path Parameters
objectiveId
required
any

Objective ID

campaignId
required
any

Campaign ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Points

Allot points to a specific account

Operations

Allot points to corresponding account with effective date and expiry date.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload to allot points.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

description
required
string or null

Description of the allotment. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

points
required
number

Points to allot. The value of points must be an integer between 1 and 999

effectiveAt
string

Points are allotted based on the effective date, using the truncated date. Effective date must be set on the hour (e.g. 12pm, 1pm, etc.). If effective date is not specified, it will automatically default to the current date and time for immediate allocation

expireAt
string

Points will expire on the specified expiry date, using the truncated date, or remain valid indefinitely if no expiry date is provided. Expiry date must be set at 12AM (SGT Timezone).

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com",
  • "description": "This allotment is for xxx",
  • "points": 100,
  • "effectiveAt": "2024-06-01T09:00:00+08:00",
  • "expireAt": "2024-12-31T00:00:00+08:00"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Deduct points from a specific account

Operations

Deduct points from a corresponding account

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload to deduct points.

identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

description
required
string or null

Description of the deduction. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

pointsToDeduct
required
number

Points to deduct. The value of pointsToDeduct must be an integer between 1 and 1,000,000

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com",
  • "description": "This deduction is for xxx",
  • "pointsToDeduct": 100
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Allot point to a list of accounts

Operations

Allot points to corresponding accounts with effective date and expiry date.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload to allot points for a list of accounts

description
required
string or null

Description of the allotment. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

points
required
number

Points to allot. The value of points must be an integer between 1 and 999

effectiveAt
string

Points are allotted based on the effective date, using the truncated date. Effective date must be set on the hour (e.g. 12pm, 1pm, etc.). If effective date is not specified, it will automatically default to the current date and time for immediate allocation

expireAt
string

Points will expire on the specified expiry date, using the truncated date, or remain valid indefinitely if no expiry date is provided. Expiry date must be set at 12AM (SGT Timezone).

required
Array of objects (RetrieveAccountDTO)

Responses

Request samples

Content type
application/json
{
  • "description": "This allotment is for xxx",
  • "points": 100,
  • "effectiveAt": "2024-06-01T09:00:00+08:00",
  • "expireAt": "2024-12-31T00:00:00+08:00",
  • "accounts": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get details from a specified transaction

Operations

Retrieve a single transaction details for a specific campaign. This also includes any account objective of account redemption item that is linked to this transaction.

Authorizations:
bearer
path Parameters
transactionId
required
string
campaignId
required
any

Campaign ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Redemptions

Create redemption item

Management

Create a new redemption item for a campaign. The provider specified needs to be configured first before creating the redemption item

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for creating a redemption item for a campaign.

sid
required
string

Short ID of the redemption item. Only lowercase alphanumeric and underscores of length 3 to 20 characters are allowed.

name
required
string

Name of the redemption item. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the redemption item. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

pointsToRedeem
required
number

Points required to redeem the item. The value of pointsToRedeem must be an integer between 0 and 1,000,000

perAccountRedeemQuota
number or null

Maximum number of times a person can redeem the item. The value of perAccountRedeemQuota must be an integer between 1 and 1,000

cashInCents
number or null

In the case the type is POINTS_TO_CASH, this specifies the monetary value of the points in cents. The value of cashInCents must be an integer between 1 and 100,000,000

type
required
string
Enum: "POINTS_TO_CASH" "POINTS_TO_ITEM"

Type of redemption item

effectiveAt
string or null
Default: "Current date and time if null"

Effective date time of the redemption item. Omit this field to allow the redemption of this item immediately.

expireAt
string or null

Expiry date time of the redemption item. Omit this field to configure a redemption item that will not expire

provider
required
string
Enum: "GOVWALLET" "GOVSUPPLY" "DISBURSE_PLUS"

Provider of the redemption item

quantityAvailable
number or null

Quantity of the item available for redemption. The value of quantityAvailable must be an integer between 1 and 100,000,000

(GovSupplyItemConfig (object or null))

Configuration for the corresponding provider item. Only required for redemption provider GOVSUPPLY

Array of objects or null (ConditionDTO)

Conditions for the redemption item, referring to the Conditions section where you can find the list of available conditions and how to configure them. All conditions in the list are combined using AND logic.

Responses

Request samples

Content type
application/json
{
  • "sid": "bag",
  • "name": "Bag",
  • "description": "Best bag in the world!",
  • "pointsToRedeem": 1,
  • "perAccountRedeemQuota": 1,
  • "cashInCents": 50,
  • "type": "POINTS_TO_ITEM",
  • "effectiveAt": "2023-11-23T00:00:00+08:00",
  • "expireAt": "9999-12-31T23:59:59+08:00",
  • "provider": "GOVSUPPLY",
  • "quantityAvailable": 1,
  • "providerItemConfig": {
    },
  • "conditions": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all redemption items

Operations

Retrieve all redemption items for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
isActive
boolean

Filter redemption items by active status

provider
string
Enum: "GOVWALLET" "GOVSUPPLY" "DISBURSE_PLUS"

Filter redemption items by provider

offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Update redemption item

Management

Update redemption item for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

redemptionItemId
required
any

Redemption Item ID

Request Body schema: application/json
required

Payload for updating a redemption item.

name
string

Name of the redemption item. Only ASCII printable characters (except <, = and >) of length 1 to 50 are allowed.

description
string or null

Description of the redemption item. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

pointsToRedeem
number

Points required to redeem the item. The value of pointsToRedeem must be an integer between 0 and 1,000,000

perAccountRedeemQuota
number or null

Maximum number of times a person can redeem the item. The value of perAccountRedeemQuota must be an integer between 1 and 1,000

cashInCents
number or null

In the case the type is POINTS_TO_CASH, this specifies the monetary value of the points in cents. The value of cashInCents must be an integer between 1 and 100,000,000

type
string
Enum: "POINTS_TO_CASH" "POINTS_TO_ITEM"

Type of redemption item

effectiveAt
string or null
Default: "Current date and time if null"

Effective date time of the redemption item. Omit this field to allow the redemption of this item immediately.

expireAt
string or null

Expiry date time of the redemption item. Omit this field to configure a redemption item that will not expire

Array of objects or null (ConditionDTO)

Conditions for the redemption item, referring to the Conditions section where you can find the list of available conditions and how to configure them. All conditions in the list are combined using AND logic.

(GovSupplyItemConfig (object or null))

Configuration for the corresponding provider item. Only required for redemption provider GOVSUPPLY

Responses

Request samples

Content type
application/json
{
  • "name": "Bag",
  • "description": "Best bag in the world!",
  • "pointsToRedeem": 1,
  • "perAccountRedeemQuota": 1,
  • "cashInCents": 50,
  • "type": "POINTS_TO_ITEM",
  • "effectiveAt": "2023-11-23T00:00:00+08:00",
  • "expireAt": "9999-12-31T23:59:59+08:00",
  • "conditions": [
    ],
  • "providerItemConfig": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get redemption item details

Operations

Retrieve redemption item details by its specific id

Authorizations:
bearer
path Parameters
redemptionItemId
required
any

Redemption Item ID

campaignId
required
any

Campaign ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create redemption item provider

Management

Configure a redemption item provider for a specified campaign. Only one configuration per redemption item provider per campaign.

Note: Not all tenants can use the DISBURSE_PLUS provider. If you would like to use it, you will need to contact us, if not, you will receive an error.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for configuring a redemption item provider for a campaign.

provider
required
string
Enum: "GOVWALLET" "GOVSUPPLY" "DISBURSE_PLUS"

Provider of the redemption item to configure

required
GovSupplyConfig (object) or GovWalletConfig (object) or DisbursePlusConfig (object)

Provider configuration

Responses

Request samples

Content type
application/json
{
  • "provider": "GOVSUPPLY",
  • "providerConfig": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all redemption item providers for a specified campaign

Management

Retrieve all redemption item providers for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Update redemption item provider configuration for a specified campaign

Management

Update redemption item provider configuration for a specified campaign.

Authorizations:
bearer
path Parameters
providerId
required
any

Provider ID

campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating a redemption item provider configuration.

GovSupplyConfig (object) or GovWalletConfig (object) or DisbursePlusConfig (object)

Provider configuration

Responses

Request samples

Content type
application/json
{
  • "providerConfig": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Redeem items

Operations

Process the redemption of items using the user accumulated points. The operation checks the eligibility and handles any business rule validations before completing the redemption.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

header Parameters
x-idempotency-key
required
string

Idempotency Key. Must be a valid uuid. Refer to the section "Idempotency" for more information.

Request Body schema: application/json
required
identifier
required
string

Identifier value. Only ASCII printable characters (except < and >) of length 1 to 255 are allowed.

Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed).

redemptionItemId
required
string

ID of the item to redeem

quantityToRedeem
required
number

Quantity of item to redeem. The value of quantityToRedeem must be an integer between 1 and 1,000

RedeemDisbursePlusAdditionalData (object)

Additional data to pass to the redemption item provider

Responses

Request samples

Content type
application/json
{
  • "identifier": "user@example.com",
  • "redemptionItemId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
  • "quantityToRedeem": 1,
  • "additionalData": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Rules

List all campaign rules

Management

Retrieve rules for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Create rule

Management

Create a new rule for a campaign.

How to set maxTriesResetStrategy

The recurrenceType field determines the frequency of resetting maxTries, with the reset period starting at 00:00:00 and ending at 23:59:59 Singapore time:

  • DAILY: maxTries will be reset daily, allowing you to continue attempting to meet the objective each day.
  • WEEKLY: maxTries will be reset weekly. You can specify dayOfWeek (0 for Sunday through 6 for Saturday) in the recurrenceSchedule.
  • MONTHLY: maxTries will be reset monthly. You can specify dayOfMonth (1 through 31) in the recurrenceSchedule.

Example usage:

  • For a daily reset of maxTries, set recurrenceType to DAILY and leave recurrenceSchedule empty.
  • For a weekly reset on Wednesdays, set recurrenceType to WEEKLY and recurrenceSchedule.dayOfWeek to 3.
  • For a monthly reset on the 15th, set recurrenceType to MONTHLY and recurrenceSchedule.dayOfMonth to 15.

How to set pointsExpiryStrategy

The pointsExpiryStrategy field determines when earned points will expire:

  • expireAt: Set a specific date and time for points to expire. The time must always be set to 00:00:00 (start of day) Singapore time.
  • relativeExpiryDuration: Set a duration for points to expire relative to when they were earned. Use ISO 8601 duration format. The expiry time will be calculated and then rounded up to the next start of day in Singapore time.

Example usage for:

  • To set points to expire on November 23, 2023 at midnight Singapore time:
    "pointsExpiryStrategy": {
      "expireAt": "2023-11-23T00:00:00+08:00"
    }
    
  • To set points to expire 1 day after they are earned:
    "pointsExpiryStrategy": {
      "relativeExpiryDuration": "P1D"
    }
    

Concrete examples for relativeExpiryDuration:

Assume points are allotted on 2025-01-24T10:00:00+08:00

  1. P1D (1 day): Points will expire on 2025-01-26T00:00:00+08:00

  2. P1W (1 week): Points will expire on 2025-02-01T00:00:00+08:00

  3. P1M (1 month): Points will expire on 2025-02-25T00:00:00+08:00

  4. P1Y (1 year): Points will expire on 2026-01-25T00:00:00+08:00

Note: For relativeExpiryDuration, the expiry time is always rounded up to the next Singapore Time (SGT) start of day (00:00:00). This ensures that even if points are earned late in the day (e.g., at 11:59 PM), they will still be valid for the full specified duration plus the remainder of that day. For example, points earned at 11:59 PM with a P1D duration will expire at 00:00:00 two days later, giving slightly more than 24 hours of validity.

You should use either expireAt or relativeExpiryDuration, not both. The relativeExpiryDuration only supports whole number values for date components (years, months, weeks, days).

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for creating a rule for a campaign.

required
object

JSON rules

effectiveAt
string or null
Default: "Current date and time if null"

Effective date time of the rule. Omit this field to apply the rule immediately

expireAt
string or null

Expiry date time of the rule. Omit this field to configure a rule that will not expire

type
required
string
Enum: "ALLOTMENT" "REDEMPTION"

Type of the rule

objectiveId
required
string

The ID of the objective this rule is applied to. Required if type is ALLOTMENT.

priority
number
Default: 1

Priority of the rule. Rule priorities are evaluated within each campaign. Higher priority rules are evaluated before lower priority rules. e.g. A rule with priority 10 will be evaluated before a rule with priority 9. If multiple rules have the same priority, there is no specific sequence in which these rules will be evaluated.. The value of priority must be an integer between 1 and 100

engineVersion
required
number

Version of Rule Engine. Set to 1.

Responses

Request samples

Content type
application/json
{
  • "ruleJSON": {
    },
  • "effectiveAt": "2023-11-23T00:00:00+08:00",
  • "expireAt": "9999-12-31T23:59:59+08:00",
  • "type": "ALLOTMENT",
  • "objectiveId": "9729fc3f-5c5d-41ad-92e2-01caa0af3dba",
  • "priority": 1,
  • "engineVersion": 1
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update rule

Management

Update rule for a campaign.

How to set maxTriesResetStrategy

The recurrenceType field determines the frequency of resetting maxTries, with the reset period starting at 00:00:00 and ending at 23:59:59 Singapore time:

  • DAILY: maxTries will be reset daily, allowing you to continue attempting to meet the objective each day.
  • WEEKLY: maxTries will be reset weekly. You can specify dayOfWeek (0 for Sunday through 6 for Saturday) in the recurrenceSchedule.
  • MONTHLY: maxTries will be reset monthly. You can specify dayOfMonth (1 through 31) in the recurrenceSchedule.

Example usage:

  • For a daily reset of maxTries, set recurrenceType to DAILY and leave recurrenceSchedule empty.
  • For a weekly reset on Wednesdays, set recurrenceType to WEEKLY and recurrenceSchedule.dayOfWeek to 3.
  • For a monthly reset on the 15th, set recurrenceType to MONTHLY and recurrenceSchedule.dayOfMonth to 15.

How to set pointsExpiryStrategy

The pointsExpiryStrategy field determines when earned points will expire:

  • expireAt: Set a specific date and time for points to expire. The time must always be set to 00:00:00 (start of day) Singapore time.
  • relativeExpiryDuration: Set a duration for points to expire relative to when they were earned. Use ISO 8601 duration format. The expiry time will be calculated and then rounded up to the next start of day in Singapore time.

Example usage for:

  • To set points to expire on November 23, 2023 at midnight Singapore time:
    "pointsExpiryStrategy": {
      "expireAt": "2023-11-23T00:00:00+08:00"
    }
    
  • To set points to expire 1 day after they are earned:
    "pointsExpiryStrategy": {
      "relativeExpiryDuration": "P1D"
    }
    

Concrete examples for relativeExpiryDuration:

Assume points are allotted on 2025-01-24T10:00:00+08:00

  1. P1D (1 day): Points will expire on 2025-01-26T00:00:00+08:00

  2. P1W (1 week): Points will expire on 2025-02-01T00:00:00+08:00

  3. P1M (1 month): Points will expire on 2025-02-25T00:00:00+08:00

  4. P1Y (1 year): Points will expire on 2026-01-25T00:00:00+08:00

Note: For relativeExpiryDuration, the expiry time is always rounded up to the next Singapore Time (SGT) start of day (00:00:00). This ensures that even if points are earned late in the day (e.g., at 11:59 PM), they will still be valid for the full specified duration plus the remainder of that day. For example, points earned at 11:59 PM with a P1D duration will expire at 00:00:00 two days later, giving slightly more than 24 hours of validity.

You should use either expireAt or relativeExpiryDuration, not both. The relativeExpiryDuration only supports whole number values for date components (years, months, weeks, days).

Authorizations:
bearer
path Parameters
ruleId
required
any

Rule ID

campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating a rule.

object

JSON rules

effectiveAt
string or null
Default: "Current date and time if null"

Effective date time of the rule. Omit this field to apply the rule immediately

expireAt
string or null

Expiry date time of the rule. Omit this field to configure a rule that will not expire

priority
number

Priority of the rule. Rule priorities are evaluated within each campaign. Higher priority rules are evaluated before lower priority rules. e.g. A rule with priority 10 will be evaluated before a rule with priority 9. If multiple rules have the same priority, there is no specific sequence in which these rules will be evaluated.. The value of priority must be an integer between 1 and 100

Responses

Request samples

Content type
application/json
{
  • "ruleJSON": {
    },
  • "effectiveAt": "2023-11-23T00:00:00+08:00",
  • "expireAt": "9999-12-31T23:59:59+08:00",
  • "priority": 1
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all campaign rule change history

Management

Retrieve history of changes for a rule of a campaign.

Authorizations:
bearer
path Parameters
ruleId
required
any

Rule ID

campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Tenants

Grant tenant access to partner

Management

Grant access of a specified tenant resources to a partner

Authorizations:
bearer
Request Body schema: application/json
required

Payload for granting tenant access to a partner.

partnerId
required
string

The identifier of the partner

Responses

Request samples

Content type
application/json
{
  • "partnerId": "00e3a7a7-d1bc-429f-9fde-aa7b6108e980"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Revoke tenant access from partner

Management

Revoke access of a specified tenant resources from a partner.

Authorizations:
bearer
Request Body schema: application/json
required

Payload for revoking tenant access from a partner.

partnerId
required
string

The identifier of the partner

Responses

Request samples

Content type
application/json
{
  • "partnerId": "00e3a7a7-d1bc-429f-9fde-aa7b6108e980"
}

Response samples

Content type
application/json
{
  • "error": {
    },
  • "requestId": "064afbca-5c14-4e27-a92b-b1f76a6d14d3"
}

List all partners that can access this specified tenant.

Management

Retrieve all partners that can access this specified tenant.

Authorizations:
bearer
query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get tenant details

Management

Retrieve details for this tenant.

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Generate new credential for specified tenant

Management

Generate new credential for specified tenant.

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete existing credential for specified tenant

Management

Delete existing credential for specified tenant.

Authorizations:
bearer
Request Body schema: application/json
required
clientId
required
string <uuid>

The unique identifier of the client

Responses

Request samples

Content type
application/json
{
  • "clientId": "5e505642-9024-474d-9434-e5a44f505cc5"
}

Response samples

Content type
application/json
{
  • "error": {
    },
  • "requestId": "064afbca-5c14-4e27-a92b-b1f76a6d14d3"
}

Webhooks

Register a webhook

Management

Register a webhook

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for registering a webhook

url
required
string

Unique URL within each campaign

description
string or null

Description of the campaign webhook. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

enabledEvents
required
Array of strings
Items Enum: "OBJECTIVE_COMPLETED" "POINTS_TARGET_MET" "ACCOUNT_TIER_UPDATED"

List of enabled events for the webhook

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all webhooks for a campaign

Management

Retrieve all webhooks for a campaign.

Authorizations:
bearer
path Parameters
campaignId
required
any

Campaign ID

query Parameters
offset
any

The number of records to skip before selecting records. Defaults to 0.

limit
any

The maximum number of records to return. Value must be in the range 0 - 100. Defaults to 10.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get webhook for a campaign

Management

Retrieve webhook for a campaign.

Authorizations:
bearer
path Parameters
webhookId
required
any

Webhook ID

campaignId
required
any

Campaign ID

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update webhook

Management

Update webhook for a campaign.

Authorizations:
bearer
path Parameters
webhookId
required
any

Webhook ID

campaignId
required
any

Campaign ID

Request Body schema: application/json
required

Payload for updating a Webhook for a campaign. Available fields for update: url, description, enabledEvents, isActive

url
string

Unique URL within each campaign

description
string or null

Description of the campaign webhook. Only ASCII printable characters (except <, = and >) of length 1 to 250 are allowed.

enabledEvents
Array of strings
Items Enum: "OBJECTIVE_COMPLETED" "POINTS_TARGET_MET" "ACCOUNT_TIER_UPDATED"

List of enabled events for the webhook

isActive
boolean

Flag to indicate whether webhook is active or not

Responses

Request samples

Content type
application/json
{
  • "description": "Description for campaign webhook",
  • "enabledEvents": [
    ],
  • "isActive": true
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get public key to verify webhook signature

Management

Retrieve public key to verify webhook signature.

Authorizations:
bearer

Responses

Response samples

Content type
application/json
[
  • {
    }
]
Chat with me!
Bot Launcher