Employees API

The Employees API is used to manage the creation and updating of employee profiles in UKG HR Service Delivery.

Creation or update of an employee

This API call is used to create or update an employee on UKG HR Service Delivery. An employee is identified by their technical_id, unique identifier that is reported when they are created by the HRIS source:

  • If the call parameters includes a new technical_id, a new employee is created

  • If the call parameters includes a technical_id that already exists in our system, the corresponding employee is updated. An “intelligent” deduplication check is performed on the first name, last name, date of birth, e-mail address, and postal address fields in order to trigger an error if there is a duplication risk. An HTTP 409 CONFLICT error is returned in this case.

Warning

This endpoint entered deprecation in July 2021. As per our deprecation policy, its sunset period started in January 2022 and retirement will occur in July 2022. Consider using the corresponding APIv2 endpoint instead.

URL

POST /api/v1/employees/

Settings

The POST is in JSON (Content-Type: application/json): It contains the employee’s attributes:

  • lastname: VARCHAR(70) / mandatory

    Last name of the employee

  • firstname: VARCHAR(30) / mandatory

    First name

  • maiden_name: VARCHAR(70) / optional

    Maiden name

  • email: VARCHAR(80) / optional or mandatory

    Professional e-mail of the employee. Used to send personal vault activation codes to employees. If empty, the invitation is sent via conventional mail containing the vault activation code (project).

  • technical_id: VARCHAR(50) / mandatory

    Technical identifier corresponding to the unique identifier of the employee in the HRIS of the Client. It is recommended to specify a unique employee identifier if such an identifier exists in the HRIS. This identifier (generally) is not the employee number. But if it is guaranted that the employee number is unique, even in the event of a transfer, or in the event of a departure and reassignment, the employee number may then be used as this identifier.

  • registration_references: List of employee numbers and organizations associated with the employee. These organizations and employee numbers are added to the employee if they are not already present. No employee number is deleted in this call: in particular, in case of an employee update, even if this parameter ‘registration_references’ is an empty list, the existing employee numbers aren’t deleted:

    • organization_code: VARCHAR(64) / mandatory

      Code of the organization with which the employee number is associated

    • registration_number: VARCHAR(255) / mandatory

      Employee number within the organization. The pair registration number and organization code should be unique

    • active: [true, false] / optional, default: true

      Status of the employee number

    • departure_date: YYYY-MM-DD / optional, default: today

      Employee’s departure date from the organization in ISO format``YYYY-MM-DD``. If not provided, the current date is used

  • dob: YYYY-MM-DD / optional

    Employee birth date in ISO format``YYYY-MM-DD``. Deduplication checks are performed based on this field, it is therefore advisable to fill it in

  • address1: VARCHAR(255) / optional or mandatory

    Employee address, in the “no. and street” format. This field is mandatory if the e-mail field is not filled in

  • address2: VARCHAR(255) / optional

    Additional address (Floor, Stairwell, Apartment…)

  • address3: VARCHAR(255) / optional

    Additional address fields (Residence, Housing Development, Building, Apartment Building, Subdivision, etc.)

  • zip_code: VARCHAR(30) / optional or mandatory

    Postal code. This field is mandatory if the e-mail field is not filled in

  • city: VARCHAR(100) / optional or mandatory

    City in which the employee resides. This field is mandatory if the e-mail field is not filled in

  • country: VARCHAR(2) / optional or mandatory

    ISO country code (FR, EN, ES…). This field is mandatory if the e-mail field is not filled in. For a list of valid country codes see http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3

  • phone_number: VARCHAR(50) / optional

    Employee phone number. Format using International prefix format; eg: ``00116434774000``.

  • mobile_phone_number: VARCHAR(50) / optional

    Mobile phone number. Format using International prefix format; eg: ``0116434774000``. This number is the one used by default when notifying the employee to sign a document or to confirm his identity. If not filled then the phone number is used

  • electronic_payslips_opted_out: true/false / optional

    For European based clients only, did the Employee ask to opt out from receiving their payslips digitally (true)? Or on the contrary, did they agree to receive them digitally (false)? If the employee did not communicate any choice, false is returned. Changing this value also sets the value of electronic_payslips_opted_out_date to today’s date.

  • disable_elec_distribution: true/false / optional

    Prevent electronic documents to be sent to the employee’s vault

  • disable_paper_distribution: true/false / optional

    Prevent paper documents to be sent to the employee

  • starting_date: YYYY-MM-DD / optional

    Starting date of the employee in your company in the ISO format``YYYY-MM-DD``

  • gone: true/false / optional

    Flag to mark the employee as terminated. By default: false. If true all registration numbers are set to inactive

  • disable_vault: true/false / optional

    Disable/enable employee’s vault. If it is not provided, or if the employee’s vault is already activated, it is ignored and set to false by default

  • filters: optional

    Dictionary of employee custom fields.

    Example::

    {
        'nh': '4',
        'title': 'director'
    }
    

Sample call

POST /api/v1/employees/

{
  'lastname': 'MARTIN',
  'firstname': 'Paul',
  'email': 'mpaul@example.com',
  'technical_id': 'internal056',
  'registration_references': [
    {
      'organization_code': 'FSUD1',
      'registration_number': 'BYUIE5685678',
      'active': 'true'
    },
    {
      'organization_code': 'FSUD2',
      'registration_number': 'BYUIE5685677',
      'active': 'false',
      'departure_date': '2014-12-31'
    }
  ]
  'dob': '1985-04-12',
  'address1': '34 rue du général',
  'zip_code': '75016',
  'city': 'Paris',
  'country': 'FR',
  'mobile_phone_number': '0033645764425',
  'electronic_payslips_opted_out': true,
  'filters': {
      'nh': '4',
      'title': 'director'
  }
}

Response

Success

The response is encoded in the JSON format with the following parameters:

  • technical_id:

    Internal employee identifier in the HRIS, provided during the creation of the employee on UKG HR Service Delivery

      HTTP 201 Created
    
    {
      'technical_id': 'internal056'
    }
    

Errors

HTTP 403 Forbidden: Authentication failed

HTTP 409 Conflict: A deduplication error has occurred

HTTP 400 Bad Request: Invalid parameters.

Each error is represented by a JSON object {'code': 1001, 'message': 'Invalid ...'}. The error message is given as an indication (debug).

  • code = 1400: The following fields are missing xxx, xxx.

  • code = 1409: Deduplication error, employee has the same last name, first name and birth date.

Example:

HTTP 400 Bad Request
{
  'errors': [
    {
      'code': 1400,
      'msg': 'Family name is required'
    },
    {
      'code': 1409,
      'msg': 'This firstname, lastname and registration ref are arlready used for this domain'
    }
  ]
}

Call samples

In Curl:

curl -v -X POST "https://api.novapost.net/api/v1/employees/" \
    -H "Content-type: application/json" \
    -H "Accept: application/json" \
    -H "X-API-KEY: toto" \
    -d "{\"lastname\": \"TAPTAP9\", \"firstname\": \"gregory9\", \"email\": \"gregory9@example.com\", \"technical_id\": \"testgregory9\", \"registration_references\": [{\"organization_code\": \"AP\", \"registration_number\": \"testgregory9\", \"active\": \"true\"}],\"dob\": \"1985-04-12\",\"address1\": \"34 rue du général\", \"zip_code\": \"75016\", \"city\": \"Paris\", \"country\": \"FR\", \"mobile_phone_number\": \"0033645764425\"}"

Obtaining information from an employee

This API call retrieves information regarding an employee registered on UKG HR Service Delivery

Warning

This endpoint entered deprecation in July 2021. As per our deprecation policy, its sunset period started in January 2022 and retirement will occur in July 2022. Consider using the corresponding APIv2 endpoint instead.

URL

GET /api/v1/employees/{technical_id}/

Settings

GET parameters:

  • technical_id: VARCHAR(50) / optional or mandatory

    Internal employee identifier within the HRIS and reported during the employee creation on UKG HR Service Delivery

  • electronic_payslips_opt_out_origin: VARCHAR(50) / optional

    If the employee is reported as opted out from the electronic payslip, describe if the decision was made by the employee or by the enterprise (default). Otherwise null

  • electronic_payslips_opt_out_date: YYYY-MM-DD / optional

    Date when the choice of the employee to opt out was recorded

Response

Success

When successful, this method retrieves all attributes of the employee. For example:

HTTP 200 OK
{
  'lastname': 'MARTIN',
  'firstname': 'Paul',
  'maiden_name': '',
  'email': 'mpaul@example.com',
  'technical_id': 'internal056',
  'registration_references': [
    {
      'organization_code': 'FSUD1',
      'registration_number': 'BYUIE5685678',
      'active': 'true'
    },
    {
      'organization_code': 'FSUD2',
      'registration_number': 'BYUIE5685677',
      'active': 'false',
      'departure_date': '2014-12-31'
    }
  ]
  'dob': '1985-04-12',
  'address1': '34 rue du général',
  'address2': '',
  'address3': '',
  'zip_code': '75016',
  'city': 'Paris',
  'country': 'FR',
  'phone_number': '',
  'mobile_phone_number': '0033645764425',
  'disable_elec_distribution': false,
  'disable_paper_distribution': false,
  'electronic_payslips_opted_out': false,
  'electronic_payslips_opt_out_origin': 'enterprise',
  'electronic_payslips_opt_out_date': '2017-12-08'
  'starting_date': '2011-04-17',
  'gone': false,
  'disable_vault': false,
  'filters': {
      'nh': '4',
      'title': 'directeur'
  }
}

Success payload description

  • electronic_payslips_opted_out: true/false

    For European based clients only, did the Employee ask to opt out from receiving their payslips digitally (true)? Or on the contrary, did they agree to receive them digitally (false)? If the employee did not communicate any choice, false is returned

  • electronic_payslips_opt_out_origin: VARCHAR(50)

    If the employee is reported as opted out from the electronic payslip, describe if the decision was made by the employee or by the enterprise (default). Otherwise null

  • electronic_payslips_opt_out_date: YYYY-MM-DD

    Date when the choice of the employee to opt out was recorded

Errors

HTTP 404 Does Not Exist: No employee for this technical_id.

HTTP 403 Forbidden: Authentication failed.

HTTP 400 Bad Request: Invalid parameters.

Assigning an employee number

Warning

This endpoint entered deprecation in July 2021. As per our deprecation policy, its sunset period started in January 2022 and retirement will occur in July 2022. Consider using the corresponding APIv2 endpoint instead.

URL

POST /api/v1/employees/{technical_id}/registrations/

Settings

GET parameters:

  • technical_id: VARCHAR(50) / optional or mandatory

    Internal employee identifier within the HRIS and reported during the employee creation on UKG HR Service Delivery

The POST is encoded in JSON (Content-Type: application/json) and contains the following parameters:

  • organization_code: VARCHAR(64) / mandatory

    Code of the organization with which the employee number is associated

  • registration_number: VARCHAR(255) / mandatory

    Employee number within the organization ‘organization_code’

  • active: [true, false] / optional, default: true

    Status of this employee number.

  • departure_date: YYYY-MM-DD / optional, default: today

    Date of employee’s departure in ISO format``YYYY-MM-DD``, if the employee number is not active. If not provided, the current date is registered.

Example

POST /api/v1/employees/GYU89665F58/registrations/

{
  'registration_number': '4564564464FFS',
  'organization_code': 'FSUD1',
  'active': 'true'
}

Response

Success

If the employee number did not exist before the call, the method returns:

HTTP 201 Created

And if the employee number / organization pair already exists for this employee:

HTTP 200 OK

Errors

HTTP 404 Does Not Exist: No employee for this technical_id.

HTTP 403 Forbidden: Authentication failed.

HTTP 400 Bad Request: Invalid parameters.

List of errors in JSON format:

Each error is represented by a JSON object {'code': 1001, 'message': 'Invalid ...'}. The error message is given as an indication (debug).

  • code = 1400: the following fields are missing: xxx, xxx.

  • code = 1404: The organization code does not exist.

Example:

HTTP 400 Bad Request
{
  'errors': [
    {
        'code': 1400,
        'msg': 'Org code is required'
    },
   ...
  ]
}

Deleting an employee number

Warning

This endpoint entered deprecation in July 2021. As per our deprecation policy, its sunset period started in January 2022 and retirement will occur in July 2022. Consider using the corresponding APIv2 endpoint instead.

URL

DELETE /api/v1/employees/{technical_id}/registrations/{organization_code}/{registration_number}/

Settings

GET parameters:

  • technical_id: VARCHAR(50) / optional or mandatory

    Internal employee identifier within the HRIS and reported during the employee creation on UKG HR Service Delivery

  • organization_code: VARCHAR(64) / mandatory

    Code of the organization with which the employee number is associated

  • registration_number: VARCHAR(255) / mandatory

    Employee number within the organization ‘organization_code’

Response

Success

HTTP 200 OK

Errors

HTTP 404 Does Not Exist: No employee for this technical_id.

HTTP 404 Not Found: The employee number / organization pair was not found for this employee

HTTP 403 Forbidden: Authentication failed.

HTTP 400 Bad Request: Invalid parameters.

Reporting employee departures

Used to report an employee’s departure from the company. All active employee numbers are converted to inactive status (the current date is stored as departure date).

URL

PUT /api/v1/employees/{technical_id}/gone/

Settings

GET parameters:

  • technical_id: VARCHAR(50) / optional or mandatory

    Internal employee identifier within the HRIS and reported during the employee creation on UKG HR Service Delivery

Response

Success

HTTP 200 OK

Errors

HTTP 403 Forbidden: Authentication failed.

HTTP 400 Bad Request: Invalid parameters.

HTTP 404 Does Not Exist: No employee for this technical_id.

Reporting employee returns

Used to report an employee’s return to the company. All employee numbers are then converted to active status.

URL

PUT /api/v1/employees/{technical_id}/back/

Settings

GET parameters:

  • technical_id: VARCHAR(50) / optional or mandatory

    Internal employee identifier within the HRIS and reported during the employee creation on UKG HR Service Delivery

Response

Success

HTTP 200 OK

Errors

HTTP 403 Forbidden: Authentication failed.

HTTP 400 Bad Request: Invalid parameters.

HTTP 404 Does Not Exist: No employee for this technical_id.