REST API Reference
Resources
HRConnect REST API
The HRConnect REST API provides programmatic access to all HRConnect resources. You can use the API to integrate HRConnect with your existing systems, build custom workflows, and automate HR processes.
Base URL
All API requests should be made to: https://api.hrconnect.com
Authentication
The HRConnect API uses API keys to authenticate requests. You can view and manage your API keys in the HRConnect dashboard.
Authentication to the API is performed via HTTP Bearer Authentication. Provide your API key as the bearer token value in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Keep your API key secure
Your API key has many privileges, so be sure to keep it secure. Do not share your API key in publicly accessible areas such as GitHub, client-side code, etc.
For integrations that need to perform actions on behalf of users, we support OAuth 2.0 authentication. This allows users to grant your application permission to access their data without sharing their credentials.
View OAuth 2.0 DocumentationError Handling
The HRConnect API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided, and codes in the 5xx range indicate an error with our servers.
Code | Description |
---|---|
200 - OK | Everything worked as expected. |
201 - Created | A new resource was successfully created. |
400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 - Unauthorized | No valid API key provided. |
403 - Forbidden | The API key doesn't have permissions to perform the request. |
404 - Not Found | The requested resource doesn't exist. |
429 - Too Many Requests | Too many requests hit the API too quickly. |
500, 502, 503, 504 - Server Errors | Something went wrong on our end. |
Error Response Format
When an error occurs, the API will return a JSON response with an error object containing details about the error.
{ "error": { "code": "invalid_request", "message": "The request was unacceptable, often due to missing a required parameter.", "param": "email", "type": "validation_error" } }
Rate Limits
The HRConnect API implements rate limiting to protect our infrastructure and ensure fair usage. Rate limits vary based on your plan.
Plan | Rate Limit |
---|---|
Basic | 100 requests per minute |
Premium | 300 requests per minute |
Enterprise | 1000 requests per minute |
Rate limit headers are included in all API responses:
X-RateLimit-Limit
: The maximum number of requests you're permitted to make per minute.X-RateLimit-Remaining
: The number of requests remaining in the current rate limit window.X-RateLimit-Reset
: The time at which the current rate limit window resets in UTC epoch seconds.
Pagination
All list endpoints support pagination using the page
and limit
query parameters.
GET /api/v1/employees?page=2&limit=10
The response will include pagination metadata:
{ "data": [...], "pagination": { "total": 125, "page": 2, "limit": 10, "pages": 13, "prev": 1, "next": 3 } }
API Versioning
The HRConnect API is versioned to ensure backward compatibility as we evolve the API. The current version is v1.
All API requests should include the version in the URL path:
https://api.hrconnect.com/api/v1/employees
We will notify you well in advance of any breaking changes or deprecations to the API.
Employees
The Employees API allows you to manage employee data, including personal information, job details, and more.
Attendance
The Attendance API allows you to track employee attendance, including clock-in and clock-out times, and generate attendance reports.
Leaves
The Leaves API allows you to manage employee leave requests, approvals, and leave balances.
Payroll
The Payroll API allows you to manage payroll periods, calculate payroll, and generate payslips.
Reports
The Reports API allows you to generate various HR reports, including attendance, leave, payroll, and employee turnover reports.