(hris.employees)
- list - List Employees
- create - Create Employee
- get - Get Employee
- update - Update Employee
- delete - Delete Employee
Apideck operates as a stateless Unified API, which means that the list endpoint only provides a portion of the employee model. This is due to the fact that most HRIS systems do not readily provide all data in every call. However, you can access the complete employee model through an employee detail call.
import apideck_unify
from apideck_unify import Apideck
import os
with Apideck(
api_key=os.getenv("APIDECK_API_KEY", ""),
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:
res = apideck.hris.employees.list(raw=False, consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", service_id="salesforce", limit=20, filter_={
"company_id": "1234",
"email": "[email protected]",
"first_name": "Elon",
"title": "Manager",
"last_name": "Musk",
"manager_id": "1234",
"employment_status": apideck_unify.EmployeesFilterEmploymentStatus.ACTIVE,
"employee_number": "123456-AB",
"department_id": "1234",
}, sort={
"by": apideck_unify.EmployeesSortBy.CREATED_AT,
"direction": apideck_unify.SortDirection.DESC,
}, pass_through={
"search": "San Francisco",
}, fields="id,updated_at")
while res is not None:
# Handle items
res = res.next()
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
raw |
Optional[bool] | ➖ | Include raw response. Mostly used for debugging purposes | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
service_id |
Optional[str] | ➖ | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce |
cursor |
OptionalNullable[str] | ➖ | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | |
limit |
Optional[int] | ➖ | Number of results to return. Minimum 1, Maximum 200, Default 20 | |
filter_ |
Optional[models.EmployeesFilter] | ➖ | Apply filters | { "company_id": "1234", "email": "[email protected]", "first_name": "Elon", "last_name": "Musk", "title": "Manager", "manager_id": "1234", "employment_status": "active", "employee_number": "123456-AB", "department_id": "1234" } |
sort |
Optional[models.EmployeesSort] | ➖ | Apply sorting | { "by": "created_at", "direction": "desc" } |
pass_through |
Dict[str, Any] | ➖ | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | { "search": "San Francisco" } |
fields |
OptionalNullable[str] | ➖ | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: fields=name,email,addresses.city In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
id,updated_at |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.HrisEmployeesAllResponse
Error Type | Status Code | Content Type |
---|---|---|
models.BadRequestResponse | 400 | application/json |
models.UnauthorizedResponse | 401 | application/json |
models.PaymentRequiredResponse | 402 | application/json |
models.NotFoundResponse | 404 | application/json |
models.UnprocessableResponse | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Create Employee
import apideck_unify
from apideck_unify import Apideck
import dateutil.parser
import os
with Apideck(
api_key=os.getenv("APIDECK_API_KEY", ""),
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:
res = apideck.hris.employees.create(raw=False, consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", service_id="salesforce", id="12345", first_name="Elon", last_name="Musk", middle_name="D.", display_name="Technoking", preferred_name="Elon Musk", initials="EM", salutation="Mr", title="CEO", marital_status="married", partner={
"first_name": "Elon",
"last_name": "Musk",
"middle_name": "D.",
"gender": apideck_unify.Gender.MALE,
"initials": "EM",
"birthday": dateutil.parser.parse("2000-08-12").date(),
"deceased_on": dateutil.parser.parse("2000-08-12").date(),
}, division="Europe", division_id="12345", department_id="12345", department_name="12345", team={
"id": "1234",
"name": "Full Stack Engineers",
}, company_id="23456", company_name="SpaceX", employment_start_date="2021-10-26", employment_end_date="2028-10-26", leaving_reason=apideck_unify.LeavingReason.RESIGNED, employee_number="123456-AB", employment_status=apideck_unify.EmploymentStatus.ACTIVE, ethnicity="African American", manager={
"id": "12345",
"name": "Elon Musk",
"first_name": "Elon",
"last_name": "Musk",
"email": "[email protected]",
"employment_status": apideck_unify.EmploymentStatus.ACTIVE,
}, direct_reports=[
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6",
], social_security_number="123456789", birthday=dateutil.parser.parse("2000-08-12").date(), deceased_on=dateutil.parser.parse("2000-08-12").date(), country_of_birth="US", description="A description", gender=apideck_unify.Gender.MALE, pronouns="she,her", preferred_language="EN", languages=[
"EN",
], nationalities=[
"US",
], photo_url="https://unavatar.io/elon-musk", timezone="Europe/London", source="lever", source_id="12345", record_url="https://app.intercom.io/contacts/12345", jobs=[
{
"title": "CEO",
"role": "Sales",
"start_date": dateutil.parser.parse("2020-08-12").date(),
"end_date": dateutil.parser.parse("2020-08-12").date(),
"compensation_rate": 72000,
"currency": apideck_unify.Currency.USD,
"payment_unit": apideck_unify.PaymentUnit.YEAR,
"hired_at": dateutil.parser.parse("2020-08-12").date(),
"is_primary": True,
"is_manager": True,
"status": apideck_unify.EmployeeJobStatus.ACTIVE,
"location": {
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
},
{
"title": "CEO",
"role": "Sales",
"start_date": dateutil.parser.parse("2020-08-12").date(),
"end_date": dateutil.parser.parse("2020-08-12").date(),
"compensation_rate": 72000,
"currency": apideck_unify.Currency.USD,
"payment_unit": apideck_unify.PaymentUnit.YEAR,
"hired_at": dateutil.parser.parse("2020-08-12").date(),
"is_primary": True,
"is_manager": True,
"status": apideck_unify.EmployeeJobStatus.ACTIVE,
"location": {
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
},
], compensations=[
{
"rate": 50,
"payment_unit": apideck_unify.PaymentUnit.HOUR,
"flsa_status": apideck_unify.FlsaStatus.NONEXEMPT,
"effective_date": "2021-06-11",
},
], works_remote=True, addresses=[
{
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
{
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
], phone_numbers=[
{
"number": "111-111-1111",
"id": "12345",
"country_code": "1",
"area_code": "323",
"extension": "105",
"type": apideck_unify.PhoneNumberType.PRIMARY,
},
{
"number": "111-111-1111",
"id": "12345",
"country_code": "1",
"area_code": "323",
"extension": "105",
"type": apideck_unify.PhoneNumberType.PRIMARY,
},
], emails=[
{
"email": "[email protected]",
"id": "123",
"type": apideck_unify.EmailType.PRIMARY,
},
], custom_fields=[
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": [
"<value>",
"<value>",
"<value>",
],
},
], social_links=[
{
"url": "https://www.twitter.com/apideck",
"id": "12345",
"type": "twitter",
},
], bank_accounts=[
{
"bank_name": "Monzo",
"account_number": "123465",
"account_name": "SPACEX LLC",
"account_type": apideck_unify.AccountType.CREDIT_CARD,
"iban": "CH2989144532982975332",
"bic": "AUDSCHGGXXX",
"routing_number": "012345678",
"bsb_number": "062-001",
"branch_identifier": "001",
"bank_code": "BNH",
"currency": apideck_unify.Currency.USD,
},
], tax_code="1111", tax_id="234-32-0000", dietary_preference="Veggie", food_allergies=[
"No allergies",
], probation_period={
"start_date": dateutil.parser.parse("2021-10-01").date(),
"end_date": dateutil.parser.parse("2021-11-28").date(),
}, tags=[
"New",
], row_version="1-12345", deleted=True, pass_through=[
{
"service_id": "<id>",
"extend_paths": [
{
"path": "$.nested.property",
"value": {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
{
"path": "$.nested.property",
"value": {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
{
"path": "$.nested.property",
"value": {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
])
assert res.create_employee_response is not None
# Handle response
print(res.create_employee_response)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
raw |
Optional[bool] | ➖ | Include raw response. Mostly used for debugging purposes | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
service_id |
Optional[str] | ➖ | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce |
id |
OptionalNullable[str] | ➖ | A unique identifier for an object. | 12345 |
first_name |
OptionalNullable[str] | ➖ | The first name of the person. | Elon |
last_name |
OptionalNullable[str] | ➖ | The last name of the person. | Musk |
middle_name |
OptionalNullable[str] | ➖ | Middle name of the person. | D. |
display_name |
OptionalNullable[str] | ➖ | The name used to display the employee, often a combination of their first and last names. | Technoking |
preferred_name |
OptionalNullable[str] | ➖ | The name the employee prefers to be addressed by, which may be different from their legal name. | Elon Musk |
initials |
OptionalNullable[str] | ➖ | The initials of the person, usually derived from their first, middle, and last names. | EM |
salutation |
OptionalNullable[str] | ➖ | A formal salutation for the person. For example, 'Mr', 'Mrs' | Mr |
title |
OptionalNullable[str] | ➖ | The job title of the person. | CEO |
marital_status |
OptionalNullable[str] | ➖ | The marital status of the employee. | married |
partner |
Optional[models.PersonInput] | ➖ | N/A | |
division |
OptionalNullable[str] | ➖ | The division the person is currently in. Usually a collection of departments or teams or regions. | Europe |
division_id |
OptionalNullable[str] | ➖ | Unique identifier of the division this employee belongs to. | 12345 |
department |
OptionalNullable[str] | ➖ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. The department the person is currently in. Deprecated in favor of the dedicated department_id and department_name field. |
R&D |
department_id |
OptionalNullable[str] | ➖ | Unique identifier of the department ID this employee belongs to. | 12345 |
department_name |
OptionalNullable[str] | ➖ | Name of the department this employee belongs to. | 12345 |
team |
OptionalNullable[models.Team] | ➖ | The team the person is currently in. | |
company_id |
OptionalNullable[str] | ➖ | The unique identifier of the company. | 23456 |
company_name |
OptionalNullable[str] | ➖ | The name of the company. | SpaceX |
employment_start_date |
OptionalNullable[str] | ➖ | A Start Date is the date that the employee started working at the company | 2021-10-26 |
employment_end_date |
OptionalNullable[str] | ➖ | An End Date is the date that the employee ended working at the company | 2028-10-26 |
leaving_reason |
OptionalNullable[models.LeavingReason] | ➖ | The reason because the employment ended. | resigned |
employee_number |
OptionalNullable[str] | ➖ | An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. | 123456-AB |
employment_status |
OptionalNullable[models.EmploymentStatus] | ➖ | The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. | active |
employment_role |
Optional[models.EmploymentRole] | ➖ | N/A | |
ethnicity |
OptionalNullable[str] | ➖ | The ethnicity of the employee | African American |
manager |
Optional[models.Manager] | ➖ | N/A | |
direct_reports |
List[str] | ➖ | Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. | [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6" ] |
social_security_number |
OptionalNullable[str] | ➖ | A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. | 123456789 |
birthday |
datetime | ➖ | The date of birth of the person. | 2000-08-12 |
deceased_on |
datetime | ➖ | The date the person deceased. | 2000-08-12 |
country_of_birth |
OptionalNullable[str] | ➖ | Country code according to ISO 3166-1 alpha-2. | US |
description |
OptionalNullable[str] | ➖ | A description of the object. | A description |
gender |
OptionalNullable[models.Gender] | ➖ | The gender represents the gender identity of a person. | male |
pronouns |
OptionalNullable[str] | ➖ | The preferred pronouns of the person. | she,her |
preferred_language |
OptionalNullable[str] | ➖ | language code according to ISO 639-1. For the United States - EN | EN |
languages |
List[str] | ➖ | N/A | |
nationalities |
List[str] | ➖ | N/A | |
photo_url |
OptionalNullable[str] | ➖ | The URL of the photo of a person. | https://unavatar.io/elon-musk |
timezone |
OptionalNullable[str] | ➖ | The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. | Europe/London |
source |
OptionalNullable[str] | ➖ | When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. | lever |
source_id |
OptionalNullable[str] | ➖ | Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). | 12345 |
record_url |
OptionalNullable[str] | ➖ | N/A | https://app.intercom.io/contacts/12345 |
jobs |
List[models.EmployeeJobInput] | ➖ | N/A | |
compensations |
List[models.EmployeeCompensationInput] | ➖ | N/A | |
works_remote |
OptionalNullable[bool] | ➖ | Indicates if the employee works from a remote location. | true |
addresses |
List[models.Address] | ➖ | N/A | |
phone_numbers |
List[models.PhoneNumber] | ➖ | N/A | |
emails |
List[models.Email] | ➖ | N/A | |
custom_fields |
List[models.CustomField] | ➖ | N/A | |
social_links |
List[models.SocialLink] | ➖ | N/A | |
bank_accounts |
List[models.BankAccount] | ➖ | N/A | |
tax_code |
OptionalNullable[str] | ➖ | N/A | 1111 |
tax_id |
OptionalNullable[str] | ➖ | N/A | 234-32-0000 |
dietary_preference |
OptionalNullable[str] | ➖ | Indicate the employee's dietary preference. | Veggie |
food_allergies |
List[str] | ➖ | Indicate the employee's food allergies. | [ "No allergies" ] |
probation_period |
Optional[models.ProbationPeriod] | ➖ | N/A | |
tags |
List[str] | ➖ | N/A | [ "New" ] |
row_version |
OptionalNullable[str] | ➖ | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 |
deleted |
OptionalNullable[bool] | ➖ | Flag to indicate if the object is deleted. | true |
pass_through |
List[models.PassThroughBody] | ➖ | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.HrisEmployeesAddResponse
Error Type | Status Code | Content Type |
---|---|---|
models.BadRequestResponse | 400 | application/json |
models.UnauthorizedResponse | 401 | application/json |
models.PaymentRequiredResponse | 402 | application/json |
models.NotFoundResponse | 404 | application/json |
models.UnprocessableResponse | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Get Employee
from apideck_unify import Apideck
import os
with Apideck(
api_key=os.getenv("APIDECK_API_KEY", ""),
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:
res = apideck.hris.employees.get(id="<id>", consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", service_id="salesforce", raw=False, fields="id,updated_at", filter_={
"company_id": "1234",
}, pass_through={
"search": "San Francisco",
})
assert res.get_employee_response is not None
# Handle response
print(res.get_employee_response)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id |
str | ✔️ | ID of the record you are acting upon. | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
service_id |
Optional[str] | ➖ | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce |
raw |
Optional[bool] | ➖ | Include raw response. Mostly used for debugging purposes | |
fields |
OptionalNullable[str] | ➖ | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: fields=name,email,addresses.city In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
id,updated_at |
filter_ |
Optional[models.EmployeesOneFilter] | ➖ | Apply filters | { "company_id": "1234" } |
pass_through |
Dict[str, Any] | ➖ | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | { "search": "San Francisco" } |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.HrisEmployeesOneResponse
Error Type | Status Code | Content Type |
---|---|---|
models.BadRequestResponse | 400 | application/json |
models.UnauthorizedResponse | 401 | application/json |
models.PaymentRequiredResponse | 402 | application/json |
models.NotFoundResponse | 404 | application/json |
models.UnprocessableResponse | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Update Employee
import apideck_unify
from apideck_unify import Apideck
import dateutil.parser
import os
with Apideck(
api_key=os.getenv("APIDECK_API_KEY", ""),
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:
res = apideck.hris.employees.update(id_param="<value>", consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", service_id="salesforce", raw=False, id="12345", first_name="Elon", last_name="Musk", middle_name="D.", display_name="Technoking", preferred_name="Elon Musk", initials="EM", salutation="Mr", title="CEO", marital_status="married", partner={
"first_name": "Elon",
"last_name": "Musk",
"middle_name": "D.",
"gender": apideck_unify.Gender.MALE,
"initials": "EM",
"birthday": dateutil.parser.parse("2000-08-12").date(),
"deceased_on": dateutil.parser.parse("2000-08-12").date(),
}, division="Europe", division_id="12345", department_id="12345", department_name="12345", team={
"id": "1234",
"name": "Full Stack Engineers",
}, company_id="23456", company_name="SpaceX", employment_start_date="2021-10-26", employment_end_date="2028-10-26", leaving_reason=apideck_unify.LeavingReason.RESIGNED, employee_number="123456-AB", employment_status=apideck_unify.EmploymentStatus.ACTIVE, ethnicity="African American", manager={
"id": "12345",
"name": "Elon Musk",
"first_name": "Elon",
"last_name": "Musk",
"email": "[email protected]",
"employment_status": apideck_unify.EmploymentStatus.ACTIVE,
}, direct_reports=[
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6",
], social_security_number="123456789", birthday=dateutil.parser.parse("2000-08-12").date(), deceased_on=dateutil.parser.parse("2000-08-12").date(), country_of_birth="US", description="A description", gender=apideck_unify.Gender.MALE, pronouns="she,her", preferred_language="EN", languages=[
"EN",
], nationalities=[
"US",
], photo_url="https://unavatar.io/elon-musk", timezone="Europe/London", source="lever", source_id="12345", record_url="https://app.intercom.io/contacts/12345", jobs=[
{
"title": "CEO",
"role": "Sales",
"start_date": dateutil.parser.parse("2020-08-12").date(),
"end_date": dateutil.parser.parse("2020-08-12").date(),
"compensation_rate": 72000,
"currency": apideck_unify.Currency.USD,
"payment_unit": apideck_unify.PaymentUnit.YEAR,
"hired_at": dateutil.parser.parse("2020-08-12").date(),
"is_primary": True,
"is_manager": True,
"status": apideck_unify.EmployeeJobStatus.ACTIVE,
"location": {
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
},
{
"title": "CEO",
"role": "Sales",
"start_date": dateutil.parser.parse("2020-08-12").date(),
"end_date": dateutil.parser.parse("2020-08-12").date(),
"compensation_rate": 72000,
"currency": apideck_unify.Currency.USD,
"payment_unit": apideck_unify.PaymentUnit.YEAR,
"hired_at": dateutil.parser.parse("2020-08-12").date(),
"is_primary": True,
"is_manager": True,
"status": apideck_unify.EmployeeJobStatus.ACTIVE,
"location": {
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
},
{
"title": "CEO",
"role": "Sales",
"start_date": dateutil.parser.parse("2020-08-12").date(),
"end_date": dateutil.parser.parse("2020-08-12").date(),
"compensation_rate": 72000,
"currency": apideck_unify.Currency.USD,
"payment_unit": apideck_unify.PaymentUnit.YEAR,
"hired_at": dateutil.parser.parse("2020-08-12").date(),
"is_primary": True,
"is_manager": True,
"status": apideck_unify.EmployeeJobStatus.ACTIVE,
"location": {
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
},
], compensations=[
{
"rate": 50,
"payment_unit": apideck_unify.PaymentUnit.HOUR,
"flsa_status": apideck_unify.FlsaStatus.NONEXEMPT,
"effective_date": "2021-06-11",
},
], works_remote=True, addresses=[
{
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
{
"id": "123",
"type": apideck_unify.Type.PRIMARY,
"string": "25 Spring Street, Blackburn, VIC 3130",
"name": "HQ US",
"line1": "Main street",
"line2": "apt #",
"line3": "Suite #",
"line4": "delivery instructions",
"street_number": "25",
"city": "San Francisco",
"state": "CA",
"postal_code": "94104",
"country": "US",
"latitude": "40.759211",
"longitude": "-73.984638",
"county": "Santa Clara",
"contact_name": "Elon Musk",
"salutation": "Mr",
"phone_number": "111-111-1111",
"fax": "122-111-1111",
"email": "[email protected]",
"website": "https://elonmusk.com",
"notes": "Address notes or delivery instructions.",
"row_version": "1-12345",
},
], phone_numbers=[
{
"number": "111-111-1111",
"id": "12345",
"country_code": "1",
"area_code": "323",
"extension": "105",
"type": apideck_unify.PhoneNumberType.PRIMARY,
},
{
"number": "111-111-1111",
"id": "12345",
"country_code": "1",
"area_code": "323",
"extension": "105",
"type": apideck_unify.PhoneNumberType.PRIMARY,
},
], emails=[
{
"email": "[email protected]",
"id": "123",
"type": apideck_unify.EmailType.PRIMARY,
},
{
"email": "[email protected]",
"id": "123",
"type": apideck_unify.EmailType.PRIMARY,
},
{
"email": "[email protected]",
"id": "123",
"type": apideck_unify.EmailType.PRIMARY,
},
], custom_fields=[
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": True,
},
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": {},
},
], social_links=[
{
"url": "https://www.twitter.com/apideck",
"id": "12345",
"type": "twitter",
},
{
"url": "https://www.twitter.com/apideck",
"id": "12345",
"type": "twitter",
},
{
"url": "https://www.twitter.com/apideck",
"id": "12345",
"type": "twitter",
},
], bank_accounts=[
{
"bank_name": "Monzo",
"account_number": "123465",
"account_name": "SPACEX LLC",
"account_type": apideck_unify.AccountType.CREDIT_CARD,
"iban": "CH2989144532982975332",
"bic": "AUDSCHGGXXX",
"routing_number": "012345678",
"bsb_number": "062-001",
"branch_identifier": "001",
"bank_code": "BNH",
"currency": apideck_unify.Currency.USD,
},
{
"bank_name": "Monzo",
"account_number": "123465",
"account_name": "SPACEX LLC",
"account_type": apideck_unify.AccountType.CREDIT_CARD,
"iban": "CH2989144532982975332",
"bic": "AUDSCHGGXXX",
"routing_number": "012345678",
"bsb_number": "062-001",
"branch_identifier": "001",
"bank_code": "BNH",
"currency": apideck_unify.Currency.USD,
},
], tax_code="1111", tax_id="234-32-0000", dietary_preference="Veggie", food_allergies=[
"No allergies",
], probation_period={
"start_date": dateutil.parser.parse("2021-10-01").date(),
"end_date": dateutil.parser.parse("2021-11-28").date(),
}, tags=[
"New",
], row_version="1-12345", deleted=True, pass_through=[
{
"service_id": "<id>",
"extend_paths": [
{
"path": "$.nested.property",
"value": {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
])
assert res.update_employee_response is not None
# Handle response
print(res.update_employee_response)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id_param |
str | ✔️ | ID of the record you are acting upon. | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
service_id |
Optional[str] | ➖ | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce |
raw |
Optional[bool] | ➖ | Include raw response. Mostly used for debugging purposes | |
id |
OptionalNullable[str] | ➖ | A unique identifier for an object. | 12345 |
first_name |
OptionalNullable[str] | ➖ | The first name of the person. | Elon |
last_name |
OptionalNullable[str] | ➖ | The last name of the person. | Musk |
middle_name |
OptionalNullable[str] | ➖ | Middle name of the person. | D. |
display_name |
OptionalNullable[str] | ➖ | The name used to display the employee, often a combination of their first and last names. | Technoking |
preferred_name |
OptionalNullable[str] | ➖ | The name the employee prefers to be addressed by, which may be different from their legal name. | Elon Musk |
initials |
OptionalNullable[str] | ➖ | The initials of the person, usually derived from their first, middle, and last names. | EM |
salutation |
OptionalNullable[str] | ➖ | A formal salutation for the person. For example, 'Mr', 'Mrs' | Mr |
title |
OptionalNullable[str] | ➖ | The job title of the person. | CEO |
marital_status |
OptionalNullable[str] | ➖ | The marital status of the employee. | married |
partner |
Optional[models.PersonInput] | ➖ | N/A | |
division |
OptionalNullable[str] | ➖ | The division the person is currently in. Usually a collection of departments or teams or regions. | Europe |
division_id |
OptionalNullable[str] | ➖ | Unique identifier of the division this employee belongs to. | 12345 |
department |
OptionalNullable[str] | ➖ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. The department the person is currently in. Deprecated in favor of the dedicated department_id and department_name field. |
R&D |
department_id |
OptionalNullable[str] | ➖ | Unique identifier of the department ID this employee belongs to. | 12345 |
department_name |
OptionalNullable[str] | ➖ | Name of the department this employee belongs to. | 12345 |
team |
OptionalNullable[models.Team] | ➖ | The team the person is currently in. | |
company_id |
OptionalNullable[str] | ➖ | The unique identifier of the company. | 23456 |
company_name |
OptionalNullable[str] | ➖ | The name of the company. | SpaceX |
employment_start_date |
OptionalNullable[str] | ➖ | A Start Date is the date that the employee started working at the company | 2021-10-26 |
employment_end_date |
OptionalNullable[str] | ➖ | An End Date is the date that the employee ended working at the company | 2028-10-26 |
leaving_reason |
OptionalNullable[models.LeavingReason] | ➖ | The reason because the employment ended. | resigned |
employee_number |
OptionalNullable[str] | ➖ | An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. | 123456-AB |
employment_status |
OptionalNullable[models.EmploymentStatus] | ➖ | The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. | active |
employment_role |
Optional[models.EmploymentRole] | ➖ | N/A | |
ethnicity |
OptionalNullable[str] | ➖ | The ethnicity of the employee | African American |
manager |
Optional[models.Manager] | ➖ | N/A | |
direct_reports |
List[str] | ➖ | Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. | [ "a0d636c6-43b3-4bde-8c70-85b707d992f4", "a98lfd96-43b3-4bde-8c70-85b707d992e6" ] |
social_security_number |
OptionalNullable[str] | ➖ | A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. | 123456789 |
birthday |
datetime | ➖ | The date of birth of the person. | 2000-08-12 |
deceased_on |
datetime | ➖ | The date the person deceased. | 2000-08-12 |
country_of_birth |
OptionalNullable[str] | ➖ | Country code according to ISO 3166-1 alpha-2. | US |
description |
OptionalNullable[str] | ➖ | A description of the object. | A description |
gender |
OptionalNullable[models.Gender] | ➖ | The gender represents the gender identity of a person. | male |
pronouns |
OptionalNullable[str] | ➖ | The preferred pronouns of the person. | she,her |
preferred_language |
OptionalNullable[str] | ➖ | language code according to ISO 639-1. For the United States - EN | EN |
languages |
List[str] | ➖ | N/A | |
nationalities |
List[str] | ➖ | N/A | |
photo_url |
OptionalNullable[str] | ➖ | The URL of the photo of a person. | https://unavatar.io/elon-musk |
timezone |
OptionalNullable[str] | ➖ | The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. | Europe/London |
source |
OptionalNullable[str] | ➖ | When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. | lever |
source_id |
OptionalNullable[str] | ➖ | Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). | 12345 |
record_url |
OptionalNullable[str] | ➖ | N/A | https://app.intercom.io/contacts/12345 |
jobs |
List[models.EmployeeJobInput] | ➖ | N/A | |
compensations |
List[models.EmployeeCompensationInput] | ➖ | N/A | |
works_remote |
OptionalNullable[bool] | ➖ | Indicates if the employee works from a remote location. | true |
addresses |
List[models.Address] | ➖ | N/A | |
phone_numbers |
List[models.PhoneNumber] | ➖ | N/A | |
emails |
List[models.Email] | ➖ | N/A | |
custom_fields |
List[models.CustomField] | ➖ | N/A | |
social_links |
List[models.SocialLink] | ➖ | N/A | |
bank_accounts |
List[models.BankAccount] | ➖ | N/A | |
tax_code |
OptionalNullable[str] | ➖ | N/A | 1111 |
tax_id |
OptionalNullable[str] | ➖ | N/A | 234-32-0000 |
dietary_preference |
OptionalNullable[str] | ➖ | Indicate the employee's dietary preference. | Veggie |
food_allergies |
List[str] | ➖ | Indicate the employee's food allergies. | [ "No allergies" ] |
probation_period |
Optional[models.ProbationPeriod] | ➖ | N/A | |
tags |
List[str] | ➖ | N/A | [ "New" ] |
row_version |
OptionalNullable[str] | ➖ | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 |
deleted |
OptionalNullable[bool] | ➖ | Flag to indicate if the object is deleted. | true |
pass_through |
List[models.PassThroughBody] | ➖ | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.HrisEmployeesUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.BadRequestResponse | 400 | application/json |
models.UnauthorizedResponse | 401 | application/json |
models.PaymentRequiredResponse | 402 | application/json |
models.NotFoundResponse | 404 | application/json |
models.UnprocessableResponse | 422 | application/json |
models.APIError | 4XX, 5XX | */* |
Delete Employee
from apideck_unify import Apideck
import os
with Apideck(
api_key=os.getenv("APIDECK_API_KEY", ""),
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:
res = apideck.hris.employees.delete(id="<id>", consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", service_id="salesforce", raw=False)
assert res.delete_employee_response is not None
# Handle response
print(res.delete_employee_response)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id |
str | ✔️ | ID of the record you are acting upon. | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
service_id |
Optional[str] | ➖ | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce |
raw |
Optional[bool] | ➖ | Include raw response. Mostly used for debugging purposes | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.HrisEmployeesDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
models.BadRequestResponse | 400 | application/json |
models.UnauthorizedResponse | 401 | application/json |
models.PaymentRequiredResponse | 402 | application/json |
models.NotFoundResponse | 404 | application/json |
models.UnprocessableResponse | 422 | application/json |
models.APIError | 4XX, 5XX | */* |