Skip to main content

Refresh Wallet CSAT API

Overview​

The Refresh Wallet CSAT API allows your application to refresh a user's CSAT using a valid refresh token.

This endpoint is used when:

  • The user's current CSAT is expired or about to expire
  • You want to obtain a new CSAT token along with updated concurrency limits

Endpoint​

POST /wlt/refresh/csat

Authentication​

This API requires the user to be authenticated with a valid refresh token.

Include the token in the request body.


Required Headers​

HeaderValue
Content-Typeapplication/json
Acceptapplication/json

Request Body​

Fields​

FieldRequiredDescription
refresh_tokenYesCSAT refresh token issued earlier
nonceYesUnique value binding this refresh to the device_id
expNoToken expiration in seconds (default 2 weeks)
include_asset_claimsNoIf true, include recent entitlements -- see below
asset_claimsNoSigned claims to include directly -- see below

Example Request​

{
"refresh_token": "eyJ1c...",
"nonce": "unique-device-id"
}

Optimistic Access to Media​

If the user has any asynchronous Entitlement Creations in flight, they can get immediate access to that media.

To enable this feature, after a new entitlement, initiate a user refresh with include_asset_claims: true set on the POST body. This looks up the user's recent entitlements and includes signed assertions in the response token about any it finds.

Have the user start using the fresh CSAT -- these inline claim assertions enable immediate playout access to the media.

Only set this flag on a refresh that follows a entitlement/purchase/grant -- not on every routine token refresh.

To include only specific purchases, send their claims in asset_claims instead. See Optimistic Access to Media for both approaches and how they differ.


Curl Example​

curl -X POST "https://<fabric-authority-url>/wlt/refresh/csat" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"refresh_token": "abc123refresh",
"nonce": "unique-nonce-value"
}'

Response​

Success Response (HTTP 200)​

Returned when the CSAT is refreshed successfully.

Fields​

FieldDescription
user_addrUser wallet address
tokenNewly issued CSAT token
refresh_tokenNew refresh token
expires_atExpiration time of the token (milliseconds)
existing_tokensList of active tokens for this user
limitsToken concurrency limits
messageSuccess message
warningOptional warning message
errorOptional error message (if any)

Example Success Response​

{
"user_addr": "0xabc123...",
"token": "new-csat-token",
"refresh_token": "new-refresh-token",
"expires_at": 1712345678900,
"existing_tokens": [],
"limits": {
"max_tokens_per_user": 5,
"allow_empty_nonce": false,
"issuer": "<issuer>"
},
"message": "",
"warning": "",
"error": ""
}

Error Responses​

Returned when the refresh token is invalid, expired, or cannot be processed.

Example Error Responses​

Bad Request (400)

{
"message": "could not decode refresh token",
"error": "token format invalid"
}
{
"message": "missing nonce"
}
{
"message": "cannot refresh stale token",
"error": "stored ULID is newer than requested"
}

Unauthorized (401)

{
"message": "refresh token has expired (max age 12 months), please re-authenticate"
}

Forbidden (403)

{
"message": "invalid nonce, cannot refresh",
"existing_tokens": [
{
"token": "old-token-1",
"expires_at": 1712345678900
}
]
}

Common Error Messages​

MessageMeaning
could not bind requestRequest JSON is invalid or malformed
could not decode refresh tokenToken is invalid or corrupted
missing nonceNonce value is required
refresh token has expiredToken is older than maximum allowed age (12 months)
invalid nonceNonce does not match active token
cannot refresh stale tokenToken is too old; requires re-authentication
could not make refresh tokenServer failed to generate a new refresh token
could not validate tokenNewly generated token could not be validated
sigProvider ulid does not match refresh token ulidSignature ULID mismatch between old and new token
sigProvider addr does not match refresh token addrSignature address mismatch between old and new token