JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const automated = await client.jobs.automated.create({ type: 'data_sync_all' });
console.log(automated.job_id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
automated = client.jobs.automated.create(
type="data_sync_all",
)
print(automated.job_id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go/v2"
"github.com/Finch-API/finch-api-go/v2/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
automated, err := client.Jobs.Automated.New(context.TODO(), finchgo.JobAutomatedNewParamsDataSyncAll{
Type: finchgo.F(finchgo.JobAutomatedNewParamsDataSyncAllTypeDataSyncAll),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", automated.JobID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.AutomatedCreateResponse;
import com.tryfinch.api.models.JobAutomatedCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
JobAutomatedCreateParams.Body params = JobAutomatedCreateParams.Body.ofDataSyncAll();
AutomatedCreateResponse automated = client.jobs().automated().create(params);
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.AutomatedCreateResponse
import com.tryfinch.api.models.JobAutomatedCreateParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val params: JobAutomatedCreateParams.Body = JobAutomatedCreateParams.Body.ofDataSyncAll()
val automated: AutomatedCreateResponse = client.jobs().automated().create(params)
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
automated = finch.jobs.automated.create(body: {type: :data_sync_all})
puts(automated)curl --request POST \
--url https://api.tryfinch.com/jobs/automated \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"type": "data_sync_all"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/jobs/automated",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'data_sync_all'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"Finch-API-Version: <finch-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"job_url": "https://api.tryfinch.com/jobs/automated/453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"allowed_refreshes": 2,
"remaining_refreshes": 1
}{
"job_id": "de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"job_url": "https://api.tryfinch.com/jobs/automated/de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"allowed_refreshes": 2,
"remaining_refreshes": 2
}{
"statusCode": 400,
"status": 400,
"code": 400,
"message": "cannot create automated job for Assisted Connect token",
"name": "bad_request"
}{
"statusCode": 401,
"status": 401,
"code": 401,
"message": "Unauthorized request: no authentication given",
"name": "unauthorized_request_error"
}{
"job_id": "de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"job_url": "https://api.tryfinch.com/jobs/automated/de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"allowed_refreshes": 2,
"remaining_refreshes": 0,
"retry_at": "2019-08-24T14:15:22Z"
}Enqueue a New Automated Job
Enqueue an automated job.
data_sync_all: Enqueue a job to re-sync all data for a connection. data_sync_all has a concurrency limit of 1 job at a time per connection. This means that if this endpoint is called while a job is already in progress for this connection, Finch will return the job_id of the job that is currently in progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection.
w4_form_employee_sync: Enqueues a job for sync W-4 data for a particular individual, identified by individual_id. This feature is currently in beta.
This endpoint is available for Scale tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager.
POST
/
jobs
/
automated
JavaScript
import Finch from '@tryfinch/finch-api';
const client = new Finch({
accessToken: 'My Access Token',
});
const automated = await client.jobs.automated.create({ type: 'data_sync_all' });
console.log(automated.job_id);from finch import Finch
client = Finch(
access_token="My Access Token",
)
automated = client.jobs.automated.create(
type="data_sync_all",
)
print(automated.job_id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go/v2"
"github.com/Finch-API/finch-api-go/v2/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
automated, err := client.Jobs.Automated.New(context.TODO(), finchgo.JobAutomatedNewParamsDataSyncAll{
Type: finchgo.F(finchgo.JobAutomatedNewParamsDataSyncAllTypeDataSyncAll),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", automated.JobID)
}
package com.tryfinch.api.example;
import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.AutomatedCreateResponse;
import com.tryfinch.api.models.JobAutomatedCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();
JobAutomatedCreateParams.Body params = JobAutomatedCreateParams.Body.ofDataSyncAll();
AutomatedCreateResponse automated = client.jobs().automated().create(params);
}
}package com.tryfinch.api.example
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.AutomatedCreateResponse
import com.tryfinch.api.models.JobAutomatedCreateParams
fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()
val params: JobAutomatedCreateParams.Body = JobAutomatedCreateParams.Body.ofDataSyncAll()
val automated: AutomatedCreateResponse = client.jobs().automated().create(params)
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
automated = finch.jobs.automated.create(body: {type: :data_sync_all})
puts(automated)curl --request POST \
--url https://api.tryfinch.com/jobs/automated \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'Finch-API-Version: <finch-api-version>' \
--data '
{
"type": "data_sync_all"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/jobs/automated",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'data_sync_all'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"Finch-API-Version: <finch-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"job_url": "https://api.tryfinch.com/jobs/automated/453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"allowed_refreshes": 2,
"remaining_refreshes": 1
}{
"job_id": "de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"job_url": "https://api.tryfinch.com/jobs/automated/de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"allowed_refreshes": 2,
"remaining_refreshes": 2
}{
"statusCode": 400,
"status": 400,
"code": 400,
"message": "cannot create automated job for Assisted Connect token",
"name": "bad_request"
}{
"statusCode": 401,
"status": 401,
"code": 401,
"message": "Unauthorized request: no authentication given",
"name": "unauthorized_request_error"
}{
"job_id": "de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"job_url": "https://api.tryfinch.com/jobs/automated/de9113d6-e2fa-4c72-ba4a-ee1d8a4f8df6",
"allowed_refreshes": 2,
"remaining_refreshes": 0,
"retry_at": "2019-08-24T14:15:22Z"
}Currently, only the
data_sync_all job type is supported, which will enqueue a job to re-sync all data for a connection. data_sync_all has a concurrency limit of 1 job at a time per connection. This means that if this endpoint is called while a job is already in progress for this connection, Finch will return the job_id of the job that is currently in progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection.
This endpoint is available for Scale tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager.Headers
Body
application/json
Response
Created
Was this page helpful?