Endpoints
Employees
An eligible employee represents an individual who is associated with your company, can sign up for a Wellhub account, and can subscribe to a plan as defined by your company's contract.
Create Many
This endpoint creates multiple new eligible employees simultaneously. Initially, the limit is set to 10 per request in this endpoint.
The response will show a list of the Eligibility Identifiers for each of the created eligible employees.
Our bulk endpoint works as a single unit to ensure data consistency and integrity. This means that if any operation in a batch fails, the entire batch will fail. In case of a failure, you'll receive detailed error information specifying which operation caused it. So, make sure all operations in your batch are correct and valid before submitting them.
POST {{environment-url}}/eligibility/v1/employees/bulk-create
Request Example1curl --location --request POST '{{environment-url}}/eligibility/v1/employees/bulk-create' \2--header 'Content-Type: application/json' \3--header 'Authorization: Bearer {{Wellhub API Key}}' \4--data-raw'[5 {6 "email": "string",7 "national_id": "string",8 "full_name": "string",9 "employee_id": "string",10 "additional_fields": {11 "department": "string",12 "cost_center": "string",13 "office_zip_code": "string",14 "payroll_id": "string"15 },16 "attributes": {17 "eligible_to_payroll": true or false18 }19 }20]'
Request Parameters
Field | Description | Type | Required |
---|---|---|---|
full_name | It's the human-readable name of the employee to be created. 255 characters max. | String | False |
email | It's the human-readable email of the employee to be created. This is the unique identifier with which the employee will be able to sign up in Wellhub. 255 characters max. | String | True if is in the identifiers list of the company |
employee_id | It's the employee ID of the employee to be created. This is the unique identifier with which the employee will be able to sign up in Wellhub. | String | True if is in the identifiers list of the company |
national_id | It's the national ID of the employee to be created. This is the unique identifier with which the employee will be able to sign up in Wellhub. | String | True if is in the identifiers list of the company |
additional_fields.department | The department of the employee to be created. | String | False |
additional_fields.cost_center | The cost center of the employee to be created. | String | False |
additional_fields.office_zip_code | The zip code of the office where the employee to be created works at. | String | False |
additional_fields.payroll_id | The payroll identifier of the employee to be created. | String | False |
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer {{Wellhub API Key}} |
Response
Example Response1[2 {3 "email": "bulk1@certo.com"4 },5 {6 "email": "bulk2@certo.com"7 }8]
HTTP status code: 201 Created
Response Fields
Field | Description | Type |
---|---|---|
[0].email | Email value sent in the request | String |
[0].employee_id | Employee ID value sent in the request | String |
[0].national_id | National ID value sent in the request | String |
Update Many
This endpoint updates data for multiple eligible employees simultaneously. Initially, the limit is set to 10 per request in this endpoint. The identification of employees is based on the client company's main identifier. For example, if the main identifier for a client is email, the "email" field is required in the request, while "employee_id" and "national_id" are optional.
Our bulk endpoint works as a single unit to ensure data consistency and integrity. This means that if any operation in a batch fails, the entire batch will fail. In case of a failure, you'll receive detailed error information specifying which operation caused it. So, make sure all operations in your batch are correct and valid before submitting them.
Please note: Only data that is sent in the request will be updated. Data that is not sent will remain unchanged.
POST {{environment-url}}/eligibility/v1/employees/bulk-update
Request Example1curl --location --request POST \2'{{environment-url}}/eligibility/v1/employees/bulk-update' \3--header 'Content-Type: application/json' \4--header 'Authorization: Bearer {{Wellhub API Key}}' \5--data-raw '[6 {7 "email": "string",8 "national_id": "string",9 "full_name": "string",10 "employee_id": "string",11 "additional_fields": {12 "department": "string",13 "cost_center": "string",14 "office_zip_code": "string",15 "payroll_id": "string"16 },17 "attributes": {18 "eligible_to_payroll": true or false19 }20 }21]'
Request Params
Field | Description | Type | Required |
---|---|---|---|
full_name | It's the human-readable name of the employee to be created. 255 characters max. | String | False |
email | It's the human-readable email of the employee to be created. This is the unique identifier with which the employee will be able to sign up in Wellhub. 255 characters max. | String | True if is in the identifiers list of the company |
employee_id | It's the employee ID of the employee to be created. This is the unique identifier with which the employee will be able to sign up in Wellhub. | String | True if is in the identifiers list of the company |
national_id | It's the national ID of the employee to be created. This is the unique identifier with which the employee will be able to sign up in Wellhub. | String | True if is in the identifiers list of the company |
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer {{Wellhub API Key}} |
Response
Empty Response
HTTP status code: 204 No Content
Delete Many
This endpoint deletes multiple eligible employees simultaneously, removing their eligibility for the client’s Wellhub benefit. There is a limit of 10 per request in this endpoint. Each employee to be deleted must be identified by its main Eligibility Identifier. If a valid main identifier is provided, but no employees are identified by it, the data will be ignored.
POST {{environment-url}}/eligibility/v1/employees/bulk-delete
Request Example1curl --location --request POST '{{environment-url}}/eligibility/v1/employees/bulk-delete' \2--header 'Content-Type: application/json' \3--header 'Authorization: Bearer {{Wellhub API Key}}' \4--data-raw '[5 {6 "email": "employee01@example.com"7 },8 {9 "email": "employee02@example.com"10 }11]'
Request Parameters
The request payload is an array that may contain a list of JSON objects with the Eligibility Identifier (email, national ID or employee ID).
Field | Description | Type |
---|---|---|
email | The possible identifier of the employee at Wellhub. Used to identify which employees should be deleted. | String |
employee_id | The possible identifier of the employee at Wellhub. Used to identify which employees should be deleted. | String |
national_id | The possible identifier of the employee at Wellhub. Used to identify which employees should be deleted. | String |
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer {{Wellhub API Key}} |
Response
Empty Response
HTTP status code: 204 No Content
Get One
This endpoint gets one eligible employee by its main Eligibility Identifier. As the identifier may have special characters, its content must be encoded. This endpoint does not allow a search for a deleted eligible employee, and will return a not found error when a request like this happens as in the following example:
Attention: the Get One endpoint, different from the others, has a different path version (v2)
GET {{environment-url}}/eligibility/v2/employees/{eligibilityIdentifier}
Request Example1curl --location --request GET {{environment-url}}/eligibility/v2/employees/john.doe@gympass.com \2--header 'Content-Type: application/json' \3--header 'Authorization: Bearer {{Wellhub API Key}}'
Path Variable
The request's URL must contain the employee's main identifier value.
Field | Description | Type |
---|---|---|
eligibility_identifier | The employee's main eligibility identifier, as it was defined by the contract with Wellhub. Can be their email, national ID or employee ID. | String |
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer {{Wellhub API Key}} |
Response
Example Response1{2 "full_name": "Carol Fisher",3 "email": "carol.fisher@acme.com",4 "national_id": "03963105089",5 "employee_id": "abc123",6 "updated_at": "2023-06-15T10:03:18.427465-03:00",7 "deleted_at": null8}
HTTP status code: 200 OK
Response Fields
Field | Description | Type |
---|---|---|
full_name | Human-readable name of the employee. | String |
email | Human-readable email of the employee. | String |
national_id | Human-readable national id of the employee | String |
employee_id | Human-readable id of the employee inside its company | String |
updated_at | Timestamp with last date this employee was updated | String |
deleted_at | If set, timestamp when employee was deleted | String |
Get Many
This endpoint lists employees on pages of 50 records per page. To list all employees (when there are more than 50), you'll need to perform subsequent calls and provide the desired page number. This endpoint is also designed to allow you to list all employees, even the logically deleted ones (via DELETE calls). By default, it returns all employees including deleted employees.
GET {{environment-url}}/eligibility/v1/employees
Request Example1curl --location --request GET '{{environment-url}}/eligibility/v1/employees?page=1&deleted=false&searchTerm=@acme.com' \2--header 'Content-Type: application/json' \3--header 'Authorization: Bearer {{Wellhub API Key}}'
Request Params
Field | Description | Type | Required |
---|---|---|---|
page | Indicates the desired page of results. Default: 1. | Int | False |
deleted | When omitted, the API lists every possible employee. When supplied, the API lists employees accordingly. An employee can be deleted by calling the Delete Many endpoint. | Boolean | False |
searchTerm | The search term to filter employee data. It can filter by name, email, national ID and employee ID. | String | False |
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer {{Wellhub API Key}} |
Response
Example Response1{2 "page_info": {3 "current_page": 2,4 "total_pages": 2,5 "total_elements": 52,6 "offset_start": 51,7 "offset_end": 52,8 "page_size": 509 },10 "items": [11 {12 "full_name": "Carol Fisher",13 "email": "carol.fisher@acme.com",14 "national_id": "03963105089",15 "employee_id": "abc123",16 "updated_at": "2023-06-15T10:03:18.427465-03:00",17 "deleted_at": null18 },19 {20 "full_name": "John Doe",21 "email": "john.doe@acme.com",22 "national_id": "20366667017",23 "employee_id": "abc321",24 "updated_at": "2023-06-15T10:03:18.427465-03:00",25 "deleted_at": null26 }27 ]28}
HTTP status code: 200 OK
Response Fields
Field | Description | Type |
---|---|---|
page_info | Node containing an object with metadata related to this page of data. | Object |
page_info.current_page | Describes the current page number, being the first page equals to 1. | Int |
page_info.total_page | Describes the total amount of pages available. In case you request a page number greater than this info, you'll get an empty list. The minimum is 1. | Int |
page_info.total_elements | Describes the total number of employees in Wellhub's database. | Int |
page_info.offset_start | Describes the index of the elements contained in the current page, considered the first element index equal to 1. Assuming page 3, the offset_start would be 151. | Int |
page_info.offset_end | Describes the index of the elements contained in the current page, considered the first element index equal to 1. Assuming page 3, the offset_end could be 200. | Int |
page_info.page_size | The page size is fixed to 50. | Int |
items | Node containing a list of the employees for the current page. Every object contained in this structure follows the same specifications as defined in GET - Get One. | List |