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

const client = new Finch();

const createAccessTokenResponse = await client.accessTokens.create({ code: 'code' });

console.log(createAccessTokenResponse.connection_id);
{
  "access_token": "<string>",
  "token_type": "<string>",
  "connection_id": "<string>",
  "client_type": "development",
  "connection_type": "finch",
  "products": [
    "<string>"
  ],
  "provider_id": "<string>",
  "entity_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "customer_id": "<string>",
  "account_id": "<string>",
  "company_id": "<string>"
}

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.

Content-Type
string
default:application/json
required

Used to indicate the original media type of the resource

Body

application/json
code
string
required

The authorization code received from the authorization server

client_id
string<uuid>

The client ID for your application

client_secret
string

The client secret for your application

redirect_uri
string

The redirect URI used in the authorization request (optional)

Response

200 - application/json

Access Token

access_token
string
required

The access token for the connection

token_type
string
required

The RFC 8693 token type (Finch uses bearer tokens)

connection_id
string
required

The Finch UUID of the connection associated with the access_token

client_type
enum<string>
required

The type of application associated with a token.

Available options:
development,
production,
sandbox
connection_type
enum<string>
required

The type of the connection associated with the token.

  • provider - connection to an external provider
  • finch - finch-generated data.
Available options:
finch,
provider
products
string[]
required

An array of the authorized products associated with the access_token

provider_id
string
required

The ID of the provider associated with the access_token

entity_ids
string<uuid>[]
required

An array of entity IDs that can be accessed with this access token

customer_id
string | null

The ID of your customer you provided to Finch when a connect session was created for this connection

account_id
string
deprecated

[DEPRECATED] Use connection_id to identify the connection instead of this account ID

company_id
string
deprecated

[DEPRECATED] Use connection_id to identify the connection instead of this company ID