Skip to main content
POST
/
connect
/
sessions
JavaScript
import Finch from '@tryfinch/finch-api';

const client = new Finch({
  clientId: '4ab15e51-11ad-49f4-acae-f343b7794375',
  clientSecret: 'My Client Secret',
});

const response = await client.connect.sessions.new({
  customer_email: 'dev@stainless.com',
  customer_id: 'x',
  customer_name: 'x',
  integration: { auth_method: 'assisted', provider: 'provider' },
  manual: true,
  minutes_to_expire: 1,
  products: ['benefits'],
  redirect_uri: 'redirect_uri',
  sandbox: 'finch',
});

console.log(response.session_id);
{
  "session_id": "550e8400-e29b-41d4-a716-446655440000",
  "connect_url": "https://connect.tryfinch.com/authorize?session=550e8400-e29b-41d4-a716-446655440000"
}
NOTE: The connect session uses Basic Auth; in the sample request above use client_id as the username and client_secret as a password. For example: Authorization: Basic <base64 encoded client_id:client_secret>

Authorizations

Authorization
string
header
required

Please use base64 encoded client_id:client_secret

Headers

Finch-API-Version
string<date>
default:2020-09-17
required

Header used to specify the version for a given API request. Current version is 2020-09-17.

Body

application/json
customer_id
string
required

Unique identifier for the customer

Required string length: 1 - 255
customer_name
string
required

Name of the customer

Required string length: 1 - 255
customer_email
string<email> | null
required

Email address of the customer

products
enum<string>[]
required

The Finch products to request access to

redirect_uri
string | null
required

The URI to redirect to after the Connect flow is completed

minutes_to_expire
number | null
required

The number of minutes until the session expires (defaults to 129,600, which is 90 days)

Required range: 1 <= x <= 129600
sandbox
enum<string> | null
required

Sandbox mode for testing

Available options:
finch,
provider
manual
boolean | null
required

Enable manual authentication mode

integration
object | null
required

Integration configuration for the connect session

Response

Created

session_id
string
required

The unique identifier for the created connect session

connect_url
string<uri>
required

The Connect URL to redirect the user to for authentication