Skip to main content
PATCH
/
unified
/
hris
/
employees
/
{id}
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

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Headers

x-account-id
string
required

The account identifier

Prefer
string

Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240)

Example:

"heartbeat"

Path Parameters

id
string
required

Body

application/json
title
string | null

The prefix of the employee's name (e.g., Mr, Ms, Dr)

Example:

"Mr"

first_name
string | null

The employee first name

Example:

"Isaac"

last_name
string | null

The employee last name

Example:

"Newton"

name
string | null

The employee name

Example:

"Isaac Newton"

display_name
string | null

The employee display name

Example:

"Sir Isaac Newton"

avatar_url
string | null

The employee avatar Url

Example:

"https://example.com/avatar.png"

personal_email
string | null

The employee personal email

Example:

"isaac.newton@example.com"

personal_phone_number
string | null

The employee personal phone number

Example:

"+1234567890"

work_email
string | null

The employee work email

Example:

"newton@example.com"

work_phone_number
string | null

The employee work phone number

Example:

"+1234567890"

job_id
string | null
deprecated

The employee job id

Example:

"R-6789"

job_title
string | null

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

Example:

"Physicist"

department_id
string | null

The employee department id

Example:

"3093"

team_id
string | null

The employee team id

Example:

"2913"

department
string | null

The employee department

Example:

"Physics"

manager_id
string | null

The employee manager ID

Example:

"67890"

gender
object | null

The employee gender

Example:

"male"

preferred_language
object | null

The employee preferred language

Example:

"eng"

ethnicity
object | null

The employee ethnicity

Example:

"white"

date_of_birth
string<date-time> | null

The date when the employee was born

Example:

"1990-01-01T00:00:00.000Z"

birthday
string<date-time> | null

The next birthday of the employee (upcoming birthday)

Example:

"2021-01-01T00:00:00Z"

marital_status
object | null

The employee marital status

Example:

"single"

avatar
object | null

The employee avatar

Example:

"https://example.com/avatar.png"

hire_date
string<date-time> | null

The employee hire date

Example:

"2021-01-01T00:00:00.000Z"

start_date
string<date-time> | null

The employee start date

Example:

"2021-01-01T00:00:00.000Z"

employment_type
object | null
deprecated

The employee employment type

Example:

"permanent"

employment_contract_type
object | null
deprecated

The employment work schedule type (e.g., full-time, part-time)

Example:

"full_time"

employment_status
object | null

The employee employment status

Example:

"active"

termination_date
string<date-time> | null

The employee termination date

Example:

"2021-01-01T00:00:00Z"

company_name
string | null
deprecated

The employee company name

Example:

"Example Corp"

company_id
string | null

The employee company id

Example:

"1234567890"

citizenships
object[] | null

The citizenships of the Employee

employment
object | null

The employee employment

custom_fields
object[] | null

The employee custom fields

benefits
object[] | null

Current benefits of the employee

employee_number
string | null

The assigned employee number

Example:

"125"

national_identity_number
object | null
deprecated

The national identity number

national_identity_numbers
object[] | null

The national identity numbers

home_location
object | null

The employee home location

work_location
object | null

The employee work location

passthrough
object | null

Value to pass through to the provider

Example:
{ "other_known_names": "John Doe" }

Response

Record updated successfully

statusCode
number
required
Example:

200

message
string
required
Example:

"Record updated successfully."

timestamp
string<date-time>
required
Example:

"2021-01-01T01:01:01.000Z"