API Documentation

Complete guide to integrating with the HavaHR platform

v1.0
Overview

The HavaHR API allows you to integrate your applications with our HR management platform. Build custom integrations, automate workflows, and sync data between systems.

RESTful API
Standard HTTP methods
Secure
OAuth 2.0 & API keys
Global
Available worldwide
Authentication
Secure your API requests with proper authentication
# Get your API key from the dashboard
curl -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     https://api.havaHR.com/v1/users

API Key Management

Generate and manage your API keys from the dashboard. Keep your keys secure and rotate them regularly.

API Endpoints
Complete list of available endpoints
GET
/api/users

Get all users in company

Response:
{
  "users": [
    {
      "id": "user_123",
      "name": "John Doe",
      "email": "john@company.com",
      "role": "USER",
      "position": "Software Engineer",
      "department": "Engineering"
    }
  ]
}
POST
/api/users

Create a new user

Request Body:
{
  "name": "Jane Smith",
  "email": "jane@company.com",
  "role": "USER",
  "position": "Designer",
  "department": "Design"
}
Response:
{
  "id": "user_124",
  "name": "Jane Smith",
  "email": "jane@company.com",
  "role": "USER"
}
Webhooks
Real-time notifications for events in your HavaHR account

Webhooks allow you to receive real-time notifications when events occur in your HavaHR account. Configure webhook endpoints in your dashboard to receive HTTP POST requests.

user.created

Triggered when a new user is created

Payload:
{
  "event": "user.created",
  "data": {
    "id": "user_123",
    "name": "John Doe",
    "email": "john@company.com",
    "companyId": "company_123"
  },
  "timestamp": "2024-11-15T10:00:00Z"
}
payroll.approved

Triggered when payroll is approved

Payload:
{
  "event": "payroll.approved",
  "data": {
    "id": "payroll_123",
    "userId": "user_123",
    "month": 11,
    "year": 2024,
    "netSalary": 4200
  },
  "timestamp": "2024-11-15T10:00:00Z"
}
leave.status_changed

Triggered when leave request status changes

Payload:
{
  "event": "leave.status_changed",
  "data": {
    "id": "leave_123",
    "userId": "user_123",
    "status": "APPROVED",
    "adminComment": "Approved for vacation"
  },
  "timestamp": "2024-11-15T10:00:00Z"
}
SDKs & Libraries
Official SDKs and community libraries for popular programming languages

JavaScript/TypeScript

Official SDK for Node.js and browser environments

npm install @havaHR/sdk

Python

Official Python SDK with async support

pip install havaHR-python

PHP

Community-maintained PHP library

composer require havaHR/php-sdk

Go

Lightweight Go client library

go get github.com/havaHR/go-sdk