Skip to main content
PUT
/
sandbox
/
connections
/
accounts
JavaScript
import Finch from '@tryfinch/finch-api';

const client = new Finch({
  accessToken: 'My Access Token',
});

const account = await client.sandbox.connections.accounts.update({ connection_status: 'reauth' });

console.log(account.account_id);
from finch import Finch

client = Finch(
access_token="My Access Token",
)
account = client.sandbox.connections.accounts.update(
connection_status="reauth",
)
print(account.account_id)
package main

import (
"context"
"fmt"

"github.com/Finch-API/finch-api-go"
"github.com/Finch-API/finch-api-go/option"
"github.com/Finch-API/finch-api-go/shared"
)

func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
account, err := client.Sandbox.Connections.Accounts.Update(context.TODO(), finchgo.SandboxConnectionAccountUpdateParams{
ConnectionStatus: finchgo.F(shared.ConnectionStatusTypeReauth),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", account.AccountID)
}
package com.tryfinch.api.example;

import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.AccountUpdateResponse;
import com.tryfinch.api.models.SandboxConnectionAccountUpdateParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();

AccountUpdateResponse account = client.sandbox().connections().accounts().update();
}
}
package com.tryfinch.api.example

import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.AccountUpdateResponse
import com.tryfinch.api.models.SandboxConnectionAccountUpdateParams

fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()

val account: AccountUpdateResponse = client.sandbox().connections().accounts().update()
}
require "finch_api"

finch = FinchAPI::Client.new(access_token: "My Access Token")

account = finch.sandbox.connections.accounts.update

puts(account)
curl --request PUT \
--url https://api.tryfinch.com/sandbox/connections/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_status": "reauth"
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/sandbox/connections/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'connection_status' => 'reauth'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
  "connection_id": "a237a1c3-1a5e-44ae-a8fd-81f76fd715c2",
  "entity_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
  "company_id": "b2e6a1c3-1a5e-44ae-a8fd-81f76fd715cf",
  "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
  "provider_id": "gusto",
  "authentication_type": "credential",
  "products": [
    "company"
  ]
}

Authorizations

Authorization
string
header
required

Please use your Access Token

Body

application/json
connection_status
enum<string>
Available options:
pending,
processing,
connected,
error_no_account_setup,
error_permissions,
reauth

Response

200 - application/json

OK

connection_id
string<uuid>
required

The ID of the new connection

entity_id
string<uuid>
required

The ID of the entity whose status was updated

account_id
string<uuid>
required
deprecated

[DEPRECATED] Use connection_id to associate a connection with an access token

authentication_type
enum<string>
required
Available options:
credential,
api_token,
oauth,
assisted
company_id
string<uuid>
required

The Finch UUID of the company associated with the access_token.

provider_id
string
required

The ID of the provider associated with the access_token

products
string[]
required