Grant points to a user account (SDK)
Grants points to a user's account from a third-party application. Returns transaction details including the new balance. # Authentication Requires valid API Key via X-API-Key header # Realm Isolation The API key must belong to the same realm as the requested realm. Cross-realm requests will return 403 Forbidden. # Example ```bash curl -X POST \ https://api.example.com/api/ext/points/realm123/grant \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "userId": "user-123", "amount": 100, "reason": "Promotional grant" }' ```
Grants points to a user's account from a third-party application. Returns transaction details including the new balance.
Authentication
Requires valid API Key via X-API-Key header
Realm Isolation
The API key must belong to the same realm as the requested realm. Cross-realm requests will return 403 Forbidden.
Example
curl -X POST \
https://api.example.com/api/ext/points/realm123/grant \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"userId": "user-123",
"amount": 100,
"reason": "Promotional grant"
}'api_keyX-API-Key<token>Client-app API key (third-party external API).
realmId*stringRealm ID
application/json- body
Grant points request (SDK-compatible).
bucket_id is REQUIRED: every grant must target an
explicit Credit Bucket. Missing → 400 grant_bucket_required.
amount*integerint64bucketId?|Required target Credit Bucket. Deserialized as Option so a missing
field yields a structured 400 grant_bucket_required body instead of
Axum's generic JSON parse error.
reason*stringuserId*stringvalidityDays?|int64Points granted successfully
application/json- response
Grant points response (SDK-compatible)
amount*integerint64balance*integerint64bucketId*stringexpiresAt?string|nullgrantedBalance*integerint64transactionId*stringuserId*stringcurl -X POST 'https://example.com/api/ext/points/string/grant' \
-H 'Content-Type: application/json' \
-d '{
"amount": 0,
"reason": "string",
"userId": "string"
}'{
"amount": 0,
"balance": 0,
"bucketId": "string",
"expiresAt": "string",
"grantedBalance": 0,
"transactionId": "string",
"userId": "string"
}