GALANTHUS / ABI FUNCTION REFERENCE
gln_wise_token_status
Declared in <galanthus/c_api/gln_capi.h>.
GLN_API gln_status_t GLN_CALL gln_wise_token_status(
gln_backend_t* in_backend,
char** out_status_json,
gln_error_t* out_error);
Purpose
Returns redacted Wise token state as caller-owned JSON.
The JSON reports whether token state exists without exposing the personal token.
Return
Returns GLN_OK on success and a non-OK gln_status_t value on failure.
| Type | Nullability | Ownership |
|---|---|---|
gln_status_t | value | value |
Parameters
| Name | Direction | Type | Nullability | Ownership |
|---|---|---|---|---|
in_backend | input | gln_backend_t* | nonnull | borrowed |
out_status_json | output | char** | nonnull | transferred_out |
out_error | output | gln_error_t* | nullable | caller_allocated_output |
JSON Shape
On success, out_status_json receives a JSON object with have_token, expires_at_unix_ms, needs_refresh, and last_error fields.
Wise personal tokens do not use the Revolut refresh/expiry flow, so expires_at_unix_ms is 0 and needs_refresh is false.
have_token is false when no token state has been saved. last_error is reserved for redacted status diagnostics and is null when no status error is present.
A stored token blob that decrypts but cannot be parsed fails the call with a redacted token_corrupt error instead of reporting an empty token state.
The JSON never includes token strings, key material, or authorization header values.
Ownership
Release the returned JSON string with gln_release_string.
The function clears *out_status_json to NULL before validation when the output slot itself is non-NULL.
Example
char* status_json = NULL;
gln_error_t error = {0};
gln_default_error(&error);
gln_status_t rc = gln_wise_token_status(backend, &status_json, &error);
if (rc == GLN_OK) {
render_token_status(status_json);
}
gln_release_string(status_json);
gln_release_error(&error);