GALANTHUS / ABI FUNCTION REFERENCE
gln_revolut_oauth_status
Declared in <galanthus/c_api/gln_capi.h>.
GLN_API gln_status_t GLN_CALL gln_revolut_oauth_status(
gln_backend_t* in_backend,
char** out_status_json,
gln_error_t* out_error);
Purpose
Returns redacted Revolut OAuth token health as caller-owned JSON.
The JSON reports whether usable token state exists and whether refresh is needed without exposing token material.
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, scope, and last_error fields.
scope contains the non-secret OAuth scope value saved from the token response when Revolut supplied one, otherwise it is an empty string.
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_revolut_oauth_status(backend, &status_json, &error);
if (rc == GLN_OK) {
render_oauth_status(status_json);
}
gln_release_string(status_json);
gln_release_error(&error);