Client Credentials

The client_credentials grant supports 2 use cases:

  • Generating a token for for creating, deleting or reading users that have been created using your oauth client credentials The scopes that can be requested are user:create, user:read and user:delete
  • Generating a token to access a specific user’s data (e.g. accounts, transactions). The sub query parameter is required

To get a client credentials token, you'll need to call our /token end point - see our authentication documentation for how to authenticate against this end point - and pass in the following body, along with any authentication fields specified in the authentication document:

Field

Type

Description

grant_type

string

Will always be client_credentials for this instance

scope

string

The scopes you wish to request for the access token

Example of a client_credentials grant for data access

// @mft/moneyhub-api-client
const {access_token} = await moneyhub.getClientCredentialTokens({
  scope: "accounts:read transactions:read:all",
  userId: "example-user-id"
})