Create a Connection

Creates a connection resource.

This API must be called using a client_credentials bearer token.

Body Params
scopes
array of objects
required
length ≥ 1

The list of scopes that the user consents to. The Data Access endpoints return data only for the scopes that you request.

scopes*
Allowed:
provider_selection
required

Provider Selection

user
object
required

Details of the end user who is consenting to data access. If you are using your own Payment Initiation Service Provider (PISP) licence, these fields are not required. Otherwise name and one of email/phone are required.

metadata
object

Optional field for adding custom key-value data to a resource. This object can contain a maximum of 10 key-value pairs, each with a key with a maximum length of 40 characters and a non-null value with a maximum length of 500 characters.

user_consent
required
hosted_page

Configuration parameters for TrueLayer's hosted page(s), which are displayed to the user during the authorization journey. The type determines which parts of the flow TrueLayer handles.

authorization_flow
object

This object contains a declaration of your UI's capabilities.
You cannot provide this if also using the hosted_page option with type=authorization_flow.

string
enum
Defaults to recurring

Determines how long access to the end user's bank data is maintained after the initial authorisation.

  • one_time — Data can only be retrieved within a single access window immediately after the user authorises with the bank. No further access is possible without a new connection.
  • recurring — Data can be retrieved repeatedly throughout the full consent window, even when the user is not actively logged in or present, without requiring the user to re-authorise with bank each time.
Allowed:
Headers
string

Used to collect and record the end-user's IP address.
The first IP address in the list will be used as the end-user IP address.
Necessary to overcome 4 calls per day rate limits.

string

Used to improve the end-user's authentication experience based on their device type.
If omitted, the User-Agent header will be used instead.
This header is only considered if the authorization_flow object in the request body is specified.

string
enum
Defaults to application/json; charset=UTF-8

Generated from available response content types

Allowed:
Responses

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Choose an example:
application/json; charset=UTF-8
application/problem+json; charset=UTF-8