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

# Create a new Connect session for reauthentication

> Create a new Connect session for reauthenticating an existing connection

NOTE: The connect session uses Basic Auth; in the sample request above use `client_id` as the username and `client_secret` as a password.
For example: `Authorization:  Basic <base64 encoded client_id:client_secret>`


## OpenAPI

````yaml post /connect/sessions/reauthenticate
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:
  /connect/sessions/reauthenticate:
    post:
      tags:
        - Connect
      summary: Create a new Connect session for reauthentication
      description: Create a new Connect session for reauthenticating an existing connection
      operationId: post-connect-sessions-reauthenticate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReauthenticateRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReauthenticateResponse'
              examples:
                Success:
                  value:
                    session_id: 550e8400-e29b-41d4-a716-446655440000
                    connect_url: >-
                      https://connect.tryfinch.com/authorize?session=550e8400-e29b-41d4-a716-446655440000
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  finch_code:
                    type: string
                    enum:
                      - connection_not_found
                      - invalid_request
              examples:
                ConnectionNotFound:
                  value:
                    code: 400
                    finch_code: invalid_request
                    message: Connection not found
                    name: bad_request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 401
                  finch_code:
                    type: string
                    example: invalid_client
                  message:
                    type: string
                    example: 'Invalid client: Unable to validate credentials'
              examples:
                InvalidCredentials:
                  value:
                    error: 'Invalid client: Unable to validate credentials'
      security:
        - basicAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Finch from '@tryfinch/finch-api';


            const client = new Finch({
              clientID: process.env['FINCH_CLIENT_ID'], // This is the default and can be omitted
              clientSecret: process.env['FINCH_CLIENT_SECRET'], // This is the default and can be omitted
            });


            const response = await client.connect.sessions.reauthenticate({
            connection_id: 'connection_id' });


            console.log(response.session_id);
        - lang: Python
          source: |-
            import os
            from finch import Finch

            client = Finch(
                client_id=os.environ.get("FINCH_CLIENT_ID"),  # This is the default and can be omitted
                client_secret=os.environ.get("FINCH_CLIENT_SECRET"),  # This is the default and can be omitted
            )
            response = client.connect.sessions.reauthenticate(
                connection_id="connection_id",
            )
            print(response.session_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.WithClientID(\"4ab15e51-11ad-49f4-acae-f343b7794375\"),\n\t\toption.WithClientSecret(\"My Client Secret\"),\n\t)\n\tresponse, err := client.Connect.Sessions.Reauthenticate(context.TODO(), finchgo.ConnectSessionReauthenticateParams{\n\t\tConnectionID: finchgo.F(\"connection_id\"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.SessionID)\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.ConnectSessionReauthenticateParams;
            import com.tryfinch.api.models.SessionReauthenticateResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    FinchClient client = FinchOkHttpClient.fromEnv();

                    ConnectSessionReauthenticateParams params = ConnectSessionReauthenticateParams.builder()
                        .connectionId("connection_id")
                        .build();
                    SessionReauthenticateResponse response = client.connect().sessions().reauthenticate(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.ConnectSessionReauthenticateParams
            import com.tryfinch.api.models.SessionReauthenticateResponse

            fun main() {
                val client: FinchClient = FinchOkHttpClient.fromEnv()

                val params: ConnectSessionReauthenticateParams = ConnectSessionReauthenticateParams.builder()
                    .connectionId("connection_id")
                    .build()
                val response: SessionReauthenticateResponse = client.connect().sessions().reauthenticate(params)
            }
        - lang: Ruby
          source: >-
            require "finch_api"


            finch = FinchAPI::Client.new(client_id:
            "4ab15e51-11ad-49f4-acae-f343b7794375", client_secret: "My Client
            Secret")


            response = finch.connect.sessions.reauthenticate(connection_id:
            "connection_id")


            puts(response)
components:
  schemas:
    ReauthenticateRequest:
      type: object
      properties:
        redirect_uri:
          type: string
          nullable: true
          format: uri
          description: The URI to redirect to after the Connect flow is completed
        minutes_to_expire:
          type: integer
          description: >-
            The number of minutes until the session expires (defaults to 43,200,
            which is 30 days)
        products:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ConnectProducts'
          description: >-
            The products to request access to (optional for reauthentication).
            Use `benefits` to access deductions endpoints — `deduction` is a
            deprecated alias that is still accepted but should not be combined
            with `benefits`.
        connection_id:
          type: string
          description: The ID of the existing connection to reauthenticate
      required:
        - connection_id
    ReauthenticateResponse:
      type: object
      properties:
        session_id:
          type: string
          description: The unique identifier for the created connect session
        connect_url:
          type: string
          format: uri
          description: The Connect URL to redirect the user to for reauthentication
      required:
        - session_id
        - connect_url
    ConnectProducts:
      type: string
      enum:
        - benefits
        - company
        - deduction
        - directory
        - documents
        - employment
        - individual
        - payment
        - pay_statement
        - ssn
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Please use base64 encoded client_id:client_secret

````