Herald
OpenapiExt

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" }' ```

POST
/api/ext/points/{realmId}/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"
  }'

Authorization

api_key
headerX-API-Key<token>

Client-app API key (third-party external API).

Path Parameters

realmId*string

Realm ID

Request Body

application/json
  1. body

Grant points request (SDK-compatible).

bucket_id is REQUIRED: every grant must target an explicit Credit Bucket. Missing → 400 grant_bucket_required.

amount*integer
Formatint64
bucketId?|

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*string
userId*string
validityDays?|
Formatint64

Response Body

Points granted successfully

application/json
  1. response

Grant points response (SDK-compatible)

amount*integer
Formatint64
balance*integer
Formatint64
bucketId*string
expiresAt?string|null
grantedBalance*integer
Formatint64
transactionId*string
userId*string
Example Request
curl -X POST 'https://example.com/api/ext/points/string/grant' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 0,
  "reason": "string",
  "userId": "string"
}'
Example Response
{
  "amount": 0,
  "balance": 0,
  "bucketId": "string",
  "expiresAt": "string",
  "grantedBalance": 0,
  "transactionId": "string",
  "userId": "string"
}