Create link token ​
Link tokens allow your customers to connect their apps with Truto. Link tokens are used to initiate a connection flow handled by Truto and the end of this connection flow, an Integrated Account is created. This integrated account acts as a link between your Truto account and the app your customer has connected. To create a link token, you need to specify a tenant_id
in the request body which acts as a lookup key for an integrated account. In most cases, you can just use your customer's primary key or unique ID as the tenant_id
.
TIP
Tenant IDs do NOT need to be unique. For example, one of your customers could connect multiple apps to your Truto account. You could still use the customer's primary key as tenant_id
for all the apps that they connect and look them all up using the customer's primary key.
Reauthorizing an integrated account ​
An integrated account can be reauthorized by creating a link token for it. Instead of tenant_id
, you need to specify the id
of the integrated account you need to reauthorize as the integrated_account_id
attribute in the request body. Do NOT specify tenant_id
. You can use it similar to other link tokens, with the only difference being that the customer will automatically land on the specific integration's page in Truto's connection UI and will be asked to proceed with connecting the application. After the connection flow completes, the new credentials will be updated in the integrated account.
Endpoint ​
POST /link-token
Request Body ​
The ID of the tenant you want to create a link token for. Required if you are creating a link token for a new integrated account.
acme-1
The ID of the integrated account you want to reauthorize. Do NOT specify tenant_id
if you are reauthorizing an integrated account.
1ba1f401-7183-47c5-9e39-e8e257e3c795
The context of the integrated account. You can find these in the Variables
section of an integrated account in the Truto UI.
{
"label": "Production Hubspot Account"
}
The URI where the user should be redirected after the connection flow is complete. This is especially useful when you are authenticating via a Desktop app.
https://example.com/redirect
If set to true, the context of the integrated account will be persisted when reconnecting. Set to false by default.
Response Body ​
The link token that can be used to initiate a connection flow.
efe6413c-941a-4ca6-8f22-defbf758b824