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

# Update a sandbox account

> Update an existing sandbox account. Change the connection status to understand how the Finch API responds.



## OpenAPI

````yaml put /sandbox/connections/accounts
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:
  /sandbox/connections/accounts:
    parameters: []
    put:
      tags:
        - Sandbox
      summary: Update a sandbox account
      description: >-
        Update an existing sandbox account. Change the connection status to
        understand how the Finch API responds.
      operationId: put-sandbox-connections-accounts
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                connection_status:
                  $ref: '#/components/schemas/ConnectionStatus'
            examples:
              Example 1:
                value:
                  connection_status: reauth
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  connection_id:
                    type: string
                    format: uuid
                    description: The ID of the new connection
                  entity_id:
                    type: string
                    format: uuid
                    description: The ID of the entity whose status was updated
                  account_id:
                    type: string
                    format: uuid
                    deprecated: true
                    description: >-
                      [DEPRECATED] Use `connection_id` to associate a connection
                      with an access token
                  authentication_type:
                    $ref: '#/components/schemas/AuthenticationType'
                  company_id:
                    type: string
                    format: uuid
                    deprecated: true
                    description: >-
                      [DEPRECATED] Use `connection_id` to associate a connection
                      with an access token
                  provider_id:
                    type: string
                    description: The ID of the provider associated with the `access_token`
                  products:
                    type: array
                    items:
                      type: string
                required:
                  - connection_id
                  - entity_id
                  - account_id
                  - authentication_type
                  - company_id
                  - provider_id
                  - products
              examples:
                success:
                  value:
                    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
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: |-
            from finch import Finch

            client = Finch(
                access_token="My Access Token",
            )
            account = client.sandbox.connections.accounts.update(
                connection_status="reauth",
            )
            print(account.account_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\t\"github.com/Finch-API/finch-api-go/shared\"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken(\"My Access Token\"),\n\t)\n\taccount, err := client.Sandbox.Connections.Accounts.Update(context.TODO(), finchgo.SandboxConnectionAccountUpdateParams{\n\t\tConnectionStatus: finchgo.F(shared.ConnectionStatusTypeReauth),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", account.AccountID)\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.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();
                }
            }
        - 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.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()
            }
        - lang: Ruby
          source: |-
            require "finch_api"

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

            account = finch.sandbox.connections.accounts.update

            puts(account)
components:
  schemas:
    ConnectionStatus:
      type: string
      enum:
        - pending
        - processing
        - connected
        - error_no_account_setup
        - error_permissions
        - reauth
    AuthenticationType:
      title: AuthenticationType
      enum:
        - credential
        - api_token
        - oauth
        - assisted
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Please use your Access Token

````