Skip to main content

Expats

Overview

Expats endpoints provide CRUD operations, invitations, and status updates for expat resources.

Endpoint Summary

MethodRoutePurpose
GET/v1/data/expatsList expats
POST/v1/data/expatsCreate expat
POST/v1/data/expats/inviteSend expat invite
PATCH/v1/data/expats/statusUpdate expat status
GET/v1/data/expats/{expatId}Get expat by ID
PUT/v1/data/expats/{expatId}Update expat
DELETE/v1/data/expats/{expatId}Delete expat

GET /v1/data/expats

Return the list of expats available in the authenticated tenant context.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Query Parameters

ParameterTypeRequiredDescription
per_pagenumberNoNumber of items per page.
pagenumberNoCurrent page number.
includestringNoSupported value: details.

Example Request

curl -X GET "{{BASE_URL}}/v1/data/expats" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": {
"currentPage": 1,
"perPage": 20,
"lastPage": 3,
"total": 51,
"items": [
{
"user": {
"id": 501,
"uuid": "a2b43f5c-3cb9-4e87-bfe3-9d34b2665f8a",
"first_name": "Jane",
"last_name": "Doe",
"name": "Jane Doe",
"email": "[email protected]",
"entity_id": 101,
"entity_uuid": "2f4ab561-8e64-45f8-a2dc-8044e08a963f",
"entity_type": "expat",
"primary_image_path": null,
"is_primary": true,
"phone_prefix": null,
"phone_country": null,
"phone_number": null,
"phone": null,
"status": "active",
"status_reason": null,
"created_at": "2026-03-11T08:17:14+00:00",
"updated_at": "2026-04-29T08:12:53+00:00",
"timezone": "Europe/Bucharest"
},
"id": 101,
"primary_image_path": null,
"client_id": 77,
"employee_id": null,
"company_name": "Example Client Ltd",
"user_id": 501,
"name": "Jane Doe",
"email": "[email protected]",
"payroll_id": null,
"primary_citizenship_id": null,
"status_id": 1,
"status_name": "Active",
"license": null,
"country_code": "DE",
"primary_citizenship": null,
"contracting_legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"contracting_legal_entity": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"label": "XPath Germany GmbH"
},
"office_id": 12,
"department_id": "HR",
"segment_id": "f6f5e87f-a1fc-4ac2-9d9a-676bc94f0d3b",
"designation": null
}
],
"filters": [],
"resource_columns": []
}
}

POST /v1/data/expats

Create a new expat resource.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Request Body Fields

FieldTypeRequiredDescription
first_namestringYesExpat first name.
last_namestringYesExpat last name.
emailstringYesExpat email (must be unique).
contracting_legal_entity_idstringYesContracting legal entity UUID.
client_idnumberConditionalRequired when client context is not inferred from authentication.
phone_prefixstringNoPhone prefix.
phone_numberstringNoPhone number.
country_codestringNoISO country code (2 chars).
details.department_namestringNoDepartment name.
details.company_positionstringNoCompany position.
primary_citizenshipstringNoPrimary citizenship code/value.

Example Request

curl -X POST "{{BASE_URL}}/v1/data/expats" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"first_name": "Jane",
"last_name": "Doe",
"email": "[email protected]",
"contracting_legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"country_code": "DE",
"details": {
"department_name": "HR",
"company_position": "Manager"
}
}'

Success Response (200)

{
"success": true,
"result": {
"user": {
"id": 501,
"uuid": "a2b43f5c-3cb9-4e87-bfe3-9d34b2665f8a",
"first_name": "Jane",
"last_name": "Doe",
"name": "Jane Doe",
"email": "[email protected]",
"entity_id": 101,
"entity_uuid": "2f4ab561-8e64-45f8-a2dc-8044e08a963f",
"entity_type": "expat",
"primary_image_path": null,
"is_primary": true,
"phone_prefix": null,
"phone_country": null,
"phone_number": null,
"phone": null,
"status": "active",
"status_reason": null,
"created_at": "2026-03-11T08:17:14+00:00",
"updated_at": "2026-04-29T08:12:53+00:00",
"timezone": "Europe/Bucharest"
},
"id": 101,
"primary_image_path": null,
"client_id": 77,
"employee_id": null,
"company_name": "Example Client Ltd",
"user_id": 501,
"name": "Jane Doe",
"email": "[email protected]",
"payroll_id": null,
"primary_citizenship_id": null,
"status_id": 1,
"status_name": "Active",
"license": null,
"country_code": "DE",
"primary_citizenship": null,
"contracting_legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"contracting_legal_entity": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"label": "XPath Germany GmbH"
},
"office_id": 12,
"department_id": "HR",
"segment_id": "f6f5e87f-a1fc-4ac2-9d9a-676bc94f0d3b",
"designation": null,
"address": null,
"region": null,
"city": null,
"zip_code": null,
"bank_name": null,
"swift_code": null,
"bank_account_number": null,
"declined_reason": null,
"details": {
"marital_status_id": null,
"marital_status": null,
"education_form_id": null,
"education_form": null,
"office_id": 12,
"manager_id": 223,
"manager_email": "[email protected]",
"manager_name": "John Manager",
"department_name": "HR",
"company_position": "Manager",
"birth_date": null,
"birth_country": null,
"birth_city": null,
"primary_language": null,
"joined_at": null
},
"company_position": "Manager"
}
}

Error Example

422 Unprocessable Entity

{
"error": {
"code": "validation_error",
"message": "The request payload is invalid."
}
}

POST /v1/data/expats/invite

Send invitation emails for one or more expats.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Request Body Fields

FieldTypeRequiredDescription
expat_idsarray<number>YesList of expat IDs to invite.

Example Request

curl -X POST "{{BASE_URL}}/v1/data/expats/invite" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"expat_ids": [101, 102]
}'

Success Response (200)

{
"success": true,
"result": []
}

PATCH /v1/data/expats/status

Update status for one or more expats.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Request Body Fields

FieldTypeRequiredDescription
idsarray<number>YesExpat IDs to update.
status_idnumberYesTarget status identifier.
declined_reasonstringConditionalRequired for declined/refused status values.

Example Request

curl -X PATCH "{{BASE_URL}}/v1/data/expats/status" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"ids": [101, 102],
"status_id": 2
}'

Success Response (200)

{
"success": true,
"result": {
"status_id": 2,
"status_name": "Active",
"declined_reason": null
},
"message": "Updated successfully!"
}

GET /v1/data/expats/{expatId}

Return expat details for the provided identifier.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
expatIdnumberYesExpat identifier.

Example Request

curl -X GET "{{BASE_URL}}/v1/data/expats/{{EXPAT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": {
"user": {
"id": 501,
"uuid": "a2b43f5c-3cb9-4e87-bfe3-9d34b2665f8a",
"first_name": "Jane",
"last_name": "Doe",
"name": "Jane Doe",
"email": "[email protected]",
"entity_id": 101,
"entity_uuid": "2f4ab561-8e64-45f8-a2dc-8044e08a963f",
"entity_type": "expat",
"primary_image_path": null,
"is_primary": true,
"phone_prefix": null,
"phone_country": null,
"phone_number": null,
"phone": null,
"status": "active",
"status_reason": null,
"created_at": "2026-03-11T08:17:14+00:00",
"updated_at": "2026-04-29T08:12:53+00:00",
"timezone": "Europe/Bucharest"
},
"id": 101,
"primary_image_path": null,
"client_id": 77,
"employee_id": null,
"company_name": "Example Client Ltd",
"user_id": 501,
"name": "Jane Doe",
"email": "[email protected]",
"payroll_id": null,
"primary_citizenship_id": null,
"status_id": 1,
"status_name": "Active",
"license": null,
"country_code": "DE",
"primary_citizenship": null,
"contracting_legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"contracting_legal_entity": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"label": "XPath Germany GmbH"
},
"office_id": 12,
"department_id": "HR",
"segment_id": "f6f5e87f-a1fc-4ac2-9d9a-676bc94f0d3b",
"designation": null,
"allowed_actions": {
"delete": true,
"update": true
},
"address": null,
"region": null,
"city": null,
"zip_code": null,
"bank_name": null,
"swift_code": null,
"bank_account_number": null,
"declined_reason": null,
"details": {
"marital_status_id": null,
"marital_status": null,
"education_form_id": null,
"education_form": null,
"office_id": 12,
"manager_id": 223,
"manager_email": "[email protected]",
"manager_name": "John Manager",
"department_name": "HR",
"company_position": "Manager",
"birth_date": null,
"birth_country": null,
"birth_city": null,
"primary_language": null,
"joined_at": null
},
"company_position": "Manager"
}
}

PUT /v1/data/expats/{expatId}

Update an existing expat.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
expatIdnumberYesExpat identifier.

Request Body Fields

FieldTypeRequiredDescription
user_idnumberYesLinked user identifier.
status_idnumberYesExpat status identifier.
contracting_legal_entity_idstringYesContracting legal entity UUID.
detailsobjectYesExpat details object.
client_idnumberConditionalRequired when client context is not inferred from authentication.
first_namestringNoExpat first name.
last_namestringNoExpat last name.
emailstringNoExpat email (must be unique).
phone_prefixstringNoPhone prefix.
phone_numberstringNoPhone number.
details.manager_idnumberNoManager user identifier.

Example Request

curl -X PUT "{{BASE_URL}}/v1/data/expats/{{EXPAT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"user_id": 501,
"status_id": 1,
"contracting_legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"first_name": "Jane",
"last_name": "Smith",
"details": {
"manager_id": 223
}
}'

Success Response (200)

{
"success": true,
"result": {
"user": {
"id": 501,
"uuid": "a2b43f5c-3cb9-4e87-bfe3-9d34b2665f8a",
"first_name": "Jane",
"last_name": "Smith",
"name": "Jane Smith",
"email": "[email protected]",
"entity_id": 101,
"entity_uuid": "2f4ab561-8e64-45f8-a2dc-8044e08a963f",
"entity_type": "expat",
"primary_image_path": null,
"is_primary": true,
"phone_prefix": null,
"phone_country": null,
"phone_number": null,
"phone": null,
"status": "active",
"status_reason": null,
"created_at": "2026-03-11T08:17:14+00:00",
"updated_at": "2026-04-29T08:12:53+00:00",
"timezone": "Europe/Bucharest"
},
"id": 101,
"primary_image_path": null,
"client_id": 77,
"employee_id": null,
"company_name": "Example Client Ltd",
"user_id": 501,
"name": "Jane Smith",
"email": "[email protected]",
"payroll_id": null,
"primary_citizenship_id": null,
"status_id": 1,
"status_name": "Active",
"license": null,
"country_code": "DE",
"primary_citizenship": null,
"contracting_legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"contracting_legal_entity": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"label": "XPath Germany GmbH"
},
"office_id": 12,
"department_id": "HR",
"segment_id": "f6f5e87f-a1fc-4ac2-9d9a-676bc94f0d3b",
"designation": null,
"allowed_actions": {
"delete": true,
"update": true
},
"address": null,
"region": null,
"city": null,
"zip_code": null,
"bank_name": null,
"swift_code": null,
"bank_account_number": null,
"declined_reason": null,
"details": {
"marital_status_id": null,
"marital_status": null,
"education_form_id": null,
"education_form": null,
"office_id": 12,
"manager_id": 223,
"manager_email": "[email protected]",
"manager_name": "John Manager",
"department_name": "HR",
"company_position": "Manager",
"birth_date": null,
"birth_country": null,
"birth_city": null,
"primary_language": null,
"joined_at": null
},
"company_position": "Manager"
}
}

DELETE /v1/data/expats/{expatId}

Delete an expat.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
expatIdnumberYesExpat identifier.

Request Body Fields

FieldTypeRequiredDescription
reasonstringYesDeletion reason.

Example Request

curl -X DELETE "{{BASE_URL}}/v1/data/expats/{{EXPAT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"reason": "No longer needed"
}'

Success Response (200)

{
"success": true,
"result": []
}