> ## Documentation Index
> Fetch the complete documentation index at: https://developer.tryfinch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml post /jobs/automated
openapi: 3.1.0
info:
  title: API Reference
  version: '2020-09-17'
  contact: {}
  description: >-
    The Finch HRIS API provides a unified way to connect to a multitide of HRIS
    systems. The API requires an access token issued by Finch.


    By default, Organization and Payroll requests use Finch's [Data
    Syncs](/developer-resources/Data-Syncs). If a request is made before the
    initial sync has completed, Finch will request data live from the provider.
    The latency on live requests may range from seconds to minutes depending on
    the provider and batch size.

    For automated integrations, Deductions requests (both read and write) are
    always made live to the provider. Latencies may range from seconds to
    minutes depending on the provider and batch size.



    Employer products are specified by the product parameter, a space-separated
    list of products that your application requests from an employer
    authenticating through Finch Connect. Valid product names are—

    - `company`: Read basic company data


    - `directory`: Read company directory and organization structure


    - `individual`: Read individual data, excluding income and employment data


    - `employment`: Read individual employment and income data


    - `payment`: Read payroll and contractor related payments by the company


    - `pay_statement`: Read detailed pay statements for each individual


    - `benefits`: Create and manage deductions and contributions and enrollment
    for an employer


    [![Open in
    Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4?action=collection%2Ffork&collection-url=entityId%3D21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4%26entityType%3Dcollection%26workspaceId%3D1edf19bc-e0a8-41e9-ac55-481a4b50790b)
servers:
  - url: https://api.tryfinch.com
    description: ''
security: []
tags:
  - name: Organization
  - name: Payroll
  - name: Deductions
  - name: Management
  - name: Sandbox
paths:
  /jobs/automated:
    post:
      tags:
        - Management
      summary: Enqueue a New Automated Job
      description: >-
        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.
      operationId: post-jobs-automated
      parameters:
        - $ref: '#/components/parameters/API-Version'
        - $ref: '#/components/parameters/Content-Type'
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  title: data_sync_all
                  properties:
                    type:
                      type: string
                      description: The type of job to start.
                      enum:
                        - data_sync_all
                  required:
                    - type
                - type: object
                  title: w4_form_employee_sync
                  properties:
                    type:
                      type: string
                      description: The type of job to start.
                      enum:
                        - w4_form_employee_sync
                    params:
                      type: object
                      properties:
                        individual_id:
                          type: string
                          description: The unique ID of the individual for W-4 data sync.
                      required:
                        - individual_id
                  required:
                    - type
                    - params
              discriminator:
                propertyName: type
            example:
              type: w4_form_employee_sync
              params:
                individual_id: 12345
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomatedJobResponse'
              examples:
                Example 1:
                  value:
                    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
        '202':
          description: >-
            Accepted. This response will be returned if a job is already
            enqueued for the connection. This case does not consume any job
            quota as it just returns the details of an existing job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomatedJobResponse'
              examples:
                Example 1:
                  value:
                    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
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example 1:
                  value:
                    statusCode: 400
                    status: 400
                    code: 400
                    message: cannot create automated job for Assisted Connect token
                    name: bad_request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example 1:
                  value:
                    statusCode: 401
                    status: 401
                    code: 401
                    message: 'Unauthorized request: no authentication given'
                    name: unauthorized_request_error
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomatedJobResponse'
              examples:
                Example 1:
                  value:
                    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'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: |-
            from finch import Finch

            client = Finch(
                access_token="My Access Token",
            )
            automated = client.jobs.automated.create(
                type="data_sync_all",
            )
            print(automated.job_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/Finch-API/finch-api-go\"\n\t\"github.com/Finch-API/finch-api-go/option\"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken(\"My Access Token\"),\n\t)\n\tautomated, err := client.Jobs.Automated.New(context.TODO(), finchgo.JobAutomatedNewParamsDataSyncAll{\n\t\tType: finchgo.F(finchgo.JobAutomatedNewParamsDataSyncAllTypeDataSyncAll),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", automated.JobID)\n}\n"
        - lang: Java
          source: |-
            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);
                }
            }
        - lang: Kotlin
          source: |-
            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)
            }
        - lang: Ruby
          source: >-
            require "finch_api"


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


            automated = finch.jobs.automated.create(body: {type:
            :data_sync_all})


            puts(automated)
components:
  parameters:
    API-Version:
      name: Finch-API-Version
      in: header
      required: true
      schema:
        type: string
        default: '2020-09-17'
        format: date
        pattern: ([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
      description: >-
        Header used to specify the version for a given API request. Current
        version is 2020-09-17.
    Content-Type:
      name: Content-Type
      in: header
      required: true
      schema:
        type: string
        default: application/json
      description: 'Used to indicate the original media type of the resource '
  schemas:
    AutomatedJobResponse:
      type: object
      properties:
        job_id:
          type: string
          description: The id of the job that has been created.
          format: uuid
        job_url:
          type: string
          description: The url that can be used to retrieve the job status
        allowed_refreshes:
          type: integer
          description: The number of allowed refreshes per hour (per hour, fixed window)
        remaining_refreshes:
          type: integer
          description: The number of remaining refreshes available (per hour, fixed window)
        retry_at:
          type: string
          description: ISO 8601 timestamp indicating when to retry the request
      required:
        - allowed_refreshes
        - remaining_refreshes
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
        status:
          type: integer
        code:
          type: integer
        name:
          type: string
        message:
          type: string
      required:
        - statusCode
        - status
        - code
        - name
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Please use your Access Token

````