HR Feed API
The HR Feed API enables automated synchronization of user data from your HR system to the travel booking platform. This allows you to keep traveler profiles up-to-date without manual data entry.
Overview
Use this API to:
- Create new traveler profiles automatically when employees join
- Update traveler information when HR data changes
- Deactivate profiles when employees leave
- Sync organizational unit assignments
Configuration
Base URL
All API requests should be made to:
https://{agency-domain}/api/v2/hr-feed
Note: Replace {agency-domain} with your travel agency's domain.
Authentication
All requests require the X-HR-Feed-Token header containing a JWT token. This token identifies your company (id) and validates your access (key).
Example Header:
X-HR-Feed-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Contact your travel agency administrator to obtain your API credentials.
Documentation
Full interactive API documentation is available here: Swagger Documentation
Endpoints
List Users
Retrieve a paginated list of all users.
GET /hr-feed/users
Query Parameters
| Parameter | Type | Default | Description |
page |
integer | 0 |
Page number (0-indexed) |
limit |
integer | 50 |
Number of users per page |
Response
{ "items": [...], "totalItems": 150, "page": 0, "limit": 50, "hasMore": true, "nextPage": 1 }
Create User
Create a new traveler profile.
POST /hr-feed/users
Request Body
| Field | Type | Required | Description |
firstName |
string | Yes | First name |
lastName |
string | Yes | Last name |
email |
string | Yes | Email address |
middleName |
string | No | Middle name |
mobile |
string | No | Mobile phone number |
gender |
string | No | Title/gender (Mr, Mrs, Ms, etc) |
countryCode |
string | No | Country code (ISO 3166-1 alpha-2, e.g., SE) |
cultureCode |
string | No | Locale code (e.g., sv-SE) |
isActive |
boolean | No | Whether the user is active |
externalId |
string | No | Your system's user ID for cross-referencing |
unit |
object | No | Organizational unit assignment (see below) |
customFields |
array | No | Custom field key-value pairs |
Unit Object Structure
| Field | Type | Description |
id |
string | Unit ID in the booking system |
externalId |
string | Your system's unit ID |
Example Request
{ "firstName": "Anna", "lastName": "Andersson", "email": "anna.andersson@example.com", "mobile": "+46701234567", "gender": "Ms", "countryCode": "SE", "cultureCode": "sv-SE", "isActive": true, "externalId": "EMP-12345", "unit": { "externalId": "DEPT-SALES" }, "customFields": [{ "costCenter": "CC-100" }, { "employeeNumber": "12345" }] }
Response
201 Created: Returns the created user object with assignedid.
Retrieve User
Get User by ID
Retrieve a specific user by their system ID.
GET /hr-feed/users/{id}
Get User by External ID
Retrieve a user by your external system ID.
GET /hr-feed/users/external/{externalId}
Update User
Update User by ID
Update an existing user's information using the system ID.
PATCH /hr-feed/users/{id}
Request Body Include only the fields you want to update. All fields from the Create User request are supported.
Example Request
{ "mobile": "+46709876543", "isActive": false }
Response
204 No Content
Update User by External ID
Update a user using your external system ID.
PATCH /hr-feed/users/external/{externalId}
Delete User
Delete User by ID
Remove a user from the system using the system ID.
DELETE /hr-feed/users/{id}
Response
204 No Content
Delete User by External ID
Remove a user using your external system ID.
DELETE /hr-feed/users/external/{externalId}
Response
204 No Content
Data Models
User Object
The API returns user objects with the following structure:
| Field | Type | Description |
id |
string | System-assigned unique ID |
externalId |
string | Your external system ID (nullable) |
firstName |
string | First name |
lastName |
string | Last name |
middleName |
string | Middle name |
email |
string | Email address |
mobile |
string | Mobile phone number |
gender |
string | Title/gender |
countryCode |
string | Country code (ISO 3166-1 alpha-2) |
cultureCode |
string | Culture/locale code |
isActive |
boolean | Whether the user is active |
unit |
object | Organizational unit (nullable) |
customFields |
array | Custom field key-value pairs |
Error Responses
| Status | Description |
| 400 | Bad request (missing required fields, invalid data) |
| 403 | Authentication failed or API not enabled |
| 404 | User or resource not found |
| 500 | Internal server error |
Error Response Format
{ "error": "Description of the error" }
Best Practices
- Use External IDs: Always set
externalIdwhen creating users. This allows you to reference users by your HR system's ID rather than tracking the booking system's internal IDs. - Incremental Sync: For large organizations, implement incremental syncs that only update changed records rather than full syncs.
- Handle Pagination: When listing users, always check
hasMoreand iterate through all pages to get complete data. - Deactivate vs. Delete: Consider setting
isActive: falseinstead of deleting users to preserve booking history. - Unit Assignment: If your organization uses units/departments, ensure units exist in the booking system before assigning users to them.
Support
For API access, credentials, or technical support, contact your travel agency administrator.