Request and Response Format


Here is an example of a request to create a new employee, made using the popular cURL tool, and the response:

$ curl https://api.breathehr.com/v1/employees \
-H 'X-API-KEY: prod-1OcTwKW8ln5ARz04IjsrJEQTZgP3Ir1sWfyuOLdqC1Y' \
-d employee[first_name]=foo \
-d employee[last_name]=bar \
-d employee[email]=foo@bar.com \
-d employee[job_title]=Director \
-d employee[join_date]=2014/10/01
{
  "employees": [
    {
      "length_of_service_in_months": 3,
      "age": null,
      "full_or_part_time": null,
      "notice_period": null,
      "working_pattern": {
        "id": 1,
        "name": "Default working week M-F 8hrs",
        "total_hours": "40.0",
        "default": true
      },
      "holiday_allowance": {
        "name": "Full Time Hours M-F 200+64 (25+8)",
        "id": 1
      },
      "line_manager": null,
      "holiday_approver": null,
      "department": null,
      "receives_statutory_holidays": false,
      "status": "Current employee",
      "company_join_date": "2014-10-01",
      "job_start_date": "2015-01-22",
      "job_title": "Director",
      "hr": false,
      "id": 5,
      "account_id": 1,
      "first_name": "foo",
      "last_name": "bar",
      "email": "foo@barzz.com",
      "created_at": "2015-01-22T10:44:35Z",
      "updated_at": "2015-01-22T10:44:35Z"
    }
  ]
}

Please note that the response has been edited for brevity, in order to highlight some important attributes. In the following sub section we will examine the request and response in more detail.