Connect API v2 (BETA)
This API handles the lifecycle of Connections inside Flanks.
Endpoints
Connectors
List Connectors
Return all the connectors available, matching the given query.
This is a paginated endpoint. If the response returns a next_page_token, you can use it to fetch the next page using the page_token parameter in the next request. If the request does not return a next_page_token, then there are no more pages to fetch.
Headers
|
Header |
Value |
|---|---|
|
|
|
|
|
|
Body (JSON encoded)
|
Parameter |
Type |
Description |
|---|---|---|
|
|
object |
The Query object |
|
|
string |
If provided, the request will fetch the next page for this query |
(*) Mandatory Parameters
Query Object
We will return all the items that match all the fields in the query.
For each Field, if the Type is an Array, we'll return items that match any of the
values in the array. If the field contains an empty array, we will return no items.
If the query is empty, we'll return all the items.
|
Field |
Type |
Description |
|---|---|---|
|
|
[string] |
The unique identifier of the connector |
Responses
200 OK
{
"items": [{ Connector }],
"next_page_token": string | null,
}
Returns a paginated result, where items will be a list of Connectors.
400 Validation Error
{
"success": false,
"error": {
"code": "ValidationError",
"details": [
{ "error_type": string, "field": string },
...
],
},
"trace_id": string,
}
Some fields are missing or incorrect.
401 Invalid Credentials
{
"error": "Invalid credentials"
}
The Authorization header is either empty or contains an invalid or expired access_token.
500 Internal Error
{
"error": "Internal Error"
}
Sessions
Create Session
Create a new Session with the given configuration.
Headers
|
Header |
Value |
|---|---|
|
|
|
|
|
|
Body (JSON encoded)
|
Parameter |
Type |
Value |
|---|---|---|
|
|
object |
(*) Mandatory Parameters
Responses
400 Validation Error
{
"success": false,
"error": {
"code": "ValidationError",
"details": [
{ "error_type": string, "field": string },
...
],
},
"trace_id": string,
}
Some fields are missing or incorrect.
401 Invalid Credentials
{
"error": "Invalid credentials"
}
The Authorization header is either empty or contains an invalid or expired access_token.
500 Internal Error
{
"error": "Internal Error"
}
List Sessions
Return all the sessions matching the given query.
This is a paginated endpoint. If the response returns a next_page_token, you can use it
to fetch the next page using the page_token parameter in the next request. If the request
does not return a next_page_token, then there are no more pages to fetch.
Headers
|
Header |
Value |
|---|---|
|
|
|
|
|
|
Body (JSON encoded)
|
Parameter |
Type |
Description |
|---|---|---|
|
|
object |
The Query object |
|
|
string |
If provided, the request will fetch the next page for this query |
(*) Mandatory Parameters
Query Object
We will return all the items that match all the fields in the query.
For each Field, if the Type is an Array, we'll return items that match any of the
values in the array. If the field contains an empty array, we will return no items.
If the query is empty, we'll return all the items.
|
Field |
Type |
Description |
|---|---|---|
|
|
[string] |
Unique identifier for the session |
|
|
[string] |
The Status of the sesssion |
|
|
[string | null] |
Unique identifier for the connection
associated to the Session. If set to |
|
|
[string | null] |
The Error Code of the
Session. If set to |
Responses
200 OK
{
"items": [{ Session }],
"next_page_token": String | null,
}
Returns a paginated result, where items will be a list of Sessions.
400 Validation Error
{
"success": false,
"error": {
"code": "ValidationError",
"details": [
{ "error_type": string, "field": string },
...
],
},
"trace_id": string,
}
Some fields are missing or incorrect.
401 Invalid Credentials
{
"error": "Invalid credentials"
}
The Authorization header is either empty or contains an invalid or expired access_token.
500 Internal Error
{
"error": "Internal Error"
}
Data Model
Connector Model
{
"name": string,
"id": string,
}
Session Model
{
"attributes": SessionnAttributes,
"configuration": SessionConfiguration,
"connection": SessionConnection | null,
"error": SessionError | null,
}
All sessions have attributes and configuration. If the connection hasn't been stablished yet,
the field will be null. This will be the default state for new sessions.
Session Attributes
{
"created_at": string, // (ISO 8601, example: "2025-12-31T23:59:59.123456+00:00" )
"id": string,
"status": SessionStatus,
"updated_at": string, // (ISO 8601, example: "2025-12-31T23:59:59.123456+00:00" )
"url": string,
}
Session Status
It's a string that represents the current status of the session. Can have the following values:
Waiting:ProvideCredentialsWaiting:ChallengeProcessing:ProvideCredentialsProcessing:ChallengeFinished:OKFinished:Error
Session Configuration
{
"skip_psd2_notice": boolean, // Default: false
"connection_id": string | null,
"connector_id": string | null,
"context": object, // Default: {}
"expires_at": string, // (ISO 8601, example: "2025-12-31T23:59:59.123456+00:00" )
"language": string, // Default: "en"
"labels": object | null // Example: {"foo": "bar"}
"redirect_url": string,
}
Available values for language are:
- en (English)
- es (Spanish)
- fr (French)
- sv (Swedish)
The field skip_psd2_notice defaults to false. If set to true, the widget will not display the user acceptance notice, instead it will directly redirect to the PSD2 login page.
The field expires_at defaults to 15 days from the creation date.
The field connector_id will be ignored if the field connection_id is set.
This field context is an arbitrary JSON object. This field is not used by our system, but provided as a benefit of the consumer: we'll store exactly what's provided on session creation and do nothing with it. You can use this to store information that you deem useful when the user is returned to your system with a session_id. For example, you can store the id of the event that triggered the session in your system to have a reference.
This field labels is a dictionary where both the keys and the values are strings. The labels value will be copied to the connection once it's created. They will be returned when listing sessions and connections, but they can also be used for filtering the results.
Session Connection
{
"connector_id": string,
"id": string,
}
Session Error
{
"code": string,
}
Code can have the following values:
InvalidCredentialsInvalidChallengeResponseUnsupportedChallengeMethodUserInteractionNeededInternalError