Webhooks allow you to receive real-time notifications when specific events occur on the AutoTechJobs platform. Instead of polling our API for changes, webhooks push data to your specified endpoint as events happen.
Webhooks are HTTP callbacks that are triggered when specific events occur in the AutoTechJobs system. When an event happens, we'll send an HTTP POST request to the URL you've configured, containing information about the event.
Register a new webhook endpoint to receive event notifications.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The URL that will receive webhook events (must be HTTPS) |
| events | array | Yes | Array of event types to subscribe to (see Event Types section) |
| description | string | No | Optional description of the webhook's purpose |
| secret | string | No | Secret key used to sign the webhook payload (if not provided, one will be generated) |
curl -X POST "https://api.autotechjobs.co.uk/v1/webhooks" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{
"url": "https://your-app.example.com/webhooks/autotechjobs",
"events": ["job.created", "application.submitted", "application.status_updated"],
"description": "Webhook for job and application events"
}'{
"data": {
"id": "wh_123456",
"url": "https://your-app.example.com/webhooks/autotechjobs",
"events": ["job.created", "application.submitted", "application.status_updated"],
"description": "Webhook for job and application events",
"secret": "whsec_abcdefghijklmnopqrstuvwxyz1234567890",
"status": "active",
"created_at": "2025-04-10T20:32:13Z"
}
}Important: Store the webhook secret securely. You'll need it to verify webhook signatures.
The following event types are available for webhook subscriptions:
| Event Type | Description |
|---|---|
| job.created | Triggered when a new job is created |
| job.updated | Triggered when a job is updated |
| job.expired | Triggered when a job expires |
| job.deleted | Triggered when a job is deleted |
| application.submitted | Triggered when a candidate submits an application |
| application.status_updated | Triggered when an application's status is updated |
| application.withdrawn | Triggered when a candidate withdraws an application |
| candidate.registered | Triggered when a new candidate registers |
| candidate.profile_updated | Triggered when a candidate updates their profile |
| employer.registered | Triggered when a new employer registers |
| employer.profile_updated | Triggered when an employer updates their profile |
When an event occurs, we'll send an HTTP POST request to your webhook URL with a JSON payload containing information about the event.
All webhook payloads have the following structure:
{
"id": "evt_123456", // Unique event ID
"type": "application.submitted", // Event type
"created_at": "2025-04-10T20:32:13Z", // When the event occurred
"data": { // Event-specific data
// Varies based on event type
}
}{
"id": "evt_123456",
"type": "application.submitted",
"created_at": "2025-04-10T20:32:13Z",
"data": {
"application": {
"id": "app_789012",
"job": {
"id": "job_123456",
"title": "Senior React Developer",
"company": "Tech Innovations Ltd"
},
"candidate": {
"id": "cand_789012",
"name": "Jane Smith",
"email": "[email protected]"
},
"status": "pending",
"applied_at": "2025-04-10T20:32:13Z"
}
}
}To ensure that webhook requests are coming from AutoTechJobs and not a third party, we sign all webhook requests with a signature. You should verify this signature before processing the webhook data.
Each webhook request includes an X-AutoTechJobs-Signature header with a timestamp and a signature. The format is: t=timestamp,v1=signature
const crypto = require('crypto');
function verifyWebhookSignature(payload, header, secret) {
// Extract timestamp and signature from header
const [timestamp, signature] = header.split(',');
const timestampValue = timestamp.split('=')[1];
const signatureValue = signature.split('=')[1];
// Check if the timestamp is too old (more than 5 minutes)
const now = Math.floor(Date.now() / 1000);
if (now - parseInt(timestampValue) > 300) {
return false; // Timestamp too old
}
// Create the string to sign
const signedPayload = `${timestampValue}.${payload}`;
// Compute the signature
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
// Compare signatures
return crypto.timingSafeEqual(
Buffer.from(signatureValue),
Buffer.from(expectedSignature)
);
}Retrieve all webhooks for your account.
Update an existing webhook configuration.
Delete a webhook endpoint.