Skip to main content
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"
"github.com/Finch-API/finch-api-go/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": "w4_form_employee_sync",
"params": {
"individual_id": 12345
}
}
'
<?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' => 'w4_form_employee_sync',
'params' => [
'individual_id' => 12345
]
]),
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.

Authorizations

Authorization
string
header
required

Please use your Access Token

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.

Pattern: ([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
Content-Type
string
default:application/json
required

Used to indicate the original media type of the resource

Body

application/json
type
enum<string>
required

The type of job to start.

Available options:
data_sync_all

Response

Created

allowed_refreshes
integer
required

The number of allowed refreshes per hour (per hour, fixed window)

remaining_refreshes
integer
required

The number of remaining refreshes available (per hour, fixed window)

job_id
string<uuid>

The id of the job that has been created.

job_url
string

The url that can be used to retrieve the job status

retry_at
string

ISO 8601 timestamp indicating when to retry the request