Skip to main content
POST
/
sandbox
/
directory
JavaScript
import Finch from '@tryfinch/finch-api';

const client = new Finch({
  accessToken: 'My Access Token',
});

const directories = await client.sandbox.directory.create();

console.log(directories);
from finch import Finch

client = Finch(
access_token="My Access Token",
)
directories = client.sandbox.directory.create()
print(directories)
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"),
)
directories, err := client.Sandbox.Directory.New(context.TODO(), finchgo.SandboxDirectoryNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", directories)
}
package com.tryfinch.api.example;

import com.tryfinch.api.client.FinchClient;
import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
import com.tryfinch.api.models.DirectoryCreateResponse;
import com.tryfinch.api.models.SandboxDirectoryCreateParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
FinchClient client = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build();

List<DirectoryCreateResponse> directories = client.sandbox().directory().create();
}
}
package com.tryfinch.api.example

import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.okhttp.FinchOkHttpClient
import com.tryfinch.api.models.DirectoryCreateResponse
import com.tryfinch.api.models.SandboxDirectoryCreateParams

fun main() {
val client: FinchClient = FinchOkHttpClient.builder()
.fromEnv()
.accessToken("My Access Token")
.build()

val directories: List<DirectoryCreateResponse> = client.sandbox().directory().create()
}
require "finch_api"

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

directories = finch.sandbox.directory.create

puts(directories)
curl --request POST \
--url https://api.tryfinch.com/sandbox/directory \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"first_name": "John",
"last_name": "Smith",
"dob": "01/01/2000"
}
]
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/sandbox/directory",
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([
[
'first_name' => 'John',
'last_name' => 'Smith',
'dob' => '01/01/2000'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
[
  {}
]
Note that requests using the SDK will require a JSON object with a key of body and a value of an array of individuals.
// JavaScript example
await client.sandbox.directory.create({
  body: [
    // list of individual objects
  ]
})

Authorizations

Authorization
string
header
required

Please use your Access Token

Body

application/json
first_name
string | null

The legal first name of the individual.

middle_name
string | null

The legal middle name of the individual.

last_name
string | null

The legal last name of the individual.

preferred_name
string | null

The preferred name of the individual.

emails
object[] | null
phone_numbers
(object | null)[] | null
gender
enum<string> | null

The gender of the individual.

Available options:
female,
male,
other,
decline_to_specify,
null
ethnicity
enum<string> | null

The EEOC-defined ethnicity of the individual.

Available options:
asian,
white,
black_or_african_american,
native_hawaiian_or_pacific_islander,
american_indian_or_alaska_native,
hispanic_or_latino,
two_or_more_races,
decline_to_specify,
null
dob
string | null
Pattern: (\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
ssn
string | null

Social Security Number of the individual. This field is only available with the ssn scope enabled and the options: { include: ['ssn'] } param set in the body. Click here to learn more about enabling the SSN field.

encrypted_ssn
string | null

Social Security Number of the individual in encrypted format. This field is only available with the ssn scope enabled and the options: { include: ['ssn'] } param set in the body.

residence
Location · object | null
title
string | null

The current title of the individual.

manager
object | null

The manager object representing the manager of the individual within the org.

department
object | null

The department object.

employment
object | null

The employment object.

start_date
string | null
Pattern: (\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
end_date
string | null
Pattern: (\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
latest_rehire_date
string | null
Pattern: (\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))
is_active
boolean | null

true if the individual an an active employee or contractor at the company.

employment_status
enum<string> | null

The detailed employment status of the individual.

Available options:
active,
deceased,
leave,
onboarding,
prehire,
retired,
terminated,
null
flsa_status
enum<string> | null

The FLSA status of the individual. Available options: exempt, non_exempt, unknown.

Available options:
exempt,
non_exempt,
unknown,
null
class_code
string | null

Worker's compensation classification code for this employee

location
Location · object | null
income
Income · object | null

The employee's income as reported by the provider. This may not always be annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what information the provider returns.

income_history
(Income · object | null)[] | null

The array of income history.

The employee's income as reported by the provider. This may not always be annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what information the provider returns.

custom_fields
object[] | null

Custom fields for the individual. These are fields which are defined by the employer in the system. Custom fields are not currently supported for assisted connections.

source_id
string | null

The source system's unique employment identifier for this individual

Response

200 - application/json

OK