Download OpenAPI specification:Download
GovRewards Tenant API Specifications
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
https://apps.auth.rewards.gov.sg/oauth2/token
) with your client credentials.2. Use Access Token
Authorization
header of your HTTP requests to the API endpoints. 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 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.
To ensure fair use and maintain system stability, the GovRewards API implements rate limiting at the tenant level.
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.
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 |
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 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.
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
There are no supported client-toggled feature flags at the moment.
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 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
identifier required | string The identifier of this account. |
required | object Completed objective details. |
{- "identifier": "test@example.com",
- "objective": {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "completedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "objectiveId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "name": "Objective A",
- "description": "This is Objective A",
- "points": 100,
- "transactionId": "4E9Tu8wDImquVxcF",
- "actions": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}
}
]
}
}
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": [
- 50,
- 100
], - "metAt": "2024-03-06T00:00:00+08:00"
}
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": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze"
}, - "newTier": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze"
}, - "changedAt": "2023-11-22T16:57:12+08:00"
}
Operations
Add an account identifier to multiple campaigns.
Payload for adding an account to multiple campaigns.
identifier required | string Identifier value. Only ASCII printable characters (except 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. |
{- "identifier": "user@example.com",
- "campaigns": [
- {
- "id": "477b566e-0199-4f90-8832-d8d3df2eda4b",
- "accountMetadata": {
- "team": "rocket"
}
}
]
}
{- "data": {
- "totalRecords": 0,
- "totalSuccessfulRecords": 0,
- "totalFailedRecords": 0,
- "successRecords": [
- {
- "identifier": "test@example.com",
- "accountCampaignDetails": [
- {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "campaignName": "My Campaign",
- "campaignDescription": "My Campaign Description",
- "campaignSid": "my_campaign",
- "isActive": true,
- "metadata": {
- "team": "rocket"
}, - "tenantId": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "balance": 100,
- "expiries": [
- {
- "remainingPoints": 100,
- "initialPoints": 300,
- "expireAt": "2024-03-06T00:00:00+08:00"
}
], - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "totalPointsCredited": 100,
- "tier": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
]
}
], - "failedRecords": [
- {
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "error": {
- "reasonCode": "duplicate_campaign_id",
- "description": "The request failed because a duplicate campaign ID was found.",
- "details": [ ]
}, - "reason": "The request failed because a duplicate campaign ID was found."
}
]
}
}
Operations
Retrieve account details for all or one campaigns.
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 |
identifier required | string Identifier value. Only ASCII printable characters (except Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed). |
{- "identifier": "user@example.com"
}
{- "data": {
- "identifier": "test@example.com",
- "accountCampaignDetails": [
- {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "campaignName": "My Campaign",
- "campaignDescription": "My Campaign Description",
- "campaignSid": "my_campaign",
- "isActive": true,
- "metadata": {
- "team": "rocket"
}, - "tenantId": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "balance": 100,
- "expiries": [
- {
- "remainingPoints": 100,
- "initialPoints": 300,
- "expireAt": "2024-03-06T00:00:00+08:00"
}
], - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "totalPointsCredited": 100,
- "tier": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
]
}, - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Operations
Retrieve all actions
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:
|
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:
FAILED:
|
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. |
{- "data": [
- {
- "identifier": "test@example.com",
- "action": {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}
}
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Operations
Register action for an account in a campaign.
campaignId required | any Campaign ID |
x-idempotency-key required | string Idempotency Key. Must be a valid uuid. Refer to the section "Idempotency" for more information. |
Payload for registering action for an account in a campaign.
identifier required | string Identifier value. Only ASCII printable characters (except 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 |
{- "identifier": "user@example.com",
- "name": "action_a"
}
{- "data": {
- "identifier": "test@example.com",
- "action": {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}
}
}
}
Operations
Register actions in a campaign.
campaignId required | any Campaign ID |
x-idempotency-key required | string Idempotency Key. Must be a valid uuid. Refer to the section "Idempotency" for more information. |
Payload for registering actions in a campaign.
required | Array of objects (RegisterActionDTO) List of actions to be registered |
{- "actions": [
- {
- "identifier": "user@example.com",
- "name": "action_a"
}
]
}
{- "data": {
- "totalRecords": 0,
- "totalSuccessfulRecords": 0,
- "totalFailedRecords": 0,
- "successRecords": [
- {
- "identifier": "test@example.com",
- "action": {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}
}
}
], - "failedRecords": [
- {
- "action": {
- "identifier": "test@example.com",
- "name": "action_a",
- "index": 0
}, - "error": {
- "reasonCode": "account_not_found",
- "description": "The requested account could not be found.",
- "details": [ ]
}
}
]
}
}
Operations
Retrieve account actions for specific campaign.
campaignId required | any Campaign ID |
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. |
identifier required | string Identifier value. Only ASCII printable characters (except Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed). |
{- "identifier": "user@example.com"
}
{- "data": {
- "identifier": "test@example.com",
- "actions": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}, - "accountObjectives": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "completedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "objectiveId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "name": "Objective A",
- "description": "This is Objective A",
- "transaction": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "description": "This transaction is for xxx",
- "transactionId": "Dz7WaF1Q4QnSrXuq",
- "type": "ALLOT",
- "points": 100,
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "status": "SUCCESSFUL"
}
}
]
}
]
}, - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Operations
Retrieve actions with their associated objectives
externalReferenceId required | string |
campaignId required | any Campaign ID |
{- "data": {
- "identifier": "test@example.com",
- "action": {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}, - "accountObjectives": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "completedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "objectiveId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "name": "Objective A",
- "description": "This is Objective A",
- "transaction": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "description": "This transaction is for xxx",
- "transactionId": "Dz7WaF1Q4QnSrXuq",
- "type": "ALLOT",
- "points": 100,
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "status": "SUCCESSFUL"
}
}
]
}
}
}
Operations
List all completed objectives for an account by campaign.
campaignId required | any Campaign ID |
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. |
Payload for retrieving all completed objective for an account by campaign.
identifier required | string Identifier value. Only ASCII printable characters (except Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed). |
{- "identifier": "user@example.com"
}
{- "data": {
- "identifier": "test@example.com",
- "objectives": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "completedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "objectiveId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "name": "Objective A",
- "description": "This is Objective A",
- "points": 100,
- "transactionId": "4E9Tu8wDImquVxcF",
- "actions": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}
}
]
}
]
}, - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Operations
Retrieve account transactions for specific campaign.
campaignId required | any Campaign ID |
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. |
identifier required | string Identifier value. Only ASCII printable characters (except Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed). |
{- "identifier": "user@example.com"
}
{- "data": {
- "identifier": "test@example.com",
- "transactions": [
- {
- "transactionId": "string",
- "points": 100,
- "type": "ALLOT",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "description": "This transaction is for xxx",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "status": "SUCCESSFUL"
}
]
}, - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Operations
Retrieve account transactions actions for specific campaign.
campaignId required | any Campaign ID |
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. |
identifier required | string Identifier value. Only ASCII printable characters (except Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed). |
{- "identifier": "user@example.com"
}
{- "data": {
- "identifier": "test@example.com",
- "transactionsActions": [
- {
- "transaction": {
- "description": "This transaction is for xxx",
- "transactionId": "Dz7WaF1Q4QnSrXuq",
- "type": "ALLOT",
- "points": 100,
- "status": "SUCCESSFUL"
}, - "action": {
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "name": "action_a",
- "status": "PENDING",
- "evaluationReason": "MAX_TRIES_HIT"
}, - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5"
}
]
}, - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Add an action provider
campaignId required | any Campaign ID |
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 |
{- "provider": "FORMSG",
- "providerConfig": {
- "formId": "661be43fa14ba8cd75eaeeec",
- "formSecret": "91wzO6ndE2bI3IN7CzTpWGL4JvLtmQPvNO8f/NlH/vB=",
- "accountFieldName": "Email",
- "createAccountIfNotExist": true
}, - "description": "Description for FormSG"
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "provider": "FORMSG",
- "description": "FormSG integration for campaign A",
- "providerConfig": {
- "formId": "661be43fa14ba8cd75eaeeec",
- "formSecret": "91wzO6ndE2bI3IN7CzTpWGL4JvLtmQPvNO8f/NlH/vB=",
- "accountFieldName": "Email",
- "createAccountIfNotExist": true
}, - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Retrieve all action providers for a campaign.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "provider": "FORMSG",
- "description": "FormSG integration for campaign A",
- "providerConfig": {
- "formId": "661be43fa14ba8cd75eaeeec",
- "formSecret": "91wzO6ndE2bI3IN7CzTpWGL4JvLtmQPvNO8f/NlH/vB=",
- "accountFieldName": "Email",
- "createAccountIfNotExist": true
}, - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Update action provider for a campaign.
providerId required | any Action Provider ID |
campaignId required | any Campaign ID |
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 |
required | FormSGActionProviderConfig (object) Provider configuration |
{- "description": "Description for FormSG",
- "providerConfig": {
- "formId": "661be43fa14ba8cd75eaeeec",
- "formSecret": "91wzO6ndE2bI3IN7CzTpWGL4JvLtmQPvNO8f/NlH/vB=",
- "accountFieldName": "Email",
- "createAccountIfNotExist": true
}
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "provider": "FORMSG",
- "description": "FormSG integration for campaign A",
- "providerConfig": {
- "formId": "661be43fa14ba8cd75eaeeec",
- "formSecret": "91wzO6ndE2bI3IN7CzTpWGL4JvLtmQPvNO8f/NlH/vB=",
- "accountFieldName": "Email",
- "createAccountIfNotExist": true
}, - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Create a new campaign for a tenant.
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 |
description | string or null Description of the campaign. Only ASCII printable characters (except |
pointsTargets | Array of numbers One or more target amount of points that each participant should achieve. Please take note of the following points:
|
{- "sid": "my_campaign",
- "name": "Campaign A",
- "description": "Description for campaign A",
- "pointsTargets": [
- 50,
- 100
]
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "my_campaign",
- "name": "Campaign A",
- "description": "This is Campaign A",
- "tenantId": "2e4e61bd-2ef3-4053-9666-568b4581b081",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "pointsTargets": [
- 50,
- 100
]
}
}
Management
Retrieve details for all campaigns associated to a specific tenant.
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. |
{- "data": [
- {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "my_campaign",
- "name": "Campaign A",
- "description": "This is Campaign A",
- "tenantId": "2e4e61bd-2ef3-4053-9666-568b4581b081",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "pointsTargets": [
- 50,
- 100
]
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Retrieve details for a specific campaign
campaignId required | any Campaign ID |
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "my_campaign",
- "name": "Campaign A",
- "description": "This is Campaign A",
- "tenantId": "2e4e61bd-2ef3-4053-9666-568b4581b081",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "pointsTargets": [
- 50,
- 100
]
}
}
Management
Update an existing campaign for a tenant.
campaignId required | any Campaign ID |
Payload for updating a campaign. Either name or description should be provided.
name | string Name of the campaign. Only ASCII printable characters (except |
description | string or null Description of the campaign. Only ASCII printable characters (except |
pointsTargets | Array of numbers One or more target amount of points that each participant should achieve. Please take note of the following points:
|
{- "name": "Campaign A",
- "description": "Description for campaign A",
- "pointsTargets": [
- 50,
- 100
]
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "my_campaign",
- "name": "Campaign A",
- "description": "This is Campaign A",
- "tenantId": "2e4e61bd-2ef3-4053-9666-568b4581b081",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "pointsTargets": [
- 50,
- 100
]
}
}
Operations
Create an account for a specified campaign. The account created will automatically be whitelisted for the campaign.
campaignId required | any Campaign ID |
Payload for creating an account for a specified campaign.
identifier required | string Identifier value. Only ASCII printable characters (except 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
A maximum of 20 metadata key-value pairs are allowed. |
{- "identifier": "user@example.com",
- "metadata": {
- "team": "rocket"
}
}
{- "data": {
- "identifier": "test@example.com",
- "accountCampaignDetails": [
- {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "campaignName": "My Campaign",
- "campaignDescription": "My Campaign Description",
- "campaignSid": "my_campaign",
- "isActive": true,
- "metadata": {
- "team": "rocket"
}, - "tenantId": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "balance": 100,
- "expiries": [
- {
- "remainingPoints": 100,
- "initialPoints": 300,
- "expireAt": "2024-03-06T00:00:00+08:00"
}
], - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "totalPointsCredited": 100,
- "tier": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
]
}
}
Operations
Update an account for a specified campaign. Currently only the account metadata can be updated.
campaignId required | any Campaign ID |
Payload for updating an account for a specified campaign.
identifier required | string Identifier value. Only ASCII printable characters (except 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
A maximum of 20 metadata key-value pairs are allowed. |
{- "identifier": "user@example.com",
- "metadata": {
- "team": "rocket"
}
}
{- "data": {
- "identifier": "test@example.com",
- "accountCampaignDetails": [
- {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "campaignName": "My Campaign",
- "campaignDescription": "My Campaign Description",
- "campaignSid": "my_campaign",
- "isActive": true,
- "metadata": {
- "team": "rocket"
}, - "tenantId": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "balance": 100,
- "expiries": [
- {
- "remainingPoints": 100,
- "initialPoints": 300,
- "expireAt": "2024-03-06T00:00:00+08:00"
}
], - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "totalPointsCredited": 100,
- "tier": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
]
}
}
Retrieve all accounts for a specific campaign.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "identifier": "test@example.com",
- "isActive": true,
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Operations
Create a list of accounts for a specified campaign. The accounts created will automatically be whitelisted for the campaign.
campaignId required | any Campaign ID |
Payload for creating accounts for a specified campaign.
required | Array of objects (CreateAccountDTO) |
{- "accounts": [
- {
- "identifier": "user@example.com",
- "metadata": {
- "team": "rocket"
}
}
]
}
{- "data": {
- "totalRecords": 0,
- "totalSuccessfulRecords": 0,
- "totalFailedRecords": 0,
- "successRecords": [
- {
- "identifier": "test@example.com",
- "accountCampaignDetails": [
- {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "campaignName": "My Campaign",
- "campaignDescription": "My Campaign Description",
- "campaignSid": "my_campaign",
- "isActive": true,
- "metadata": {
- "team": "rocket"
}, - "tenantId": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "balance": 100,
- "expiries": [
- {
- "remainingPoints": 100,
- "initialPoints": 300,
- "expireAt": "2024-03-06T00:00:00+08:00"
}
], - "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "totalPointsCredited": 100,
- "tier": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
]
}
], - "failedRecords": [
- {
- "account": {
- "identifier": "user@example.com",
- "metadata": {
- "team": "rocket"
}
}, - "error": {
- "reasonCode": "duplicate_campaign_id",
- "description": "The request failed because a duplicate campaign ID was found.",
- "details": [ ]
}, - "reason": "The request failed because a duplicate campaign ID was found."
}
]
}
}
Management
Deactivate an account for a specified campaign.
campaignId required | any Campaign ID |
Payload to deactivate an account for a specified campaign.
identifier required | string Identifier value. Only ASCII printable characters (except Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed). |
{- "identifier": "user@example.com"
}
{- "data": {
- "identifier": "test@example.com",
- "isActive": true
}
}
Management
Activate an account for a specified campaign.
campaignId required | any Campaign ID |
Payload to activate an account for a specified campaign.
identifier required | string Identifier value. Only ASCII printable characters (except Note that this value will be trimmed (i.e. leading and trailing whitespaces will be removed). |
{- "identifier": "user@example.com"
}
{- "data": {
- "identifier": "test@example.com",
- "isActive": true
}
}
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:
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.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "identifier": "test@example.com",
- "rank": 1,
- "pointsEarned": 10,
- "totalPointsCredited": 100,
- "updatedAt": "2023-11-22T00:00:00+08:00"
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
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:
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.
campaignId required | any Campaign ID |
Payload with list of account identifiers to query leaderboard rank
required | Array of objects (RetrieveAccountDTO) |
{- "accounts": [
- {
- "identifier": "user@example.com"
}
]
}
{- "data": {
- "accounts": [
- {
- "identifier": "test@example.com",
- "rank": 1,
- "totalPointsCredited": 100,
- "updatedAt": "2023-11-22T00:00:00+08:00",
- "error": null
}
]
}
}
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.
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 |
{- "sender": {
- "identifier": "user@example.com",
- "campaignId": "2c1a34b1-cfd8-4066-9565-d236fcf41c70",
- "transactionDescription": "This is a transfer from/to xxx"
}, - "receiver": {
- "identifier": "user@example.com",
- "campaignId": "2c1a34b1-cfd8-4066-9565-d236fcf41c70",
- "transactionDescription": "This is a transfer from/to xxx"
}, - "points": 1
}
{- "data": {
- "sender": {
- "identifier": "test@example.com",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "transaction": {
- "transactionId": "zyhIpbOeNYCcxOwg",
- "type": "TRANSFER_OUT",
- "description": "This is a transfer to xxx",
- "createdAt": "2024-09-20T11:16:08+08:00",
- "updatedAt": "2024-09-20T11:16:08+08:00",
- "campaignId": "133a6a51-478f-46ca-bc92-013e441d9ae1",
- "points": -1,
- "status": "SUCCESSFUL"
}
}, - "receiver": {
- "identifier": "test@example.com",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "transaction": {
- "transactionId": "eavofLTFNYdihgzy",
- "type": "TRANSFER_IN",
- "description": "This is a transfer from xxx",
- "createdAt": "2024-09-20T11:16:08+08:00",
- "updatedAt": "2024-09-20T11:16:08+08:00",
- "campaignId": "133a6a51-478f-46ca-bc92-013e441d9ae1",
- "points": 1,
- "status": "SUCCESSFUL"
}, - "validity": {
- "campaignId": "133a6a51-478f-46ca-bc92-013e441d9ae1",
- "createdAt": "2024-09-20T11:16:08+08:00",
- "updatedAt": "2024-09-20T11:16:08+08:00",
- "totalPoints": 1,
- "expireAt": null,
- "effectiveAt": "2024-09-20T11:16:08+08:00",
- "description": "This is a transfer from xxx"
}
}
}
}
Management
Retrieve metrics for a campaign.
campaignId required | any Campaign ID |
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. |
{- "metricsToInclude": [
- "ACCOUNTS"
], - "fromDate": "2025-01-01T00:00:00+08:00",
- "toDate": "2025-01-31T23:59:59+08:00"
}
{- "data": {
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "accounts": {
- "total": 1000,
- "activeCount": 850,
- "newCount": 950
}, - "actions": [
- {
- "name": "walk_1000_steps",
- "data": {
- "formSG": {
- "formId": "1234567890"
}
}, - "count": 37
}
], - "redemptions": [
- {
- "name": "Item 1",
- "count": 40,
- "totalQuantityRedeemed": 60
}
], - "objectivesCompleted": [
- {
- "name": "Walk 1000 Steps",
- "count": 20
}
], - "pointsTransactions": [
- {
- "type": "ALLOT",
- "totalPoints": 1500
}
]
}
}
Management
Create a campaign tier
campaignId required | any Campaign ID |
Payload for adding a campaign tier
name required | string Name of the campaign tier. Only ASCII printable characters (except |
description | string or null Description of the campaign tier. Only ASCII printable characters (except |
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 |
{- "name": "Bronze",
- "description": "Description for the Bronze Tier",
- "isActive": true,
- "priority": 1,
- "conditions": {
- "minCreditedPoints": 1000
}
}
{- "data": {
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "description": "Description for the Bronze Tier",
- "isActive": true,
- "priority": 1,
- "conditions": {
- "minCreditedPoints": 1000
}
}
}
Management
Retrieve all campaign tiers for a campaign.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "description": "Description for the Bronze Tier",
- "isActive": true,
- "priority": 1,
- "conditions": {
- "minCreditedPoints": 1000
}
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Update campaign tier for a campaign.
tierId required | any Campaign Tier ID |
campaignId required | any Campaign ID |
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 |
description | string or null Description of the campaign tier. Only ASCII printable characters (except |
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 |
{- "name": "Bronze",
- "description": "Description for the Bronze Tier",
- "isActive": true,
- "conditions": {
- "minCreditedPoints": 1000
}
}
{- "data": {
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Bronze",
- "description": "Description for the Bronze Tier",
- "isActive": true,
- "priority": 1,
- "conditions": {
- "minCreditedPoints": 1000
}
}
}
Management
Update priority of campaign tiers for a campaign
campaignId required | any Campaign ID |
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. |
{- "tiers": [
- {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "priority": 1
}
]
}
{- "data": {
- "tiers": [
- {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "priority": 1
}
]
}
}
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.
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. |
{- "data": [
- {
- "id": "01936e1d-7d52-7c03-8988-44eb2f8cf3b7",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "createdAt": "2023-11-24T00:00:00+08:00",
- "type": "webhook.send.failed",
- "occurredAt": "2023-11-24T00:00:00+08:00",
- "data": {
- "payload": {
- "id": "y1ioUtmcJcvZHNEm",
- "data": {
- "metAt": "2024-11-27T22:51:03+08:00",
- "identifier": "user@example.com",
- "pointsAdded": 120,
- "pointsTargets": [
- 120
]
}, - "eventType": "POINTS_TARGET_MET",
- "createdAt": "2024-11-27T22:51:03+08:00"
}, - "errorMessage": "Failed to send webhook to url https://api.agency.gov.sg/webhook. Unable to establish a connection to the destination server. This may be due to network issues, an incorrect URL, or the server being unavailable. Please verify the webhook URL and ensure the server is reachable."
}
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Create a new objectives for a campaign.
campaignId required | any Campaign ID |
Payload for creating a objective for a campaign.
name required | string Name of the objective. Only ASCII printable characters (except |
description | string or null Description of the objective. Only ASCII printable characters (except |
{- "name": "Objective A",
- "description": "Description for objective A"
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Objective A",
- "description": "This is Objective A",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Retrieve all objectives for a campaign.
campaignId required | any Campaign ID |
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 |
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. |
{- "data": [
- {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Objective A",
- "description": "This is Objective A",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "rules": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "objectiveId": "9729fc3f-5c5d-41ad-92e2-01caa0af3dba",
- "createdAt": "2023-11-24T00:00:00+08:00",
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "type": "ALLOTMENT",
- "updatedAt": "2023-11-24T00:00:00+08:00",
- "priority": 10,
- "engineVersion": 1,
- "version": 1
}
]
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Update objectives name/description for a campaign.
objectiveId required | any Objective ID |
campaignId required | any Campaign ID |
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 |
description | string or null Description of the objective. Only ASCII printable characters (except |
{- "name": "Objective A",
- "description": "Description for objective A"
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Objective A",
- "description": "This is Objective A",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Retrieve objective and its linked rules for a campaign.
objectiveId required | any Objective ID |
campaignId required | any Campaign ID |
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "name": "Objective A",
- "description": "This is Objective A",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "rules": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "objectiveId": "9729fc3f-5c5d-41ad-92e2-01caa0af3dba",
- "createdAt": "2023-11-24T00:00:00+08:00",
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "type": "ALLOTMENT",
- "updatedAt": "2023-11-24T00:00:00+08:00",
- "priority": 10,
- "engineVersion": 1,
- "version": 1
}
]
}
}
Operations
Allot points to corresponding account with effective date and expiry date.
campaignId required | any Campaign ID |
Payload to allot points.
identifier required | string Identifier value. Only ASCII printable characters (except 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 |
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). |
{- "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"
}
{- "data": {
- "identifier": "test@example.com",
- "transaction": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "description": "This transaction is for xxx",
- "transactionId": "Dz7WaF1Q4QnSrXuq",
- "type": "ALLOT",
- "points": 100,
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "status": "SUCCESSFUL"
}, - "validity": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "effectiveAt": "2023-11-22T16:57:12+08:00",
- "expireAt": "2023-11-22T00:00:00+08:00",
- "totalPoints": 100,
- "description": "This allotment is for xxx"
}
}
}
Operations
Deduct points from a corresponding account
campaignId required | any Campaign ID |
Payload to deduct points.
identifier required | string Identifier value. Only ASCII printable characters (except 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 |
pointsToDeduct required | number Points to deduct. The value of pointsToDeduct must be an integer between 1 and 1,000,000 |
{- "identifier": "user@example.com",
- "description": "This deduction is for xxx",
- "pointsToDeduct": 100
}
{- "data": {
- "identifier": "test@example.com",
- "transaction": {
- "transactionId": "zyhIpbOeNYCcxOwg",
- "type": "DEDUCT",
- "description": "This is a deduction for xxx",
- "createdAt": "2024-09-20T11:16:08+08:00",
- "updatedAt": "2024-09-20T11:16:08+08:00",
- "campaignId": "133a6a51-478f-46ca-bc92-013e441d9ae1",
- "points": -100,
- "status": "SUCCESSFUL"
}
}
}
Operations
Allot points to corresponding accounts with effective date and expiry date.
campaignId required | any Campaign ID |
Payload to allot points for a list of accounts
description required | string or null Description of the allotment. Only ASCII printable characters (except |
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) |
{- "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": [
- {
- "identifier": "user@example.com"
}
]
}
{- "data": {
- "totalRecords": 0,
- "totalSuccessfulRecords": 0,
- "totalFailedRecords": 0,
- "successRecords": [
- {
- "identifier": "test@example.com",
- "transaction": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "description": "This transaction is for xxx",
- "transactionId": "Dz7WaF1Q4QnSrXuq",
- "type": "ALLOT",
- "points": 100,
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "status": "SUCCESSFUL"
}, - "validity": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "effectiveAt": "2023-11-22T16:57:12+08:00",
- "expireAt": "2023-11-22T00:00:00+08:00",
- "totalPoints": 100,
- "description": "This allotment is for xxx"
}
}
], - "failedRecords": [
- {
- "account": {
- "identifier": "user@example.com"
}, - "error": {
- "reasonCode": "account_not_found",
- "description": "The requested account could not be found.",
- "details": [ ]
}, - "reason": "The requested account could not be found."
}
]
}
}
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.
transactionId required | string |
campaignId required | any Campaign ID |
{- "data": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "description": "This transaction is for xxx",
- "transactionId": "Dz7WaF1Q4QnSrXuq",
- "type": "ALLOT",
- "points": 100,
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "status": "SUCCESSFUL",
- "additionalData": {
- "entity": "ACCOUNT_OBJECTIVE",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "objectiveName": "Objective A"
}
}
}
Management
Create a new redemption item for a campaign. The provider specified needs to be configured first before creating the redemption item
campaignId required | any Campaign ID |
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 |
description | string or null Description of the redemption item. Only ASCII printable characters (except |
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. |
{- "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": {
- "categoryId": "364754a0-0a84-4390-b413-333c04d22b07"
}, - "conditions": [
- {
- "name": "string",
- "operator": "equal",
- "value": "string"
}
]
}
{- "data": {
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "bag",
- "name": "Bag",
- "description": "Best bag in the world!",
- "pointsToRedeem": 1,
- "perAccountRedeemQuota": 1,
- "cashInCents": 50,
- "quantityAvailable": 1,
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "isActive": true,
- "provider": "GOVWALLET",
- "type": "POINTS_TO_ITEM",
- "providerItemConfig": {
- "categoryId": "364754a0-0a84-4390-b413-333c04d22b07"
}, - "conditions": [
- {
- "name": "string",
- "operator": "equal",
- "value": "string"
}
], - "createdAt": "2023-11-24T00:00:00+08:00",
- "updatedAt": "2023-11-24T00:00:00+08:00"
}
}
Operations
Retrieve all redemption items for a campaign.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "bag",
- "name": "Bag",
- "description": "Best bag in the world!",
- "pointsToRedeem": 1,
- "perAccountRedeemQuota": 1,
- "cashInCents": 50,
- "quantityAvailable": 1,
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "isActive": true,
- "provider": "GOVWALLET",
- "type": "POINTS_TO_ITEM",
- "providerItemConfig": {
- "categoryId": "364754a0-0a84-4390-b413-333c04d22b07"
}, - "conditions": [
- {
- "name": "string",
- "operator": "equal",
- "value": "string"
}
], - "createdAt": "2023-11-24T00:00:00+08:00",
- "updatedAt": "2023-11-24T00:00:00+08:00"
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Update redemption item for a campaign.
campaignId required | any Campaign ID |
redemptionItemId required | any Redemption Item ID |
Payload for updating a redemption item.
name | string Name of the redemption item. Only ASCII printable characters (except |
description | string or null Description of the redemption item. Only ASCII printable characters (except |
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 |
{- "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": [
- {
- "name": "string",
- "operator": "equal",
- "value": "string"
}
], - "providerItemConfig": {
- "categoryId": "364754a0-0a84-4390-b413-333c04d22b07"
}
}
{- "data": {
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "bag",
- "name": "Bag",
- "description": "Best bag in the world!",
- "pointsToRedeem": 1,
- "perAccountRedeemQuota": 1,
- "cashInCents": 50,
- "quantityAvailable": 1,
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "isActive": true,
- "provider": "GOVWALLET",
- "type": "POINTS_TO_ITEM",
- "providerItemConfig": {
- "categoryId": "364754a0-0a84-4390-b413-333c04d22b07"
}, - "conditions": [
- {
- "name": "string",
- "operator": "equal",
- "value": "string"
}
], - "createdAt": "2023-11-24T00:00:00+08:00",
- "updatedAt": "2023-11-24T00:00:00+08:00"
}
}
Operations
Retrieve redemption item details by its specific id
redemptionItemId required | any Redemption Item ID |
campaignId required | any Campaign ID |
{- "data": {
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "sid": "bag",
- "name": "Bag",
- "description": "Best bag in the world!",
- "pointsToRedeem": 1,
- "perAccountRedeemQuota": 1,
- "cashInCents": 50,
- "quantityAvailable": 1,
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "isActive": true,
- "provider": "GOVWALLET",
- "type": "POINTS_TO_ITEM",
- "providerItemConfig": {
- "categoryId": "364754a0-0a84-4390-b413-333c04d22b07"
}, - "conditions": [
- {
- "name": "string",
- "operator": "equal",
- "value": "string"
}
], - "createdAt": "2023-11-24T00:00:00+08:00",
- "updatedAt": "2023-11-24T00:00:00+08:00"
}
}
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.
campaignId required | any Campaign ID |
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 |
{- "provider": "GOVSUPPLY",
- "providerConfig": {
- "apiKey": "api_key_sample",
- "campaignId": "6a84888a-2374-49eb-acda-dc58facb6182"
}
}
{- "data": {
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "provider": "GOVSUPPLY",
- "providerConfig": {
- "campaignId": "wog_example",
- "environment": "govstaff",
- "benefactorId": "GOVTECH"
}, - "createdAt": "2023-11-24T00:00:00+08:00",
- "updatedAt": "2023-11-24T00:00:00+08:00"
}
}
Management
Retrieve all redemption item providers for a campaign.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "provider": "GOVSUPPLY",
- "providerConfig": {
- "campaignId": "wog_example",
- "environment": "govstaff",
- "benefactorId": "GOVTECH"
}, - "createdAt": "2023-11-24T00:00:00+08:00",
- "updatedAt": "2023-11-24T00:00:00+08:00"
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Update redemption item provider configuration for a specified campaign.
providerId required | any Provider ID |
campaignId required | any Campaign ID |
Payload for updating a redemption item provider configuration.
GovSupplyConfig (object) or GovWalletConfig (object) or DisbursePlusConfig (object) Provider configuration |
{- "providerConfig": {
- "apiKey": "api_key_sample",
- "campaignId": "6a84888a-2374-49eb-acda-dc58facb6182"
}
}
{- "data": {
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "campaignId": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "provider": "GOVSUPPLY",
- "providerConfig": {
- "campaignId": "wog_example",
- "environment": "govstaff",
- "benefactorId": "GOVTECH"
}, - "createdAt": "2023-11-24T00:00:00+08:00",
- "updatedAt": "2023-11-24T00:00:00+08:00"
}
}
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.
campaignId required | any Campaign ID |
x-idempotency-key required | string Idempotency Key. Must be a valid uuid. Refer to the section "Idempotency" for more information. |
identifier required | string Identifier value. Only ASCII printable characters (except 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 |
{- "identifier": "user@example.com",
- "redemptionItemId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "quantityToRedeem": 1,
- "additionalData": {
- "amiInCents": 100000,
- "trancheNumber": 1
}
}
{- "data": {
- "identifier": "user@example.com",
- "externalReferenceId": "2-0UQYi8RLz4kPjkWZ",
- "quantity": "1",
- "redemptionItemId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "transaction": {
- "campaignId": "8bc8887b-87a0-46d2-b971-3d86b7652ad5",
- "description": "This transaction is for xxx",
- "transactionId": "Dz7WaF1Q4QnSrXuq",
- "type": "ALLOT",
- "points": 100,
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "status": "SUCCESSFUL"
}, - "providerRedemptionStatus": "SUCCESSFUL",
- "providerErrorMessage": "Unable to redeem item from provider GOVSUPPLY. Provider error message: {\"message\":\"\"}",
- "isRolledBack": false
}
}
Management
Retrieve rules for a campaign.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "objectiveId": "9729fc3f-5c5d-41ad-92e2-01caa0af3dba",
- "createdAt": "2023-11-24T00:00:00+08:00",
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "type": "ALLOTMENT",
- "updatedAt": "2023-11-24T00:00:00+08:00",
- "priority": 10,
- "engineVersion": 1,
- "version": 1
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Create a new rule for a campaign.
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:
maxTries
, set recurrenceType
to DAILY
and leave recurrenceSchedule
empty.recurrenceType
to WEEKLY
and recurrenceSchedule.dayOfWeek
to 3
.recurrenceType
to MONTHLY
and recurrenceSchedule.dayOfMonth
to 15
. 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:
"pointsExpiryStrategy": {
"expireAt": "2023-11-23T00:00:00+08:00"
}
"pointsExpiryStrategy": {
"relativeExpiryDuration": "P1D"
}
Concrete examples for relativeExpiryDuration:
Assume points are allotted on 2025-01-24T10:00:00+08:00
P1D
(1 day):
Points will expire on 2025-01-26T00:00:00+08:00
P1W
(1 week):
Points will expire on 2025-02-01T00:00:00+08:00
P1M
(1 month):
Points will expire on 2025-02-25T00:00:00+08:00
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).
campaignId required | any Campaign ID |
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 |
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. |
{- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "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
}
{- "data": {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "objectiveId": "9729fc3f-5c5d-41ad-92e2-01caa0af3dba",
- "createdAt": "2023-11-24T00:00:00+08:00",
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "type": "ALLOTMENT",
- "updatedAt": "2023-11-24T00:00:00+08:00",
- "priority": 10,
- "engineVersion": 1,
- "version": 1
}
}
Management
Update rule for a campaign.
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:
maxTries
, set recurrenceType
to DAILY
and leave recurrenceSchedule
empty.recurrenceType
to WEEKLY
and recurrenceSchedule.dayOfWeek
to 3
.recurrenceType
to MONTHLY
and recurrenceSchedule.dayOfMonth
to 15
. 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:
"pointsExpiryStrategy": {
"expireAt": "2023-11-23T00:00:00+08:00"
}
"pointsExpiryStrategy": {
"relativeExpiryDuration": "P1D"
}
Concrete examples for relativeExpiryDuration:
Assume points are allotted on 2025-01-24T10:00:00+08:00
P1D
(1 day):
Points will expire on 2025-01-26T00:00:00+08:00
P1W
(1 week):
Points will expire on 2025-02-01T00:00:00+08:00
P1M
(1 month):
Points will expire on 2025-02-25T00:00:00+08:00
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).
ruleId required | any Rule ID |
campaignId required | any Campaign ID |
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 |
{- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "effectiveAt": "2023-11-23T00:00:00+08:00",
- "expireAt": "9999-12-31T23:59:59+08:00",
- "priority": 1
}
{- "data": {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "objectiveId": "9729fc3f-5c5d-41ad-92e2-01caa0af3dba",
- "createdAt": "2023-11-24T00:00:00+08:00",
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "type": "ALLOTMENT",
- "updatedAt": "2023-11-24T00:00:00+08:00",
- "priority": 10,
- "engineVersion": 1,
- "version": 1
}
}
Management
Retrieve history of changes for a rule of a campaign.
ruleId required | any Rule ID |
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "objectiveId": "9729fc3f-5c5d-41ad-92e2-01caa0af3dba",
- "createdAt": "2023-11-24T00:00:00+08:00",
- "effectiveAt": "2023-11-24T00:00:00+08:00",
- "expireAt": "2023-11-24T00:00:00+08:00",
- "id": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "ruleJSON": {
- "points": 10,
- "maxTries": 1,
- "maxTriesResetStrategy": {
- "recurrenceType": "DAILY",
- "recurrenceSchedule": {
- "dayOfWeek": 1,
- "dayOfMonth": 1
}
}, - "conditions": "{\"all\": [{\"fact\": \"action\", \"operator\": \"equal\", \"value\": \"walk_10000_steps\"}]}",
- "pointsExpiryStrategy": {
- "expireAt": "2023-11-23T00:00:00+08:00",
- "relativeExpiryDuration": "P1D"
}
}, - "type": "ALLOTMENT",
- "updatedAt": "2023-11-24T00:00:00+08:00",
- "priority": 10,
- "engineVersion": 1,
- "version": 1
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Grant access of a specified tenant resources to a partner
Payload for granting tenant access to a partner.
partnerId required | string The identifier of the partner |
{- "partnerId": "00e3a7a7-d1bc-429f-9fde-aa7b6108e980"
}
{- "data": {
- "tenantId": "e4da9e30-e443-46f5-a770-e2618d092740",
- "partner": {
- "id": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "sid": "upstream_partner",
- "name": "Upstream Partner",
- "description": "This is an Upstream Partner"
}, - "createdAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Revoke access of a specified tenant resources from a partner.
Payload for revoking tenant access from a partner.
partnerId required | string The identifier of the partner |
{- "partnerId": "00e3a7a7-d1bc-429f-9fde-aa7b6108e980"
}
{- "error": {
- "reasonCode": "validation_error",
- "description": "The request could not be processed due to invalid or missing parameters, or issues with the request body.",
- "details": [
- {
- "property": "fieldA",
- "message": "Must be between 1 and 35 characters and must not contain any invalid characters"
}, - {
- "property": "items.2.fieldB",
- "message": "Must be between 1 and 35 characters and must not contain any invalid characters"
}
]
}, - "requestId": "064afbca-5c14-4e27-a92b-b1f76a6d14d3"
}
Management
Retrieve all partners that can access this specified tenant.
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. |
{- "data": [
- {
- "tenantId": "e4da9e30-e443-46f5-a770-e2618d092740",
- "partner": {
- "id": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "sid": "upstream_partner",
- "name": "Upstream Partner",
- "description": "This is an Upstream Partner"
}, - "createdAt": "2023-11-22T16:57:12+08:00"
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
{- "data": {
- "id": "f0ace06c-ae34-4998-9cbd-6aeb384e7710",
- "sid": "my_tenant",
- "name": "My Tenant",
- "description": "This is Tenant A",
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00",
- "ownerEmail": "user@abc.gov.sg",
- "credentials": [
- {
- "clientId": "<CLIENT_ID>",
- "clientSecret": "<CLIENT_SECRET>",
- "createdAt": "2023-11-22T16:57:12+08:00"
}
]
}
}
Management
Generate new credential for specified tenant.
{- "data": {
- "clientId": "<CLIENT_ID>",
- "clientSecret": "<CLIENT_SECRET>",
- "createdAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Delete existing credential for specified tenant.
clientId required | string <uuid> The unique identifier of the client |
{- "clientId": "5e505642-9024-474d-9434-e5a44f505cc5"
}
{- "error": {
- "reasonCode": "validation_error",
- "description": "The request could not be processed due to invalid or missing parameters, or issues with the request body.",
- "details": [
- {
- "property": "fieldA",
- "message": "Must be between 1 and 35 characters and must not contain any invalid characters"
}, - {
- "property": "items.2.fieldB",
- "message": "Must be between 1 and 35 characters and must not contain any invalid characters"
}
]
}, - "requestId": "064afbca-5c14-4e27-a92b-b1f76a6d14d3"
}
Management
Register a webhook
campaignId required | any Campaign ID |
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 |
enabledEvents required | Array of strings Items Enum: "OBJECTIVE_COMPLETED" "POINTS_TARGET_MET" "ACCOUNT_TIER_UPDATED" List of enabled events for the webhook |
{- "description": "Description for campaign webhook",
- "enabledEvents": [
- "OBJECTIVE_COMPLETED"
]
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "description": "This is Webhook A",
- "enabledEvents": [
- "OBJECTIVE_COMPLETED"
], - "isActive": true,
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Retrieve all webhooks for a campaign.
campaignId required | any Campaign ID |
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. |
{- "data": [
- {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "description": "This is Webhook A",
- "enabledEvents": [
- "OBJECTIVE_COMPLETED"
], - "isActive": true,
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
], - "pagination": {
- "count": 1,
- "limit": 10,
- "offset": 0,
- "total": 1
}
}
Management
Retrieve webhook for a campaign.
webhookId required | any Webhook ID |
campaignId required | any Campaign ID |
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "description": "This is Webhook A",
- "enabledEvents": [
- "OBJECTIVE_COMPLETED"
], - "isActive": true,
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
Management
Update webhook for a campaign.
webhookId required | any Webhook ID |
campaignId required | any Campaign ID |
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 |
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 |
{- "description": "Description for campaign webhook",
- "enabledEvents": [
- "OBJECTIVE_COMPLETED"
], - "isActive": true
}
{- "data": {
- "id": "f39854be-46f2-492f-9dd8-042e5719f05f",
- "campaignId": "0610a0ee-6ceb-45ef-8255-f25580b12356",
- "description": "This is Webhook A",
- "enabledEvents": [
- "OBJECTIVE_COMPLETED"
], - "isActive": true,
- "createdAt": "2023-11-22T16:57:12+08:00",
- "updatedAt": "2023-11-22T16:57:12+08:00"
}
}
Ask Spoon