curl --request PATCH \
--url https://api.stackone.com/unified/hris/employees/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'x-account-id: <x-account-id>' \
--data '
{
"title": "Mr",
"first_name": "Isaac",
"last_name": "Newton",
"name": "Isaac Newton",
"display_name": "Sir Isaac Newton",
"avatar_url": "https://example.com/avatar.png",
"personal_email": "isaac.newton@example.com",
"personal_phone_number": "+1234567890",
"work_email": "newton@example.com",
"work_phone_number": "+1234567890",
"job_id": "R-6789",
"job_title": "Physicist",
"department_id": "3093",
"team_id": "2913",
"department": "Physics",
"manager_id": "67890",
"gender": "male",
"preferred_language": "eng",
"ethnicity": "white",
"date_of_birth": "1990-01-01T00:00:00.000Z",
"birthday": "2021-01-01T00:00:00Z",
"marital_status": "single",
"avatar": "https://example.com/avatar.png",
"hire_date": "2021-01-01T00:00:00.000Z",
"start_date": "2021-01-01T00:00:00.000Z",
"employment_type": "permanent",
"employment_contract_type": "full_time",
"employment_status": "active",
"termination_date": "2021-01-01T00:00:00Z",
"company_name": "Example Corp",
"company_id": "1234567890",
"citizenships": [
{
"value": "US",
"source_value": "<string>"
}
],
"employment": {
"unified_custom_fields": {
"my_project_custom_field_1": "REF-1236",
"my_project_custom_field_2": "some other value"
},
"job_title": "Software Engineer",
"pay_rate": "40.00",
"pay_period": "monthly",
"pay_frequency": "hourly",
"pay_currency": "USD",
"end_date": "2021-01-01T01:01:01.000Z",
"grade": {
"id": "1687-3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "1687-4",
"description": "Mid-level employee demonstrating proficiency and autonomy."
},
"employment_type": "permanent",
"employment_contract_type": "full_time",
"type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Permanent",
"type": "permanent"
},
"contract_type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Full-Time",
"contract_type": "full_time"
},
"work_time": {
"duration": "P0Y0M0DT8H0M0S",
"period": "month"
},
"payroll_code": "PC1",
"passthrough": {
"other_known_names": "John Doe"
},
"effective_date": "2021-01-01T00:00:00.000Z"
},
"custom_fields": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Training Completion Status",
"value": "Completed",
"value_id": "value_456",
"remote_value_id": "e3cb75bf-aa84-466e-a6c1-b8322b257a48"
}
],
"benefits": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Health Insurance",
"benefit_type": {
"source_value": "<string>"
},
"provider": "Aetna",
"description": "Health insurance for employees",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"employee_number": "125",
"national_identity_number": {
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
},
"national_identity_numbers": [
{
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
}
],
"home_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": {
"other_known_names": "John Doe"
},
"state": "GB-LIN"
},
"work_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": {
"other_known_names": "John Doe"
},
"state": "GB-LIN"
},
"passthrough": {
"other_known_names": "John Doe"
}
}
'import requests
url = "https://api.stackone.com/unified/hris/employees/{id}"
payload = {
"title": "Mr",
"first_name": "Isaac",
"last_name": "Newton",
"name": "Isaac Newton",
"display_name": "Sir Isaac Newton",
"avatar_url": "https://example.com/avatar.png",
"personal_email": "isaac.newton@example.com",
"personal_phone_number": "+1234567890",
"work_email": "newton@example.com",
"work_phone_number": "+1234567890",
"job_id": "R-6789",
"job_title": "Physicist",
"department_id": "3093",
"team_id": "2913",
"department": "Physics",
"manager_id": "67890",
"gender": "male",
"preferred_language": "eng",
"ethnicity": "white",
"date_of_birth": "1990-01-01T00:00:00.000Z",
"birthday": "2021-01-01T00:00:00Z",
"marital_status": "single",
"avatar": "https://example.com/avatar.png",
"hire_date": "2021-01-01T00:00:00.000Z",
"start_date": "2021-01-01T00:00:00.000Z",
"employment_type": "permanent",
"employment_contract_type": "full_time",
"employment_status": "active",
"termination_date": "2021-01-01T00:00:00Z",
"company_name": "Example Corp",
"company_id": "1234567890",
"citizenships": [
{
"value": "US",
"source_value": "<string>"
}
],
"employment": {
"unified_custom_fields": {
"my_project_custom_field_1": "REF-1236",
"my_project_custom_field_2": "some other value"
},
"job_title": "Software Engineer",
"pay_rate": "40.00",
"pay_period": "monthly",
"pay_frequency": "hourly",
"pay_currency": "USD",
"end_date": "2021-01-01T01:01:01.000Z",
"grade": {
"id": "1687-3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "1687-4",
"description": "Mid-level employee demonstrating proficiency and autonomy."
},
"employment_type": "permanent",
"employment_contract_type": "full_time",
"type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Permanent",
"type": "permanent"
},
"contract_type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Full-Time",
"contract_type": "full_time"
},
"work_time": {
"duration": "P0Y0M0DT8H0M0S",
"period": "month"
},
"payroll_code": "PC1",
"passthrough": { "other_known_names": "John Doe" },
"effective_date": "2021-01-01T00:00:00.000Z"
},
"custom_fields": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Training Completion Status",
"value": "Completed",
"value_id": "value_456",
"remote_value_id": "e3cb75bf-aa84-466e-a6c1-b8322b257a48"
}
],
"benefits": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Health Insurance",
"benefit_type": { "source_value": "<string>" },
"provider": "Aetna",
"description": "Health insurance for employees",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"employee_number": "125",
"national_identity_number": {
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
},
"national_identity_numbers": [
{
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
}
],
"home_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": { "other_known_names": "John Doe" },
"state": "GB-LIN"
},
"work_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": { "other_known_names": "John Doe" },
"state": "GB-LIN"
},
"passthrough": { "other_known_names": "John Doe" }
}
headers = {
"x-account-id": "<x-account-id>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-account-id': '<x-account-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Mr',
first_name: 'Isaac',
last_name: 'Newton',
name: 'Isaac Newton',
display_name: 'Sir Isaac Newton',
avatar_url: 'https://example.com/avatar.png',
personal_email: 'isaac.newton@example.com',
personal_phone_number: '+1234567890',
work_email: 'newton@example.com',
work_phone_number: '+1234567890',
job_id: 'R-6789',
job_title: 'Physicist',
department_id: '3093',
team_id: '2913',
department: 'Physics',
manager_id: '67890',
gender: 'male',
preferred_language: 'eng',
ethnicity: 'white',
date_of_birth: '1990-01-01T00:00:00.000Z',
birthday: '2021-01-01T00:00:00Z',
marital_status: 'single',
avatar: 'https://example.com/avatar.png',
hire_date: '2021-01-01T00:00:00.000Z',
start_date: '2021-01-01T00:00:00.000Z',
employment_type: 'permanent',
employment_contract_type: 'full_time',
employment_status: 'active',
termination_date: '2021-01-01T00:00:00Z',
company_name: 'Example Corp',
company_id: '1234567890',
citizenships: [{value: 'US', source_value: '<string>'}],
employment: {
unified_custom_fields: {
my_project_custom_field_1: 'REF-1236',
my_project_custom_field_2: 'some other value'
},
job_title: 'Software Engineer',
pay_rate: '40.00',
pay_period: 'monthly',
pay_frequency: 'hourly',
pay_currency: 'USD',
end_date: '2021-01-01T01:01:01.000Z',
grade: {
id: '1687-3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: '1687-4',
description: 'Mid-level employee demonstrating proficiency and autonomy.'
},
employment_type: 'permanent',
employment_contract_type: 'full_time',
type: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
label: 'Permanent',
type: 'permanent'
},
contract_type: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
label: 'Full-Time',
contract_type: 'full_time'
},
work_time: {duration: 'P0Y0M0DT8H0M0S', period: 'month'},
payroll_code: 'PC1',
passthrough: {other_known_names: 'John Doe'},
effective_date: '2021-01-01T00:00:00.000Z'
},
custom_fields: [
{
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Training Completion Status',
value: 'Completed',
value_id: 'value_456',
remote_value_id: 'e3cb75bf-aa84-466e-a6c1-b8322b257a48'
}
],
benefits: [
{
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Health Insurance',
benefit_type: {source_value: '<string>'},
provider: 'Aetna',
description: 'Health insurance for employees',
created_at: '2021-01-01T00:00:00Z',
updated_at: '2021-01-01T00:00:00Z'
}
],
employee_number: '125',
national_identity_number: {
value: '123456789',
type: {value: 'ssn', source_value: '<string>'},
country: {value: 'US', source_value: '<string>'}
},
national_identity_numbers: [
{
value: '123456789',
type: {value: 'ssn', source_value: '<string>'},
country: {value: 'US', source_value: '<string>'}
}
],
home_location: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Woolsthorpe Manor',
phone_number: '+44 1476 860 364',
street_1: 'Water Lane',
street_2: 'Woolsthorpe by Colsterworth',
city: 'Grantham',
zip_code: 'NG33 5NR',
country: {value: 'US', source_value: '<string>'},
passthrough: {other_known_names: 'John Doe'},
state: 'GB-LIN'
},
work_location: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Woolsthorpe Manor',
phone_number: '+44 1476 860 364',
street_1: 'Water Lane',
street_2: 'Woolsthorpe by Colsterworth',
city: 'Grantham',
zip_code: 'NG33 5NR',
country: {value: 'US', source_value: '<string>'},
passthrough: {other_known_names: 'John Doe'},
state: 'GB-LIN'
},
passthrough: {other_known_names: 'John Doe'}
})
};
fetch('https://api.stackone.com/unified/hris/employees/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stackone.com/unified/hris/employees/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Mr',
'first_name' => 'Isaac',
'last_name' => 'Newton',
'name' => 'Isaac Newton',
'display_name' => 'Sir Isaac Newton',
'avatar_url' => 'https://example.com/avatar.png',
'personal_email' => 'isaac.newton@example.com',
'personal_phone_number' => '+1234567890',
'work_email' => 'newton@example.com',
'work_phone_number' => '+1234567890',
'job_id' => 'R-6789',
'job_title' => 'Physicist',
'department_id' => '3093',
'team_id' => '2913',
'department' => 'Physics',
'manager_id' => '67890',
'gender' => 'male',
'preferred_language' => 'eng',
'ethnicity' => 'white',
'date_of_birth' => '1990-01-01T00:00:00.000Z',
'birthday' => '2021-01-01T00:00:00Z',
'marital_status' => 'single',
'avatar' => 'https://example.com/avatar.png',
'hire_date' => '2021-01-01T00:00:00.000Z',
'start_date' => '2021-01-01T00:00:00.000Z',
'employment_type' => 'permanent',
'employment_contract_type' => 'full_time',
'employment_status' => 'active',
'termination_date' => '2021-01-01T00:00:00Z',
'company_name' => 'Example Corp',
'company_id' => '1234567890',
'citizenships' => [
[
'value' => 'US',
'source_value' => '<string>'
]
],
'employment' => [
'unified_custom_fields' => [
'my_project_custom_field_1' => 'REF-1236',
'my_project_custom_field_2' => 'some other value'
],
'job_title' => 'Software Engineer',
'pay_rate' => '40.00',
'pay_period' => 'monthly',
'pay_frequency' => 'hourly',
'pay_currency' => 'USD',
'end_date' => '2021-01-01T01:01:01.000Z',
'grade' => [
'id' => '1687-3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => '1687-4',
'description' => 'Mid-level employee demonstrating proficiency and autonomy.'
],
'employment_type' => 'permanent',
'employment_contract_type' => 'full_time',
'type' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'label' => 'Permanent',
'type' => 'permanent'
],
'contract_type' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'label' => 'Full-Time',
'contract_type' => 'full_time'
],
'work_time' => [
'duration' => 'P0Y0M0DT8H0M0S',
'period' => 'month'
],
'payroll_code' => 'PC1',
'passthrough' => [
'other_known_names' => 'John Doe'
],
'effective_date' => '2021-01-01T00:00:00.000Z'
],
'custom_fields' => [
[
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Training Completion Status',
'value' => 'Completed',
'value_id' => 'value_456',
'remote_value_id' => 'e3cb75bf-aa84-466e-a6c1-b8322b257a48'
]
],
'benefits' => [
[
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Health Insurance',
'benefit_type' => [
'source_value' => '<string>'
],
'provider' => 'Aetna',
'description' => 'Health insurance for employees',
'created_at' => '2021-01-01T00:00:00Z',
'updated_at' => '2021-01-01T00:00:00Z'
]
],
'employee_number' => '125',
'national_identity_number' => [
'value' => '123456789',
'type' => [
'value' => 'ssn',
'source_value' => '<string>'
],
'country' => [
'value' => 'US',
'source_value' => '<string>'
]
],
'national_identity_numbers' => [
[
'value' => '123456789',
'type' => [
'value' => 'ssn',
'source_value' => '<string>'
],
'country' => [
'value' => 'US',
'source_value' => '<string>'
]
]
],
'home_location' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Woolsthorpe Manor',
'phone_number' => '+44 1476 860 364',
'street_1' => 'Water Lane',
'street_2' => 'Woolsthorpe by Colsterworth',
'city' => 'Grantham',
'zip_code' => 'NG33 5NR',
'country' => [
'value' => 'US',
'source_value' => '<string>'
],
'passthrough' => [
'other_known_names' => 'John Doe'
],
'state' => 'GB-LIN'
],
'work_location' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Woolsthorpe Manor',
'phone_number' => '+44 1476 860 364',
'street_1' => 'Water Lane',
'street_2' => 'Woolsthorpe by Colsterworth',
'city' => 'Grantham',
'zip_code' => 'NG33 5NR',
'country' => [
'value' => 'US',
'source_value' => '<string>'
],
'passthrough' => [
'other_known_names' => 'John Doe'
],
'state' => 'GB-LIN'
],
'passthrough' => [
'other_known_names' => 'John Doe'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"x-account-id: <x-account-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stackone.com/unified/hris/employees/{id}"
payload := strings.NewReader("{\n \"title\": \"Mr\",\n \"first_name\": \"Isaac\",\n \"last_name\": \"Newton\",\n \"name\": \"Isaac Newton\",\n \"display_name\": \"Sir Isaac Newton\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"personal_email\": \"isaac.newton@example.com\",\n \"personal_phone_number\": \"+1234567890\",\n \"work_email\": \"newton@example.com\",\n \"work_phone_number\": \"+1234567890\",\n \"job_id\": \"R-6789\",\n \"job_title\": \"Physicist\",\n \"department_id\": \"3093\",\n \"team_id\": \"2913\",\n \"department\": \"Physics\",\n \"manager_id\": \"67890\",\n \"gender\": \"male\",\n \"preferred_language\": \"eng\",\n \"ethnicity\": \"white\",\n \"date_of_birth\": \"1990-01-01T00:00:00.000Z\",\n \"birthday\": \"2021-01-01T00:00:00Z\",\n \"marital_status\": \"single\",\n \"avatar\": \"https://example.com/avatar.png\",\n \"hire_date\": \"2021-01-01T00:00:00.000Z\",\n \"start_date\": \"2021-01-01T00:00:00.000Z\",\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"employment_status\": \"active\",\n \"termination_date\": \"2021-01-01T00:00:00Z\",\n \"company_name\": \"Example Corp\",\n \"company_id\": \"1234567890\",\n \"citizenships\": [\n {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n ],\n \"employment\": {\n \"unified_custom_fields\": {\n \"my_project_custom_field_1\": \"REF-1236\",\n \"my_project_custom_field_2\": \"some other value\"\n },\n \"job_title\": \"Software Engineer\",\n \"pay_rate\": \"40.00\",\n \"pay_period\": \"monthly\",\n \"pay_frequency\": \"hourly\",\n \"pay_currency\": \"USD\",\n \"end_date\": \"2021-01-01T01:01:01.000Z\",\n \"grade\": {\n \"id\": \"1687-3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"1687-4\",\n \"description\": \"Mid-level employee demonstrating proficiency and autonomy.\"\n },\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Permanent\",\n \"type\": \"permanent\"\n },\n \"contract_type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Full-Time\",\n \"contract_type\": \"full_time\"\n },\n \"work_time\": {\n \"duration\": \"P0Y0M0DT8H0M0S\",\n \"period\": \"month\"\n },\n \"payroll_code\": \"PC1\",\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"effective_date\": \"2021-01-01T00:00:00.000Z\"\n },\n \"custom_fields\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Training Completion Status\",\n \"value\": \"Completed\",\n \"value_id\": \"value_456\",\n \"remote_value_id\": \"e3cb75bf-aa84-466e-a6c1-b8322b257a48\"\n }\n ],\n \"benefits\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Health Insurance\",\n \"benefit_type\": {\n \"source_value\": \"<string>\"\n },\n \"provider\": \"Aetna\",\n \"description\": \"Health insurance for employees\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n }\n ],\n \"employee_number\": \"125\",\n \"national_identity_number\": {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n },\n \"national_identity_numbers\": [\n {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n }\n ],\n \"home_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"work_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-account-id", "<x-account-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.stackone.com/unified/hris/employees/{id}")
.header("x-account-id", "<x-account-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Mr\",\n \"first_name\": \"Isaac\",\n \"last_name\": \"Newton\",\n \"name\": \"Isaac Newton\",\n \"display_name\": \"Sir Isaac Newton\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"personal_email\": \"isaac.newton@example.com\",\n \"personal_phone_number\": \"+1234567890\",\n \"work_email\": \"newton@example.com\",\n \"work_phone_number\": \"+1234567890\",\n \"job_id\": \"R-6789\",\n \"job_title\": \"Physicist\",\n \"department_id\": \"3093\",\n \"team_id\": \"2913\",\n \"department\": \"Physics\",\n \"manager_id\": \"67890\",\n \"gender\": \"male\",\n \"preferred_language\": \"eng\",\n \"ethnicity\": \"white\",\n \"date_of_birth\": \"1990-01-01T00:00:00.000Z\",\n \"birthday\": \"2021-01-01T00:00:00Z\",\n \"marital_status\": \"single\",\n \"avatar\": \"https://example.com/avatar.png\",\n \"hire_date\": \"2021-01-01T00:00:00.000Z\",\n \"start_date\": \"2021-01-01T00:00:00.000Z\",\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"employment_status\": \"active\",\n \"termination_date\": \"2021-01-01T00:00:00Z\",\n \"company_name\": \"Example Corp\",\n \"company_id\": \"1234567890\",\n \"citizenships\": [\n {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n ],\n \"employment\": {\n \"unified_custom_fields\": {\n \"my_project_custom_field_1\": \"REF-1236\",\n \"my_project_custom_field_2\": \"some other value\"\n },\n \"job_title\": \"Software Engineer\",\n \"pay_rate\": \"40.00\",\n \"pay_period\": \"monthly\",\n \"pay_frequency\": \"hourly\",\n \"pay_currency\": \"USD\",\n \"end_date\": \"2021-01-01T01:01:01.000Z\",\n \"grade\": {\n \"id\": \"1687-3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"1687-4\",\n \"description\": \"Mid-level employee demonstrating proficiency and autonomy.\"\n },\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Permanent\",\n \"type\": \"permanent\"\n },\n \"contract_type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Full-Time\",\n \"contract_type\": \"full_time\"\n },\n \"work_time\": {\n \"duration\": \"P0Y0M0DT8H0M0S\",\n \"period\": \"month\"\n },\n \"payroll_code\": \"PC1\",\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"effective_date\": \"2021-01-01T00:00:00.000Z\"\n },\n \"custom_fields\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Training Completion Status\",\n \"value\": \"Completed\",\n \"value_id\": \"value_456\",\n \"remote_value_id\": \"e3cb75bf-aa84-466e-a6c1-b8322b257a48\"\n }\n ],\n \"benefits\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Health Insurance\",\n \"benefit_type\": {\n \"source_value\": \"<string>\"\n },\n \"provider\": \"Aetna\",\n \"description\": \"Health insurance for employees\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n }\n ],\n \"employee_number\": \"125\",\n \"national_identity_number\": {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n },\n \"national_identity_numbers\": [\n {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n }\n ],\n \"home_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"work_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stackone.com/unified/hris/employees/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-account-id"] = '<x-account-id>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Mr\",\n \"first_name\": \"Isaac\",\n \"last_name\": \"Newton\",\n \"name\": \"Isaac Newton\",\n \"display_name\": \"Sir Isaac Newton\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"personal_email\": \"isaac.newton@example.com\",\n \"personal_phone_number\": \"+1234567890\",\n \"work_email\": \"newton@example.com\",\n \"work_phone_number\": \"+1234567890\",\n \"job_id\": \"R-6789\",\n \"job_title\": \"Physicist\",\n \"department_id\": \"3093\",\n \"team_id\": \"2913\",\n \"department\": \"Physics\",\n \"manager_id\": \"67890\",\n \"gender\": \"male\",\n \"preferred_language\": \"eng\",\n \"ethnicity\": \"white\",\n \"date_of_birth\": \"1990-01-01T00:00:00.000Z\",\n \"birthday\": \"2021-01-01T00:00:00Z\",\n \"marital_status\": \"single\",\n \"avatar\": \"https://example.com/avatar.png\",\n \"hire_date\": \"2021-01-01T00:00:00.000Z\",\n \"start_date\": \"2021-01-01T00:00:00.000Z\",\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"employment_status\": \"active\",\n \"termination_date\": \"2021-01-01T00:00:00Z\",\n \"company_name\": \"Example Corp\",\n \"company_id\": \"1234567890\",\n \"citizenships\": [\n {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n ],\n \"employment\": {\n \"unified_custom_fields\": {\n \"my_project_custom_field_1\": \"REF-1236\",\n \"my_project_custom_field_2\": \"some other value\"\n },\n \"job_title\": \"Software Engineer\",\n \"pay_rate\": \"40.00\",\n \"pay_period\": \"monthly\",\n \"pay_frequency\": \"hourly\",\n \"pay_currency\": \"USD\",\n \"end_date\": \"2021-01-01T01:01:01.000Z\",\n \"grade\": {\n \"id\": \"1687-3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"1687-4\",\n \"description\": \"Mid-level employee demonstrating proficiency and autonomy.\"\n },\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Permanent\",\n \"type\": \"permanent\"\n },\n \"contract_type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Full-Time\",\n \"contract_type\": \"full_time\"\n },\n \"work_time\": {\n \"duration\": \"P0Y0M0DT8H0M0S\",\n \"period\": \"month\"\n },\n \"payroll_code\": \"PC1\",\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"effective_date\": \"2021-01-01T00:00:00.000Z\"\n },\n \"custom_fields\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Training Completion Status\",\n \"value\": \"Completed\",\n \"value_id\": \"value_456\",\n \"remote_value_id\": \"e3cb75bf-aa84-466e-a6c1-b8322b257a48\"\n }\n ],\n \"benefits\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Health Insurance\",\n \"benefit_type\": {\n \"source_value\": \"<string>\"\n },\n \"provider\": \"Aetna\",\n \"description\": \"Health insurance for employees\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n }\n ],\n \"employee_number\": \"125\",\n \"national_identity_number\": {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n },\n \"national_identity_numbers\": [\n {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n }\n ],\n \"home_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"work_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n }\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Record updated successfully.",
"timestamp": "2021-01-01T01:01:01.000Z"
}{
"statusCode": 400,
"message": "Bad Request",
"timestamp": "2023-05-30T00:00:00.000Z",
"data": {
"statusCode": 400,
"message": "Bad Request",
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
},
"provider_errors": [
{
"status": 400,
"url": "https://api.provider.com/v1/resource",
"raw": {
"message": "Invalid input parameters"
},
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
}
]
}{
"statusCode": 401,
"message": "Unauthorized",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 403,
"message": "Forbidden resource",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 404,
"message": "Not Found",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 408,
"message": "Request timed out",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 409,
"message": "Conflict",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 412,
"message": "Precondition failed",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 422,
"message": "Unprocessable Entity",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 429,
"message": "Too many requests",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 500,
"message": "Internal server error",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 501,
"message": "Not Implemented",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 502,
"message": "Bad Gateway",
"timestamp": "2023-05-30T00:00:00.000Z"
}Update Employee
curl --request PATCH \
--url https://api.stackone.com/unified/hris/employees/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'x-account-id: <x-account-id>' \
--data '
{
"title": "Mr",
"first_name": "Isaac",
"last_name": "Newton",
"name": "Isaac Newton",
"display_name": "Sir Isaac Newton",
"avatar_url": "https://example.com/avatar.png",
"personal_email": "isaac.newton@example.com",
"personal_phone_number": "+1234567890",
"work_email": "newton@example.com",
"work_phone_number": "+1234567890",
"job_id": "R-6789",
"job_title": "Physicist",
"department_id": "3093",
"team_id": "2913",
"department": "Physics",
"manager_id": "67890",
"gender": "male",
"preferred_language": "eng",
"ethnicity": "white",
"date_of_birth": "1990-01-01T00:00:00.000Z",
"birthday": "2021-01-01T00:00:00Z",
"marital_status": "single",
"avatar": "https://example.com/avatar.png",
"hire_date": "2021-01-01T00:00:00.000Z",
"start_date": "2021-01-01T00:00:00.000Z",
"employment_type": "permanent",
"employment_contract_type": "full_time",
"employment_status": "active",
"termination_date": "2021-01-01T00:00:00Z",
"company_name": "Example Corp",
"company_id": "1234567890",
"citizenships": [
{
"value": "US",
"source_value": "<string>"
}
],
"employment": {
"unified_custom_fields": {
"my_project_custom_field_1": "REF-1236",
"my_project_custom_field_2": "some other value"
},
"job_title": "Software Engineer",
"pay_rate": "40.00",
"pay_period": "monthly",
"pay_frequency": "hourly",
"pay_currency": "USD",
"end_date": "2021-01-01T01:01:01.000Z",
"grade": {
"id": "1687-3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "1687-4",
"description": "Mid-level employee demonstrating proficiency and autonomy."
},
"employment_type": "permanent",
"employment_contract_type": "full_time",
"type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Permanent",
"type": "permanent"
},
"contract_type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Full-Time",
"contract_type": "full_time"
},
"work_time": {
"duration": "P0Y0M0DT8H0M0S",
"period": "month"
},
"payroll_code": "PC1",
"passthrough": {
"other_known_names": "John Doe"
},
"effective_date": "2021-01-01T00:00:00.000Z"
},
"custom_fields": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Training Completion Status",
"value": "Completed",
"value_id": "value_456",
"remote_value_id": "e3cb75bf-aa84-466e-a6c1-b8322b257a48"
}
],
"benefits": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Health Insurance",
"benefit_type": {
"source_value": "<string>"
},
"provider": "Aetna",
"description": "Health insurance for employees",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"employee_number": "125",
"national_identity_number": {
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
},
"national_identity_numbers": [
{
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
}
],
"home_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": {
"other_known_names": "John Doe"
},
"state": "GB-LIN"
},
"work_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": {
"other_known_names": "John Doe"
},
"state": "GB-LIN"
},
"passthrough": {
"other_known_names": "John Doe"
}
}
'import requests
url = "https://api.stackone.com/unified/hris/employees/{id}"
payload = {
"title": "Mr",
"first_name": "Isaac",
"last_name": "Newton",
"name": "Isaac Newton",
"display_name": "Sir Isaac Newton",
"avatar_url": "https://example.com/avatar.png",
"personal_email": "isaac.newton@example.com",
"personal_phone_number": "+1234567890",
"work_email": "newton@example.com",
"work_phone_number": "+1234567890",
"job_id": "R-6789",
"job_title": "Physicist",
"department_id": "3093",
"team_id": "2913",
"department": "Physics",
"manager_id": "67890",
"gender": "male",
"preferred_language": "eng",
"ethnicity": "white",
"date_of_birth": "1990-01-01T00:00:00.000Z",
"birthday": "2021-01-01T00:00:00Z",
"marital_status": "single",
"avatar": "https://example.com/avatar.png",
"hire_date": "2021-01-01T00:00:00.000Z",
"start_date": "2021-01-01T00:00:00.000Z",
"employment_type": "permanent",
"employment_contract_type": "full_time",
"employment_status": "active",
"termination_date": "2021-01-01T00:00:00Z",
"company_name": "Example Corp",
"company_id": "1234567890",
"citizenships": [
{
"value": "US",
"source_value": "<string>"
}
],
"employment": {
"unified_custom_fields": {
"my_project_custom_field_1": "REF-1236",
"my_project_custom_field_2": "some other value"
},
"job_title": "Software Engineer",
"pay_rate": "40.00",
"pay_period": "monthly",
"pay_frequency": "hourly",
"pay_currency": "USD",
"end_date": "2021-01-01T01:01:01.000Z",
"grade": {
"id": "1687-3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "1687-4",
"description": "Mid-level employee demonstrating proficiency and autonomy."
},
"employment_type": "permanent",
"employment_contract_type": "full_time",
"type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Permanent",
"type": "permanent"
},
"contract_type": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"label": "Full-Time",
"contract_type": "full_time"
},
"work_time": {
"duration": "P0Y0M0DT8H0M0S",
"period": "month"
},
"payroll_code": "PC1",
"passthrough": { "other_known_names": "John Doe" },
"effective_date": "2021-01-01T00:00:00.000Z"
},
"custom_fields": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Training Completion Status",
"value": "Completed",
"value_id": "value_456",
"remote_value_id": "e3cb75bf-aa84-466e-a6c1-b8322b257a48"
}
],
"benefits": [
{
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Health Insurance",
"benefit_type": { "source_value": "<string>" },
"provider": "Aetna",
"description": "Health insurance for employees",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"employee_number": "125",
"national_identity_number": {
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
},
"national_identity_numbers": [
{
"value": "123456789",
"type": {
"value": "ssn",
"source_value": "<string>"
},
"country": {
"value": "US",
"source_value": "<string>"
}
}
],
"home_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": { "other_known_names": "John Doe" },
"state": "GB-LIN"
},
"work_location": {
"id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
"name": "Woolsthorpe Manor",
"phone_number": "+44 1476 860 364",
"street_1": "Water Lane",
"street_2": "Woolsthorpe by Colsterworth",
"city": "Grantham",
"zip_code": "NG33 5NR",
"country": {
"value": "US",
"source_value": "<string>"
},
"passthrough": { "other_known_names": "John Doe" },
"state": "GB-LIN"
},
"passthrough": { "other_known_names": "John Doe" }
}
headers = {
"x-account-id": "<x-account-id>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-account-id': '<x-account-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Mr',
first_name: 'Isaac',
last_name: 'Newton',
name: 'Isaac Newton',
display_name: 'Sir Isaac Newton',
avatar_url: 'https://example.com/avatar.png',
personal_email: 'isaac.newton@example.com',
personal_phone_number: '+1234567890',
work_email: 'newton@example.com',
work_phone_number: '+1234567890',
job_id: 'R-6789',
job_title: 'Physicist',
department_id: '3093',
team_id: '2913',
department: 'Physics',
manager_id: '67890',
gender: 'male',
preferred_language: 'eng',
ethnicity: 'white',
date_of_birth: '1990-01-01T00:00:00.000Z',
birthday: '2021-01-01T00:00:00Z',
marital_status: 'single',
avatar: 'https://example.com/avatar.png',
hire_date: '2021-01-01T00:00:00.000Z',
start_date: '2021-01-01T00:00:00.000Z',
employment_type: 'permanent',
employment_contract_type: 'full_time',
employment_status: 'active',
termination_date: '2021-01-01T00:00:00Z',
company_name: 'Example Corp',
company_id: '1234567890',
citizenships: [{value: 'US', source_value: '<string>'}],
employment: {
unified_custom_fields: {
my_project_custom_field_1: 'REF-1236',
my_project_custom_field_2: 'some other value'
},
job_title: 'Software Engineer',
pay_rate: '40.00',
pay_period: 'monthly',
pay_frequency: 'hourly',
pay_currency: 'USD',
end_date: '2021-01-01T01:01:01.000Z',
grade: {
id: '1687-3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: '1687-4',
description: 'Mid-level employee demonstrating proficiency and autonomy.'
},
employment_type: 'permanent',
employment_contract_type: 'full_time',
type: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
label: 'Permanent',
type: 'permanent'
},
contract_type: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
label: 'Full-Time',
contract_type: 'full_time'
},
work_time: {duration: 'P0Y0M0DT8H0M0S', period: 'month'},
payroll_code: 'PC1',
passthrough: {other_known_names: 'John Doe'},
effective_date: '2021-01-01T00:00:00.000Z'
},
custom_fields: [
{
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Training Completion Status',
value: 'Completed',
value_id: 'value_456',
remote_value_id: 'e3cb75bf-aa84-466e-a6c1-b8322b257a48'
}
],
benefits: [
{
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Health Insurance',
benefit_type: {source_value: '<string>'},
provider: 'Aetna',
description: 'Health insurance for employees',
created_at: '2021-01-01T00:00:00Z',
updated_at: '2021-01-01T00:00:00Z'
}
],
employee_number: '125',
national_identity_number: {
value: '123456789',
type: {value: 'ssn', source_value: '<string>'},
country: {value: 'US', source_value: '<string>'}
},
national_identity_numbers: [
{
value: '123456789',
type: {value: 'ssn', source_value: '<string>'},
country: {value: 'US', source_value: '<string>'}
}
],
home_location: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Woolsthorpe Manor',
phone_number: '+44 1476 860 364',
street_1: 'Water Lane',
street_2: 'Woolsthorpe by Colsterworth',
city: 'Grantham',
zip_code: 'NG33 5NR',
country: {value: 'US', source_value: '<string>'},
passthrough: {other_known_names: 'John Doe'},
state: 'GB-LIN'
},
work_location: {
id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
name: 'Woolsthorpe Manor',
phone_number: '+44 1476 860 364',
street_1: 'Water Lane',
street_2: 'Woolsthorpe by Colsterworth',
city: 'Grantham',
zip_code: 'NG33 5NR',
country: {value: 'US', source_value: '<string>'},
passthrough: {other_known_names: 'John Doe'},
state: 'GB-LIN'
},
passthrough: {other_known_names: 'John Doe'}
})
};
fetch('https://api.stackone.com/unified/hris/employees/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stackone.com/unified/hris/employees/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Mr',
'first_name' => 'Isaac',
'last_name' => 'Newton',
'name' => 'Isaac Newton',
'display_name' => 'Sir Isaac Newton',
'avatar_url' => 'https://example.com/avatar.png',
'personal_email' => 'isaac.newton@example.com',
'personal_phone_number' => '+1234567890',
'work_email' => 'newton@example.com',
'work_phone_number' => '+1234567890',
'job_id' => 'R-6789',
'job_title' => 'Physicist',
'department_id' => '3093',
'team_id' => '2913',
'department' => 'Physics',
'manager_id' => '67890',
'gender' => 'male',
'preferred_language' => 'eng',
'ethnicity' => 'white',
'date_of_birth' => '1990-01-01T00:00:00.000Z',
'birthday' => '2021-01-01T00:00:00Z',
'marital_status' => 'single',
'avatar' => 'https://example.com/avatar.png',
'hire_date' => '2021-01-01T00:00:00.000Z',
'start_date' => '2021-01-01T00:00:00.000Z',
'employment_type' => 'permanent',
'employment_contract_type' => 'full_time',
'employment_status' => 'active',
'termination_date' => '2021-01-01T00:00:00Z',
'company_name' => 'Example Corp',
'company_id' => '1234567890',
'citizenships' => [
[
'value' => 'US',
'source_value' => '<string>'
]
],
'employment' => [
'unified_custom_fields' => [
'my_project_custom_field_1' => 'REF-1236',
'my_project_custom_field_2' => 'some other value'
],
'job_title' => 'Software Engineer',
'pay_rate' => '40.00',
'pay_period' => 'monthly',
'pay_frequency' => 'hourly',
'pay_currency' => 'USD',
'end_date' => '2021-01-01T01:01:01.000Z',
'grade' => [
'id' => '1687-3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => '1687-4',
'description' => 'Mid-level employee demonstrating proficiency and autonomy.'
],
'employment_type' => 'permanent',
'employment_contract_type' => 'full_time',
'type' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'label' => 'Permanent',
'type' => 'permanent'
],
'contract_type' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'label' => 'Full-Time',
'contract_type' => 'full_time'
],
'work_time' => [
'duration' => 'P0Y0M0DT8H0M0S',
'period' => 'month'
],
'payroll_code' => 'PC1',
'passthrough' => [
'other_known_names' => 'John Doe'
],
'effective_date' => '2021-01-01T00:00:00.000Z'
],
'custom_fields' => [
[
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'remote_id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Training Completion Status',
'value' => 'Completed',
'value_id' => 'value_456',
'remote_value_id' => 'e3cb75bf-aa84-466e-a6c1-b8322b257a48'
]
],
'benefits' => [
[
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Health Insurance',
'benefit_type' => [
'source_value' => '<string>'
],
'provider' => 'Aetna',
'description' => 'Health insurance for employees',
'created_at' => '2021-01-01T00:00:00Z',
'updated_at' => '2021-01-01T00:00:00Z'
]
],
'employee_number' => '125',
'national_identity_number' => [
'value' => '123456789',
'type' => [
'value' => 'ssn',
'source_value' => '<string>'
],
'country' => [
'value' => 'US',
'source_value' => '<string>'
]
],
'national_identity_numbers' => [
[
'value' => '123456789',
'type' => [
'value' => 'ssn',
'source_value' => '<string>'
],
'country' => [
'value' => 'US',
'source_value' => '<string>'
]
]
],
'home_location' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Woolsthorpe Manor',
'phone_number' => '+44 1476 860 364',
'street_1' => 'Water Lane',
'street_2' => 'Woolsthorpe by Colsterworth',
'city' => 'Grantham',
'zip_code' => 'NG33 5NR',
'country' => [
'value' => 'US',
'source_value' => '<string>'
],
'passthrough' => [
'other_known_names' => 'John Doe'
],
'state' => 'GB-LIN'
],
'work_location' => [
'id' => '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
'name' => 'Woolsthorpe Manor',
'phone_number' => '+44 1476 860 364',
'street_1' => 'Water Lane',
'street_2' => 'Woolsthorpe by Colsterworth',
'city' => 'Grantham',
'zip_code' => 'NG33 5NR',
'country' => [
'value' => 'US',
'source_value' => '<string>'
],
'passthrough' => [
'other_known_names' => 'John Doe'
],
'state' => 'GB-LIN'
],
'passthrough' => [
'other_known_names' => 'John Doe'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"x-account-id: <x-account-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stackone.com/unified/hris/employees/{id}"
payload := strings.NewReader("{\n \"title\": \"Mr\",\n \"first_name\": \"Isaac\",\n \"last_name\": \"Newton\",\n \"name\": \"Isaac Newton\",\n \"display_name\": \"Sir Isaac Newton\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"personal_email\": \"isaac.newton@example.com\",\n \"personal_phone_number\": \"+1234567890\",\n \"work_email\": \"newton@example.com\",\n \"work_phone_number\": \"+1234567890\",\n \"job_id\": \"R-6789\",\n \"job_title\": \"Physicist\",\n \"department_id\": \"3093\",\n \"team_id\": \"2913\",\n \"department\": \"Physics\",\n \"manager_id\": \"67890\",\n \"gender\": \"male\",\n \"preferred_language\": \"eng\",\n \"ethnicity\": \"white\",\n \"date_of_birth\": \"1990-01-01T00:00:00.000Z\",\n \"birthday\": \"2021-01-01T00:00:00Z\",\n \"marital_status\": \"single\",\n \"avatar\": \"https://example.com/avatar.png\",\n \"hire_date\": \"2021-01-01T00:00:00.000Z\",\n \"start_date\": \"2021-01-01T00:00:00.000Z\",\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"employment_status\": \"active\",\n \"termination_date\": \"2021-01-01T00:00:00Z\",\n \"company_name\": \"Example Corp\",\n \"company_id\": \"1234567890\",\n \"citizenships\": [\n {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n ],\n \"employment\": {\n \"unified_custom_fields\": {\n \"my_project_custom_field_1\": \"REF-1236\",\n \"my_project_custom_field_2\": \"some other value\"\n },\n \"job_title\": \"Software Engineer\",\n \"pay_rate\": \"40.00\",\n \"pay_period\": \"monthly\",\n \"pay_frequency\": \"hourly\",\n \"pay_currency\": \"USD\",\n \"end_date\": \"2021-01-01T01:01:01.000Z\",\n \"grade\": {\n \"id\": \"1687-3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"1687-4\",\n \"description\": \"Mid-level employee demonstrating proficiency and autonomy.\"\n },\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Permanent\",\n \"type\": \"permanent\"\n },\n \"contract_type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Full-Time\",\n \"contract_type\": \"full_time\"\n },\n \"work_time\": {\n \"duration\": \"P0Y0M0DT8H0M0S\",\n \"period\": \"month\"\n },\n \"payroll_code\": \"PC1\",\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"effective_date\": \"2021-01-01T00:00:00.000Z\"\n },\n \"custom_fields\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Training Completion Status\",\n \"value\": \"Completed\",\n \"value_id\": \"value_456\",\n \"remote_value_id\": \"e3cb75bf-aa84-466e-a6c1-b8322b257a48\"\n }\n ],\n \"benefits\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Health Insurance\",\n \"benefit_type\": {\n \"source_value\": \"<string>\"\n },\n \"provider\": \"Aetna\",\n \"description\": \"Health insurance for employees\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n }\n ],\n \"employee_number\": \"125\",\n \"national_identity_number\": {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n },\n \"national_identity_numbers\": [\n {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n }\n ],\n \"home_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"work_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-account-id", "<x-account-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.stackone.com/unified/hris/employees/{id}")
.header("x-account-id", "<x-account-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Mr\",\n \"first_name\": \"Isaac\",\n \"last_name\": \"Newton\",\n \"name\": \"Isaac Newton\",\n \"display_name\": \"Sir Isaac Newton\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"personal_email\": \"isaac.newton@example.com\",\n \"personal_phone_number\": \"+1234567890\",\n \"work_email\": \"newton@example.com\",\n \"work_phone_number\": \"+1234567890\",\n \"job_id\": \"R-6789\",\n \"job_title\": \"Physicist\",\n \"department_id\": \"3093\",\n \"team_id\": \"2913\",\n \"department\": \"Physics\",\n \"manager_id\": \"67890\",\n \"gender\": \"male\",\n \"preferred_language\": \"eng\",\n \"ethnicity\": \"white\",\n \"date_of_birth\": \"1990-01-01T00:00:00.000Z\",\n \"birthday\": \"2021-01-01T00:00:00Z\",\n \"marital_status\": \"single\",\n \"avatar\": \"https://example.com/avatar.png\",\n \"hire_date\": \"2021-01-01T00:00:00.000Z\",\n \"start_date\": \"2021-01-01T00:00:00.000Z\",\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"employment_status\": \"active\",\n \"termination_date\": \"2021-01-01T00:00:00Z\",\n \"company_name\": \"Example Corp\",\n \"company_id\": \"1234567890\",\n \"citizenships\": [\n {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n ],\n \"employment\": {\n \"unified_custom_fields\": {\n \"my_project_custom_field_1\": \"REF-1236\",\n \"my_project_custom_field_2\": \"some other value\"\n },\n \"job_title\": \"Software Engineer\",\n \"pay_rate\": \"40.00\",\n \"pay_period\": \"monthly\",\n \"pay_frequency\": \"hourly\",\n \"pay_currency\": \"USD\",\n \"end_date\": \"2021-01-01T01:01:01.000Z\",\n \"grade\": {\n \"id\": \"1687-3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"1687-4\",\n \"description\": \"Mid-level employee demonstrating proficiency and autonomy.\"\n },\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Permanent\",\n \"type\": \"permanent\"\n },\n \"contract_type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Full-Time\",\n \"contract_type\": \"full_time\"\n },\n \"work_time\": {\n \"duration\": \"P0Y0M0DT8H0M0S\",\n \"period\": \"month\"\n },\n \"payroll_code\": \"PC1\",\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"effective_date\": \"2021-01-01T00:00:00.000Z\"\n },\n \"custom_fields\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Training Completion Status\",\n \"value\": \"Completed\",\n \"value_id\": \"value_456\",\n \"remote_value_id\": \"e3cb75bf-aa84-466e-a6c1-b8322b257a48\"\n }\n ],\n \"benefits\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Health Insurance\",\n \"benefit_type\": {\n \"source_value\": \"<string>\"\n },\n \"provider\": \"Aetna\",\n \"description\": \"Health insurance for employees\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n }\n ],\n \"employee_number\": \"125\",\n \"national_identity_number\": {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n },\n \"national_identity_numbers\": [\n {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n }\n ],\n \"home_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"work_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stackone.com/unified/hris/employees/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-account-id"] = '<x-account-id>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Mr\",\n \"first_name\": \"Isaac\",\n \"last_name\": \"Newton\",\n \"name\": \"Isaac Newton\",\n \"display_name\": \"Sir Isaac Newton\",\n \"avatar_url\": \"https://example.com/avatar.png\",\n \"personal_email\": \"isaac.newton@example.com\",\n \"personal_phone_number\": \"+1234567890\",\n \"work_email\": \"newton@example.com\",\n \"work_phone_number\": \"+1234567890\",\n \"job_id\": \"R-6789\",\n \"job_title\": \"Physicist\",\n \"department_id\": \"3093\",\n \"team_id\": \"2913\",\n \"department\": \"Physics\",\n \"manager_id\": \"67890\",\n \"gender\": \"male\",\n \"preferred_language\": \"eng\",\n \"ethnicity\": \"white\",\n \"date_of_birth\": \"1990-01-01T00:00:00.000Z\",\n \"birthday\": \"2021-01-01T00:00:00Z\",\n \"marital_status\": \"single\",\n \"avatar\": \"https://example.com/avatar.png\",\n \"hire_date\": \"2021-01-01T00:00:00.000Z\",\n \"start_date\": \"2021-01-01T00:00:00.000Z\",\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"employment_status\": \"active\",\n \"termination_date\": \"2021-01-01T00:00:00Z\",\n \"company_name\": \"Example Corp\",\n \"company_id\": \"1234567890\",\n \"citizenships\": [\n {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n ],\n \"employment\": {\n \"unified_custom_fields\": {\n \"my_project_custom_field_1\": \"REF-1236\",\n \"my_project_custom_field_2\": \"some other value\"\n },\n \"job_title\": \"Software Engineer\",\n \"pay_rate\": \"40.00\",\n \"pay_period\": \"monthly\",\n \"pay_frequency\": \"hourly\",\n \"pay_currency\": \"USD\",\n \"end_date\": \"2021-01-01T01:01:01.000Z\",\n \"grade\": {\n \"id\": \"1687-3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"1687-4\",\n \"description\": \"Mid-level employee demonstrating proficiency and autonomy.\"\n },\n \"employment_type\": \"permanent\",\n \"employment_contract_type\": \"full_time\",\n \"type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Permanent\",\n \"type\": \"permanent\"\n },\n \"contract_type\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"label\": \"Full-Time\",\n \"contract_type\": \"full_time\"\n },\n \"work_time\": {\n \"duration\": \"P0Y0M0DT8H0M0S\",\n \"period\": \"month\"\n },\n \"payroll_code\": \"PC1\",\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"effective_date\": \"2021-01-01T00:00:00.000Z\"\n },\n \"custom_fields\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"remote_id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Training Completion Status\",\n \"value\": \"Completed\",\n \"value_id\": \"value_456\",\n \"remote_value_id\": \"e3cb75bf-aa84-466e-a6c1-b8322b257a48\"\n }\n ],\n \"benefits\": [\n {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Health Insurance\",\n \"benefit_type\": {\n \"source_value\": \"<string>\"\n },\n \"provider\": \"Aetna\",\n \"description\": \"Health insurance for employees\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n }\n ],\n \"employee_number\": \"125\",\n \"national_identity_number\": {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n },\n \"national_identity_numbers\": [\n {\n \"value\": \"123456789\",\n \"type\": {\n \"value\": \"ssn\",\n \"source_value\": \"<string>\"\n },\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n }\n }\n ],\n \"home_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"work_location\": {\n \"id\": \"8187e5da-dc77-475e-9949-af0f1fa4e4e3\",\n \"name\": \"Woolsthorpe Manor\",\n \"phone_number\": \"+44 1476 860 364\",\n \"street_1\": \"Water Lane\",\n \"street_2\": \"Woolsthorpe by Colsterworth\",\n \"city\": \"Grantham\",\n \"zip_code\": \"NG33 5NR\",\n \"country\": {\n \"value\": \"US\",\n \"source_value\": \"<string>\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n },\n \"state\": \"GB-LIN\"\n },\n \"passthrough\": {\n \"other_known_names\": \"John Doe\"\n }\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Record updated successfully.",
"timestamp": "2021-01-01T01:01:01.000Z"
}{
"statusCode": 400,
"message": "Bad Request",
"timestamp": "2023-05-30T00:00:00.000Z",
"data": {
"statusCode": 400,
"message": "Bad Request",
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
},
"provider_errors": [
{
"status": 400,
"url": "https://api.provider.com/v1/resource",
"raw": {
"message": "Invalid input parameters"
},
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
}
]
}{
"statusCode": 401,
"message": "Unauthorized",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 403,
"message": "Forbidden resource",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 404,
"message": "Not Found",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 408,
"message": "Request timed out",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 409,
"message": "Conflict",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 412,
"message": "Precondition failed",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 422,
"message": "Unprocessable Entity",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 429,
"message": "Too many requests",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 500,
"message": "Internal server error",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 501,
"message": "Not Implemented",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 502,
"message": "Bad Gateway",
"timestamp": "2023-05-30T00:00:00.000Z"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Headers
The account identifier
Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240)
"heartbeat"
Path Parameters
Body
The prefix of the employee's name (e.g., Mr, Ms, Dr)
"Mr"
The employee first name
"Isaac"
The employee last name
"Newton"
The employee name
"Isaac Newton"
The employee display name
"Sir Isaac Newton"
The employee avatar Url
"https://example.com/avatar.png"
The employee personal email
"isaac.newton@example.com"
The employee personal phone number
"+1234567890"
The employee work email
"newton@example.com"
The employee work phone number
"+1234567890"
The employee job id
"R-6789"
If the source of the job_title is the Employee's current Employment, and that Employment pertains exclusively to this Employee, then the active Employment job_title will also be written
"Physicist"
The employee department id
"3093"
The employee team id
"2913"
The employee department
"Physics"
The employee manager ID
"67890"
The employee gender
Show child attributes
Show child attributes
"male"
The employee preferred language
Show child attributes
Show child attributes
"eng"
The employee ethnicity
Show child attributes
Show child attributes
"white"
The date when the employee was born
"1990-01-01T00:00:00.000Z"
The next birthday of the employee (upcoming birthday)
"2021-01-01T00:00:00Z"
The employee marital status
Show child attributes
Show child attributes
"single"
The employee avatar
Show child attributes
Show child attributes
"https://example.com/avatar.png"
The employee hire date
"2021-01-01T00:00:00.000Z"
The employee start date
"2021-01-01T00:00:00.000Z"
The employee employment type
Show child attributes
Show child attributes
"permanent"
The employment work schedule type (e.g., full-time, part-time)
Show child attributes
Show child attributes
"full_time"
The employee employment status
Show child attributes
Show child attributes
"active"
The employee termination date
"2021-01-01T00:00:00Z"
The employee company name
"Example Corp"
The employee company id
"1234567890"
The citizenships of the Employee
Show child attributes
Show child attributes
The employee employment
Show child attributes
Show child attributes
The employee custom fields
Show child attributes
Show child attributes
Current benefits of the employee
Show child attributes
Show child attributes
The assigned employee number
"125"
The national identity number
Show child attributes
Show child attributes
The national identity numbers
Show child attributes
Show child attributes
The employee home location
Show child attributes
Show child attributes
The employee work location
Show child attributes
Show child attributes
Value to pass through to the provider
{ "other_known_names": "John Doe" }Was this page helpful?