{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":518,"path":"api-reference/rest-apis/hr-core-api.md","title":"HR REST API","bundle":null,"doc_type":null,"release":"australia","body":"\n# HR REST API\n\nThe HR REST API provides endpoints that return information about employees that work or live in the United States.\n\nTo access this API you must have the sn\\_hr\\_core.usa\\_employee\\_only role and the Human Resources Scoped App: Core \\(com\\_sn\\_hr\\_core\\) plugin activated.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## HR REST - GET /get\\_usa\\_employee\\_profile\n\nReturns employee profile information for employees based in the United States.\n\nThe returned information can be either:\n\n-   Employee profile information for a specified employee ID.\n-   Information for employees that have been added, or whose information has been updated, on or after a specified date.\n\n**Note:** Employees must either have their work or home country specified as the United States for this endpoint to include them in the return results.\n\nIn addition, the endpoint sends the following parameters to the integrated CIC Plus application \\(see the Returns section for descriptions\\):\n\n-   EmployeeIdentifier\n-   FirstName\n-   MiddleName\n-   LastName\n-   Email\n-   WorkAddress\n-   WorkCity\n-   WorkState\n-   WorkPostalCode\n-   WorkCountry\n-   HomeAddress\n-   HomeCity\n-   HomeState\n-   HomePostalCode\n-   HomeCountry\n-   BirthDate\n-   HireDate\n\n### URL format\n\nDefault URL: `/api/sn_hr_core/hr_rest_api/get_usa_employee_profile`\n\n### Supported request parameters\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nemployee\\_identifier\n\n</td><td>\n\nUnique identifier of an employee. The calling system generates this value and can be in whatever format is consistent with their system. To obtain this value, first call the endpoint using the **updated\\_after** parameter.**Note:** This parameter is mutually exclusive with the **updated\\_after** parameter. This parameter defines a unique employee, whereas **updated\\_after** returns a group of employees created/updated after a specified date.\n\nData type: String\n\n</td></tr><tr><td>\n\nsysparm\\_limit\n\n</td><td>\n\nMaximum number of records to return. For requests that exceed this number of records, use the **sysparm\\_offset** parameter to paginate record retrieval. Data type: Number\n\nDefault: 1000\n\n</td></tr><tr><td>\n\nsysparm\\_offset\n\n</td><td>\n\nStarting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks. For example, the first time you call this endpoint, **sysparm\\_offset** is set to \"0\". To simply page through all available records, use `sysparm_offset=sysparm_offset+sysparm_limit`, until you reach the end of all records.\n\n</td></tr><tr><td>\n\nupdated\\_after\n\n</td><td>\n\nDate to use to determine the employee data to return. All United States-based employees \\(work or home\\) that were added to your instance, or whose information was updated on or after this date, are included in the return results.**Note:** This parameter is mutually exclusive with the **employee\\_identifier** parameter.\n\nData type: String\n\nFormat: YYYY-MM-DD HH:MM:SS or YYYY-MM-DD \\(time defaults to 00:00:00\\)\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table><table class=\"rest_api_response_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nNext-Page\n\n</td><td>\n\nFlag that indicates whether there is additional data to obtain in a subsequent call. For example, if there are a total of 120 employee records that match the search criteria, and sysparm\\_limit is set to 100, then **Next-Page** is true. If no additional results are available, **Next-Page** is false.Valid values:\n\n-   true: Additional data is available, another call must be made to obtain the next chunk of data.\n-   false: No additional data.\n\n</td></tr></tbody>\n</table>### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|404|Not found. The requested item wasn't found.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBirthDate\n\n</td><td>\n\nEmployee's birth date.Data type: String\n\n</td></tr><tr><td>\n\nCompany\n\n</td><td>\n\nCompany name.Data type: String\n\n</td></tr><tr><td>\n\nEmail\n\n</td><td>\n\nEmployee's email address.Data type: String\n\n</td></tr><tr><td>\n\nEmployeeIdentifier\n\n</td><td>\n\nUnique employee identifier.Data type: String\n\n</td></tr><tr><td>\n\nFirstName\n\n</td><td>\n\nEmployee's first name.Data type: String\n\n</td></tr><tr><td>\n\nHireDate\n\n</td><td>\n\nDate on which the employee was hired.Data type: String\n\n</td></tr><tr><td>\n\nLastName\n\n</td><td>\n\nEmployee's last name.Data type: String\n\n</td></tr><tr><td>\n\nMiddleName\n\n</td><td>\n\nEmployee's middle name.Data type: String\n\n</td></tr><tr><td>\n\nReHire\n\n</td><td>\n\nFor future use.Data type: String\n\n</td></tr><tr><td>\n\nResidenceAddress\n\n</td><td>\n\nEmployee's home street address.Data type: String\n\n</td></tr><tr><td>\n\nResidenceCity\n\n</td><td>\n\nEmployee's home city.Data type: String\n\n</td></tr><tr><td>\n\nResidenceCountry\n\n</td><td>\n\nEmployee's home country.Data type: String\n\n</td></tr><tr><td>\n\nResidencePostalCode\n\n</td><td>\n\nEmployee's home zip code.Data type: String\n\n</td></tr><tr><td>\n\nResidenceState\n\n</td><td>\n\nEmployee's home state.Data type: String\n\n</td></tr><tr><td>\n\nSuffix\n\n</td><td>\n\nEmployee's suffix, such as Mr., Mrs., or Dr.Data type: String\n\n</td></tr><tr><td>\n\nWorkAddress\n\n</td><td>\n\nEmployee's work street address.Data type: String\n\n</td></tr><tr><td>\n\nWorkCity\n\n</td><td>\n\nEmployee's work cityData type: String\n\n</td></tr><tr><td>\n\nWorkCountry\n\n</td><td>\n\nEmployee's work country.Data type: String\n\n</td></tr><tr><td>\n\nWorkPostalCode\n\n</td><td>\n\nEmployee's work zip code.Data type: String\n\n</td></tr><tr><td>\n\nWorkState\n\n</td><td>\n\nEmployee's work state.Data type: String\n\n</td></tr></tbody>\n</table>### Sample cURL request for a specific employee's information\n\n```\ncurl -X GET \"https://instance.servicenow.com/api/sn_hr_core/V1/hr_rest_api/get_usa_employee_profile?employee_identifier=231\"\n-H \"accept: application/json\" \\\n-u \"username\":\"password\"\n```\n\n```\n{\"result\": [\n {\n  \"EmployeeIdentifier\": \"231\",\n  \"FirstName\": \"Harold\",\n  \"MiddleName\": \"William\",\n  \"LastName\": \"Lewis\",\n  \"Suffix\": \"Mr.\",\n  \"Email\": \"Howard.Lewis@example.com\",\n  \"BirthDate\": \"\",\n  \"HireDate\": \"2021-02-18\",\n  \"Company\": \"ServiceNow Inc\",\n  \"ResidenceAddress\": \"\",\n  \"ResidenceCity\": \"SD\",\n  \"ResidenceState\": \"CA\",\n  \"ResidencePostalCode\": \"\",\n  \"ResidenceCountry\": \"\",\n  \"WorkAddress\": \"2617 South Robinson Avenue, Oklahoma City\",\n  \"WorkCity\": \"Oklahoma\",\n  \"WorkState\": \"OK\",\n  \"WorkPostalCode\": \"73109\",\n  \"WorkCountry\": \"USA\",\n  \"ReHire\": \"\"\n }\n]}\n```\n\n### Sample cURL request for a list of employees added/updated on or after 05/18/2019\n\n```\ncurl -X GET \"https://instance.servicenow.com/api/sn_hr_core/V1/hr_rest_api/get_usa_employee_profile?update_after=2019-05-18\"\n-H \"accept: application/json\" \\\n-u \"username\":\"password\"\n```\n\n```\n{\"result\": [\n {\n  \"EmployeeIdentifier\": \"2345\",\n  \"FirstName\": \"Cheryl\",\n  \"MiddleName\": \"Lynn\",\n  \"LastName\": \"Smith\",\n  \"Suffix\": \"Mrs.\",\n  \"Email\": \"Cheryl.Smith@example.com\",\n  \"BirthDate\": \"\",\n  \"HireDate\": \"2019-06-18\",\n  \"Company\": \"ServiceNow Inc\",\n  \"ResidenceAddress\": \"\",\n  \"ResidenceCity\": \"SD\",\n  \"ResidenceState\": \"CA\",\n  \"ResidencePostalCode\": \"\",\n  \"ResidenceCountry\": \"\",\n  \"WorkAddress\": \"2617 South Robinson Avenue, Oklahoma City\",\n  \"WorkCity\": \"Oklahoma\",\n  \"WorkState\": \"OK\",\n  \"WorkPostalCode\": \"73109\",\n  \"WorkCountry\": \"USA\",\n  \"ReHire\": \"\"\n  },\n  {\n  \"EmployeeIdentifier\": \"1111\",\n  \"FirstName\": \"Thomas\",\n  \"MiddleName\": \"\",\n  \"LastName\": \"Doe\",\n  \"Suffix\": \"Mr.\",\n  \"Email\": \"Thomas.Doe@example.com\",\n  \"BirthDate\": \"1978-05-22\",\n  \"HireDate\": \"2019-08-14\",\n  \"Company\": \"\",\n  \"ResidenceAddress\": \"\",\n  \"ResidenceCity\": \"San Jose\",\n  \"ResidenceState\": \"CA\",\n  \"ResidencePostalCode\": \"\",\n  \"ResidenceCountry\": \"\",\n  \"WorkAddress\": \"13308 Midland Road, Poway\",\n  \"WorkCity\": \"Poway\",\n  \"WorkState\": \"CA\",\n  \"WorkPostalCode\": \"\",\n  \"WorkCountry\": \"USA\",\n  \"ReHire\": \"\"\n  }\n]}   \n```\n\n"}}