API Reference

Comprehensive guide to the PihuPulse API for developers

Introduction

The PihuPulse API allows you to programmatically access and manage your recruitment data, automate screening processes, and integrate with your existing tools and workflows. Our RESTful API uses standard HTTP methods and returns JSON responses.

The base URL for all API requests is:

https://api.pihupulse.com/v1

Note

This documentation covers the latest version (v1) of the PihuPulse API. If you're using an older version, some features may not be available or may work differently.

Authentication

All API requests must be authenticated using an API key. You can generate an API key from your PihuPulse dashboard under Settings → API.

Include your API key in the request headers:

Authorization: Bearer YOUR_API_KEY

Warning

Keep your API key secure and never expose it in client-side code. If you believe your API key has been compromised, you should immediately regenerate it from your dashboard.

Example Request

curl -X GET "https://api.pihupulse.com/v1/candidates" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Rate Limiting

To ensure the stability of our service, the PihuPulse API implements rate limiting. The limits vary based on your subscription plan:

PlanRate LimitBurst Limit
Starter100 requests/minute150 requests
Professional300 requests/minute450 requests
Enterprise1000 requests/minute1500 requests

When you exceed your rate limit, the API will return a 429 Too Many Requests response. The response headers include information about your current rate limit status:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1620000000

Error Handling

The PihuPulse API uses conventional HTTP response codes to indicate the success or failure of an API request:

  • 2xx: Success
  • 4xx: Client errors (invalid request, authentication issues, rate limiting)
  • 5xx: Server errors (issues on our end)

Error responses include a JSON object with details about what went wrong:

{
  "error": {
    "code": "invalid_request",
    "message": "The candidate ID is invalid or not found",
    "status": 404,
    "details": {
      "candidate_id": "c12345"
    }
  }
}

Common Error Codes

Status CodeError CodeDescription
400invalid_requestThe request was malformed or missing required parameters
401unauthorizedAuthentication failed or API key is missing
403forbiddenYou don't have permission to access this resource
404not_foundThe requested resource doesn't exist
429rate_limitedYou've exceeded your rate limit

API Endpoints

Candidates

List Candidates

GET /candidates

Returns a paginated list of candidates in your account.

Query Parameters
ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerNumber of results per page (default: 20, max: 100)
statusstringFilter by status (active, archived, all)
Example Response
{
  "data": [
    {
      "id": "c12345",
      "name": "John Doe",
      "email": "john.doe@example.com",
      "phone": "+1234567890",
      "status": "active",
      "created_at": "2023-01-15T10:30:00Z",
      "updated_at": "2023-01-15T10:30:00Z"
    },
    {
      "id": "c12346",
      "name": "Jane Smith",
      "email": "jane.smith@example.com",
      "phone": "+1987654321",
      "status": "active",
      "created_at": "2023-01-16T14:20:00Z",
      "updated_at": "2023-01-16T14:20:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 5,
    "total_count": 98,
    "per_page": 20
  }
}

Get Candidate

GET /candidates/:id

Returns detailed information about a specific candidate.

Example Response
{
  "data": {
    "id": "c12345",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+1234567890",
    "status": "active",
    "resume_url": "https://storage.pihupulse.com/resumes/c12345.pdf",
    "skills": ["JavaScript", "React", "Node.js"],
    "experience_years": 5,
    "education": [
      {
        "institution": "University of Technology",
        "degree": "Bachelor of Computer Science",
        "year": 2018
      }
    ],
    "screenings": [
      {
        "id": "s67890",
        "status": "completed",
        "score": 85,
        "completed_at": "2023-01-20T15:45:00Z"
      }
    ],
    "created_at": "2023-01-15T10:30:00Z",
    "updated_at": "2023-01-20T15:45:00Z"
  }
}

Create Candidate

POST /candidates

Creates a new candidate in your account.

Request Body
{
  "name": "Alex Johnson",
  "email": "alex.johnson@example.com",
  "phone": "+1122334455",
  "resume_url": "https://example.com/resumes/alex_johnson.pdf"
}
Example Response
{
  "data": {
    "id": "c12347",
    "name": "Alex Johnson",
    "email": "alex.johnson@example.com",
    "phone": "+1122334455",
    "status": "active",
    "resume_url": "https://storage.pihupulse.com/resumes/c12347.pdf",
    "created_at  "active",
    "resume_url": "https://storage.pihupulse.com/resumes/c12347.pdf",
    "created_at": "2023-01-22T09:15:00Z",
    "updated_at": "2023-01-22T09:15:00Z"
  }
}

Screenings

List Screenings

GET /screenings

Returns a paginated list of screenings in your account.

Example Response
{
  "data": [
    {
      "id": "s67890",
      "candidate_id": "c12345",
      "template_id": "t54321",
      "status": "completed",
      "score": 85,
      "started_at": "2023-01-20T15:00:00Z",
      "completed_at": "2023-01-20T15:45:00Z"
    },
    {
      "id": "s67891",
      "candidate_id": "c12346",
      "template_id": "t54321",
      "status": "pending",
      "score": null,
      "started_at": null,
      "completed_at": null
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 3,
    "total_count": 42,
    "per_page": 20
  }
}

Create Screening

POST /screenings

Creates a new screening for a candidate.

Request Body
{
  "candidate_id": "c12347",
  "template_id": "t54321",
  "job_title": "Senior Frontend Developer",
  "send_invitation": true
}

Templates

List Templates

GET /templates

Returns a list of screening templates in your account.

Example Response
{
  "data": [
    {
      "id": "t54321",
      "name": "Frontend Developer",
      "description": "Screening for frontend development skills",
      "duration_minutes": 30,
      "question_count": 15,
      "created_at": "2022-12-10T08:30:00Z",
      "updated_at": "2023-01-05T14:20:00Z"
    },
    {
      "id": "t54322",
      "name": "Backend Developer",
      "description": "Screening for backend development skills",
      "duration_minutes": 45,
      "question_count": 20,
      "created_at": "2022-12-15T10:45:00Z",
      "updated_at": "2023-01-10T16:30:00Z"
    }
  ]
}

Reports

Get Screening Report

GET /screenings/:id/report

Returns a detailed report for a completed screening.

Example Response
{
  "data": {
    "screening_id": "s67890",
    "candidate_id": "c12345",
    "candidate_name": "John Doe",
    "template_id": "t54321",
    "template_name": "Frontend Developer",
    "score": 85,
    "completion_time_minutes": 38,
    "completed_at": "2023-01-20T15:45:00Z",
    "skill_scores": [
      {
        "skill": "JavaScript",
        "score": 90,
        "max_score": 100
      },
      {
        "skill": "React",
        "score": 85,
        "max_score": 100
      },
      {
        "skill": "CSS",
        "score": 80,
        "max_score": 100
      }
    ],
    "summary": "John demonstrated strong JavaScript and React skills. His CSS knowledge is good but could be improved. Overall, he shows a solid understanding of frontend development concepts.",
    "strengths": [
      "Problem-solving approach",
      "Code organization",
      "React component architecture"
    ],
    "areas_for_improvement": [
      "CSS animations",
      "Responsive design patterns"
    ],
    "recommendation": "Recommended for next interview stage"
  }
}

SDKs & Libraries

To make integration easier, we provide official client libraries for several popular programming languages:

JavaScript/TypeScript

Our JavaScript SDK works in both Node.js and browser environments.

npm install pihupulse-js
View on GitHub →

Python

Our Python SDK is compatible with Python 3.6 and above.

pip install pihupulse
View on GitHub →

Ruby

Our Ruby gem makes integration with Ruby applications seamless.

gem install pihupulse
View on GitHub →

PHP

Our PHP library supports PHP 7.4 and above.

composer require pihupulse/pihupulse-php
View on GitHub →

Note

Can't find an SDK for your preferred language? Our API follows RESTful principles and can be used with any HTTP client. Check out our community libraries or contact us for support.

Webhooks

Webhooks allow you to receive real-time notifications when events occur in your PihuPulse account. You can configure webhooks in your dashboard under Settings → Webhooks.

Available Events

EventDescription
candidate.createdTriggered when a new candidate is created
screening.createdTriggered when a new screening is created
screening.startedTriggered when a candidate starts a screening
screening.completedTriggered when a screening is completed
report.generatedTriggered when a screening report is generated

Webhook Payload

Each webhook includes a JSON payload with information about the event:

{
  "event": "screening.completed",
  "created_at": "2023-01-20T15:45:00Z",
  "data": {
    "screening_id": "s67890",
    "candidate_id": "c12345",
    "template_id": "t54321",
    "score": 85,
    "completed_at": "2023-01-20T15:45:00Z"
  }
}

Securing Webhooks

To verify that a webhook came from PihuPulse, we include a signature in the X-PihuPulse-Signature header. You should validate this signature before processing the webhook.

// Node.js example
const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const hmac = crypto.createHmac('sha256', secret);
  const calculatedSignature = hmac.update(payload).digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(calculatedSignature, 'hex'),
    Buffer.from(signature, 'hex')
  );
}