Skip to main content
Integration Examples

ATS Integration Examples

Complete integration guides for Greenhouse, Lever, Workday, and custom ATS systems

Quick Start

1

Get API Key

Generate an API key with nyc:hiring.write scope

2

Configure Webhook

Set up webhook in your ATS pointing to HAIEC endpoint

3

Test Integration

Make a test decision and verify explanation generation

Greenhouse Integration

Webhook Configuration

Webhook URL
https://haiec.com/api/v1/nyc-hiring/webhook/greenhouse

Setup Steps

  1. 1.Go to Greenhouse → Configure → Webhooks
  2. 2.Create new webhook with URL above
  3. 3.Select events: candidate_stage_change, application_rejected
  4. 4.Add webhook secret to your environment variables

Environment Variables

# Add to Vercel Environment Variables
WEBHOOK_SECRET_GREENHOUSE=your-greenhouse-webhook-secret
NYC_HIRING_API_KEY=haiec_live_your-api-key

Example Payload

{
  "action": "candidate_stage_change",
  "payload": {
    "application": {
      "id": 12345,
      "candidate_id": 67890,
      "job_id": 111,
      "status": "rejected",
      "current_stage": {
        "name": "Rejected"
      },
      "rejection_reason": {
        "name": "Insufficient experience",
        "type": {
          "name": "Qualifications"
        }
      }
    }
  }
}

Lever Integration

Webhook Configuration

Webhook URL
https://haiec.com/api/v1/nyc-hiring/webhook/lever

Setup Steps

  1. 1.Go to Lever → Settings → Integrations → Webhooks
  2. 2.Add webhook endpoint with URL above
  3. 3.Subscribe to: candidateStageChange, candidateArchived
  4. 4.Copy webhook signature token

Environment Variables

# Add to Vercel Environment Variables
WEBHOOK_SECRET_LEVER=your-lever-signature-token
NYC_HIRING_API_KEY=haiec_live_your-api-key

Direct API Integration (Custom ATS)

Node.js Example

const response = await fetch('https://haiec.com/api/v1/nyc-hiring/decision-event', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer haiec_live_your-api-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    candidateIdRaw: 'candidate_12345',
    jobIdRaw: 'job_67890',
    decision: 'reject',
    decisionTimestamp: new Date().toISOString(),
    decisionFactors: [
      { factor: 'years_experience', value: 2, weight: 0.3, contribution: 'negative' },
      { factor: 'technical_score', value: 45, weight: 0.4, contribution: 'negative' }
    ],
    aedtName: 'CustomATS AI',
    aedtVersion: '1.0',
    requestExplanation: true
  })
})

const result = await response.json()
console.log('Decision Event ID:', result.decisionEventId)
console.log('Explanation ID:', result.explanationId)

// Send candidate message
sendEmail({
  to: candidate.email,
  subject: result.candidateMessage.subject,
  body: result.candidateMessage.body
})

Python Example

import requests

response = requests.post(
    'https://haiec.com/api/v1/nyc-hiring/decision-event',
    headers={
        'Authorization': 'Bearer haiec_live_your-api-key',
        'Content-Type': 'application/json'
    },
    json={
        'candidateIdRaw': 'candidate_12345',
        'jobIdRaw': 'job_67890',
        'decision': 'reject',
        'decisionTimestamp': datetime.now().isoformat(),
        'decisionFactors': [
            {'factor': 'years_experience', 'value': 2, 'weight': 0.3, 'contribution': 'negative'},
            {'factor': 'technical_score', 'value': 45, 'weight': 0.4, 'contribution': 'negative'}
        ],
        'aedtName': 'CustomATS AI',
        'aedtVersion': '1.0',
        'requestExplanation': True
    }
)

result = response.json()
print(f"Decision Event ID: {result['decisionEventId']}")
print(f"Explanation ID: {result['explanationId']}")

Testing Your Integration

Test with Sandbox API Key

Use a sandbox API key (starts with haiec_test_) for testing without affecting production data.

Authorization: Bearer haiec_test_your-sandbox-key

Verification Checklist

Webhook signature verification passes
Decision event created successfully
Explanation generated (if requested)
Candidate message is compliant and clear
Internal memo contains full technical details
Idempotency works (duplicate events rejected)

Need Help?

Our team is here to help you integrate NYC Hiring Compliance into your ATS