Widgets V2 Auth URL Reference
Reference for the Widgets V2 auth-url request, covering authentication, the request body, the params object, and the options each widget type supports.
Widgets V2 Auth URL Reference
Your backend requests a widget URL by calling the auth-url endpoint. This page is the request reference: it lists every option the request accepts and which options each widget type supports.
For an end-to-end walkthrough — creating a widget, creating a launch client, and loading the widget URL in an iframe — see Widgets V2 Getting Started.
Keep credentials on your backendAlways call auth-url from your server. Never put your client secret, private key, or client assertions in frontend code.
Endpoint
POST https://widget-pages.moneyhub.co.uk/api/{widgetType}/auth-url
Content-Type: application/json{widgetType} in the path must match the widget's Type in Admin Portal, and the widgetId in the body must be a widget of that type. If they do not match, the request fails. The supported widget types are listed under Widget types.
Authenticating the request
The launch client authenticates with one of two methods, set by tokenEndpointAuthMethod:
client_secret_basic(the default) — used by Sandbox launch clients. Send the launch client'sclientSecret.private_key_jwt— used by Live launch clients. Send a short-lived, single-useclientAssertion(a JWT signed with your private key) and theclientAssertionType.
See Widgets V2 Getting Started for how to create each launch client type, generate a key pair, and sign a client assertion.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
widgetId | string (UUID) | Yes | The widget's Widget ID from Admin Portal. |
clientId | string | Yes | Your launch client's Client ID. |
tokenEndpointAuthMethod | string | No | client_secret_basic (default) or private_key_jwt. |
clientSecret | string | With client_secret_basic | The sandbox launch client's secret. |
clientAssertion | string | With private_key_jwt | A signed JWT client assertion. Single-use, expires after 300 seconds. |
clientAssertionType | string | With private_key_jwt | urn:ietf:params:oauth:client-assertion-type:jwt-bearer. |
sub | string | See Widget types | The Moneyhub user id whose data the widget shows. Without it, the widget runs with client-level access only. |
redirectUri | string (URI) | No | Connections-journey widgets only (connections-widget, affordability-widget): where the user returns after connecting a bank. Omit it to use the Moneyhub-hosted widget page (the default). When you send it, it must exactly match one of the widget's redirect URIs. Ignored for other widget types. |
params | object | Yes | Widget launch parameters. Send {} when you have none. See The params object. |
The user must belong to the same API business as the widget and launch client. sub works for both sandbox and live widgets. To create a user and get their user id, see API Users.
The params object
params carries per-launch values through to the widget. Send {} if you have none. The fields below are recognised; any additional fields you include are passed through to the widget unchanged.
| Field | Type | Notes |
|---|---|---|
state | string (max 1024 characters) | An opaque value passed to the widget as launchState. Use it to correlate the launch with your own records. |
userId | string | An alternative to the top-level sub for connections-journey widgets. Do not send both; sub takes precedence. |
redirectUri | string (URI) | An alternative to the top-level redirectUri. The top-level value takes precedence. |
affordabilityApplicationSalary | object | affordability-widget only, when application salary is enabled on the widget. See affordabilityApplicationSalary. |
affordabilityApplicationSalary
The partner-declared gross annual income for the application. The widget passes it through to the affordability pre-submission checks.
{
"affordabilityApplicationSalary": {
"value": 3200000,
"currency": "GBP"
}
}value: a positive integer in minor units (pence for GBP).3200000is £32,000.currency: must beGBP.
For full behaviour and scope requirements, see Pre-submission checks application salary.
Widget types
Each widget type accepts the same request body, but differs in whether it needs a user and whether it runs the connections journey (shared bank-connection flow with an OAuth return URL).
| Widget type | User required | Connections journey | Widget-specific params |
|---|---|---|---|
connections-widget | Yes | Yes | — |
affordability-widget | Yes | Yes | affordabilityApplicationSalary (when enabled) |
connections-management-widget | No | No | — |
ai-savings-widget | No | No | — |
transaction-widget | No | No | — |
transaction-search-widget | No | No | — |
- User required — the launch fails unless you send
sub(orparams.userId). For the other widgets,subis optional: send it to show a specific user's data, or omit it to run with client-level access only. - Connections journey — for
connections-widgetandaffordability-widget, the service must resolve a redirect URI for bank OAuth (stored for the widget session). You do not have to sendredirectUrion auth-url: when omitted, the service uses the Moneyhub-hosted widget page for that widget version (the same URL pre-filled under Redirect URIs). SendredirectUri(orparams.redirectUri) only when you want users to return to your own site or app after connecting a bank; it must exactly match one of the widget's registered redirect URIs. Launch fails withMissing redirectUri for {widgetType} launch...only when the service cannot resolve a redirect URI (for example, the widget has no deployable version). Other widget types ignoreredirectUri.
Examples
Sandbox widget (client secret)
A transaction-widget launched for a specific user:
curl -X POST "https://widget-pages.moneyhub.co.uk/api/transaction-widget/auth-url" \
-H "Content-Type: application/json" \
-d '{
"widgetId": "YOUR-WIDGET-ID",
"clientId": "YOUR-LAUNCH-CLIENT-ID",
"clientSecret": "YOUR-LAUNCH-CLIENT-SECRET",
"sub": "MONEYHUB-USER-ID",
"params": {}
}'Live connections widget (private key JWT)
A connections-widget, which always needs a user. Omit redirectUri to keep users on the Moneyhub-hosted page after bank connection, or set it to your own callback URL (see Choosing a redirect URI):
curl -X POST "https://widget-pages.moneyhub.co.uk/api/connections-widget/auth-url" \
-H "Content-Type: application/json" \
-d '{
"widgetId": "YOUR-WIDGET-ID",
"clientId": "YOUR-LAUNCH-CLIENT-ID",
"tokenEndpointAuthMethod": "private_key_jwt",
"clientAssertion": "YOUR-CLIENT-ASSERTION",
"clientAssertionType": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"sub": "MONEYHUB-USER-ID",
"params": {}
}'Affordability widget with application salary
An affordability-widget that passes the application salary through to the pre-submission checks:
curl -X POST "https://widget-pages.moneyhub.co.uk/api/affordability-widget/auth-url" \
-H "Content-Type: application/json" \
-d '{
"widgetId": "YOUR-WIDGET-ID",
"clientId": "YOUR-LAUNCH-CLIENT-ID",
"clientSecret": "YOUR-LAUNCH-CLIENT-SECRET",
"sub": "MONEYHUB-USER-ID",
"redirectUri": "https://your-site.example/callback",
"params": {
"affordabilityApplicationSalary": {
"value": 3200000,
"currency": "GBP"
}
}
}'Response
A successful request returns the widget URL:
{
"data": {
"widgetUrl": "https://..."
}
}Pass widgetUrl to your frontend and set it as the src of an iframe. The URL contains a short-lived token, so load it straight away and request a new one for each user session. See Use the widget URL.
Errors
A failed request returns 400 Bad Request with a message describing the problem.
| Message | Cause |
|---|---|
Widget type path value does not match widget configuration | The {widgetType} in the path is not the type of the widget identified by widgetId. |
Missing user for {widgetType} launch. Provide sub in request body or params.userId. | A connections-journey widget (connections-widget, affordability-widget) was launched without a user. |
invalid_redirect_uri | The redirectUri does not exactly match one of the widget's registered redirect URIs. |
Widget is missing a runtime client | The widget has no runtime client configured. Contact your Moneyhub representative. |
Widget configuration is missing authentication scopes | The widget configuration is incomplete. Contact your Moneyhub representative. |
The request body is also validated: a missing required field, an unknown field, or the wrong authentication fields for the chosen tokenEndpointAuthMethod return 400 Bad Request.
Updated 1 day ago
