Look up reward events
Check the XP and coins actually awarded for original reward events in a data workflow and see whether each award was reversed.
- Method
- POST
- Path
https://api.returning.ai / v1/ data-workflows/ reward-events/ lookup - Permission
- dataWorkflows
- Retries
- Read-only. Retry missing or still-processing receipts with backoff until your reconciliation window ends.
When to use this
- Reconcile your reward ledger after sending a batch to a workflow that uses reversible rewards.
- Check whether a cancellation completed for an original reward event.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- dataWorkflowsShown in the dashboard as “Data Workflows”.
Use a Community API key with dataWorkflows (Data Workflows). Keep the key on your server.
Request#
Headers#
Body#
Send only workflow_id and event_keys as JSON. The lookup is scoped to the API key's community and the supplied workflow ID. It reads receipts without awarding or reversing anything.
workflowBuilder permission.Rule24 hex characters
Eg"66f000000000000000000001"
Rule1 to 100 strings, each 1 to 512 characters after trimming
Eg["trade-1001", "trade-1002"]
curl --request POST \
--url https://api.returning.ai/v1/data-workflows/reward-events/lookup \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"workflow_id": "66f000000000000000000001",
"event_keys": ["trade-1001", "trade-1002"]
}'
Response#
A missing receipt has only event_key and found: false. A well-formed workflow ID with no matching receipts also returns 200 with found: false for every key. A found receipt includes all the fields shown in the example. Unavailable values are null, and metadata defaults to {}.
Use actual_rewards on a completed original to reconcile what was awarded. A completed reversal records that the saved award was deducted. The original actual_rewards still shows the award and the lookup shows the cancellation under reversal. Look up the original key to see both. A cancellation key has no receipt of its own.
success for a completed lookup.Eg"success"
Eg"Reward events fetched successfully"
Eg{ ... }
Rule^[a-fA-F0-9]{24}$
Eg"66f000000000000000000001"
Eg[ ... ]
Eg"trade-1001"
Ruletrue
processing, completed, or null if unavailable.Ruleprocessing, completed, null; nullable
Eg"completed"
Egfalse
null.RuleNullable
Eg"account-88"
null.RuleNullable
Eg"1001"
null.RuleNullable
Eg"2026-11-20T08:00:00.000Z"
null.RuleNullable
Eg"2026-11-20T08:05:00.000Z"
null.Eg{"xp": 100, "coins": 100}
RuleNullable
Eg100
RuleNullable
Eg100
null when unavailable.RuleNullable
Eg{ ... }
null.RuleNullable
Eg100
null.RuleNullable
Eg80
Eg{"instrument": "EURUSD"}
null if none is recorded.RuleNullable
Eg{ ... }
null.RuleNullable
Eg"cancel-trade-1001"
processing, completed, or null if unavailable.Ruleprocessing, completed, null; nullable
Eg"completed"
null.RuleNullable
Eg"2026-11-20T09:00:00.000Z"
null.RuleNullable
Eg"2026-11-20T09:04:00.000Z"
null.RuleNullable
Eg"2026-11-20T09:05:00.000Z"
Egfalse
{
"status": "success",
"message": "Reward events fetched successfully",
"data": {
"workflow_id": "66f000000000000000000001",
"results": [
{
"event_key": "trade-1001",
"found": true,
"status": "completed",
"account_id": "account-88",
"trade_id": "1001",
"occurred_at": "2026-11-20T08:00:00.000Z",
"requested_rewards": {
"xp": 100,
"coins": 100
},
"actual_rewards": {
"xp": 100,
"coins": 80,
"premium_coins": 0,
"premium_currency_id": null
},
"metadata": {
"instrument": "EURUSD"
},
"has_error": false,
"completed_at": "2026-11-20T08:05:00.000Z",
"reversal": {
"event_key": "cancel-trade-1001",
"status": "completed",
"occurred_at": "2026-11-20T09:00:00.000Z",
"claimed_at": "2026-11-20T09:04:00.000Z",
"completed_at": "2026-11-20T09:05:00.000Z",
"has_error": false
}
},
{
"event_key": "trade-1002",
"found": false
}
]
}
}
Errors#
Read meta.code for structured errors and meta.errors for invalid fields. Malformed JSON can return 400 before body validation. If your community opts into API rate limiting, a request over the limit returns 429 with meta.code: RATE_LIMITED and a Retry-After header in seconds.
Fix the request04
VALIDATION_ERRORFix the requestmeta.errors and fix the request body before retrying.AUTHENTICATION_REQUIREDFix the requestAuthorization header.API_KEY_PERMISSION_DENIEDFix the requestCOMMUNITY_ACCESS_DENIEDFix the requestFix the data01
COMMUNITY_NOT_FOUNDFix the dataRetry with backoff03
RATE_LIMITEDRetry with backoffRetry-After header before calling again.AUTHENTICATION_FAILEDRetry with backoffINTERNAL_ERRORRetry with backoffRetries
A batch can already show processed while its reward updates are still queued. For found: false or status: processing with has_error: false, retry the lookup later. Apply the same rule to a reversal still processing without an error. Record a deduction only after its reversal is completed. Flag a receipt for manual reconciliation when it reports an error or stays unresolved past your reconciliation window.
{
"meta": {
"status": "error",
"statusCode": 400,
"errors": [
{
"path": "workflow_id",
"code": "invalid_string",
"message": "workflow_id must be a 24-character hex ObjectId."
}
],
"code": "VALIDATION_ERROR"
},
"message": "API request rejected error.",
"detail": "The reward event lookup request is invalid.",
"solution": "Read error detail and try again."
}