API and webhooks
jah.dk runs on the jajob.dk platform, so the API and webhooks are the same. The full API description is in the jajob.dk developer docs.
Basics
- Base URL:
https://jajob.dk/api/v1 - Authentication:
Authorization: Bearer <token>. Get a token withPOST /api/v1/auth/login. - Errors:
{"error": {"code", "message", "details"}}.
Partner API keys (jjk_…) are created by a company owner with POST /api/v1/apikeys (scopes: read, write; empty means full access); the key is shown once. Send it as Authorization: Bearer jjk_…. A key works only for its own company and only for vacancies (/vacancies, /companies/{id}/vacancies), applications and pipeline (/applications/{id}/status, /vacancies/{id}/pipeline) and reading webhook endpoints. Keys cannot create keys, manage the team, billing or webhooks. Limit: 600 requests per minute per key.
Vacancies from another system
PUT /api/v1/companies/{id}/vacancies/by-external/{external_id} creates the vacancy (201) or updates it (200); repeating the call never duplicates. GET /api/v1/companies/{id}/vacancies lists all vacancies with application counts per status. Send "status": "draft" (or ?publish=false) to save a draft: it is not public and sends no vacancy.created; a later PUT with "status": "active" publishes it and then vacancy.created is sent. PUT never turns a published vacancy back into a draft. Closed vacancies stay reachable by link but are noindex. Close and reopen with POST /api/v1/vacancies/{id}/close and /reopen. Ready-made drafts for trades: GET /api/v1/vacancy-packs/byg/templates?lang=en.
Webhooks
Register an HTTPS endpoint with POST /api/v1/webhooks/endpoints and receive signed events:
| Event | When |
|---|---|
application.created |
A new application arrives |
application.status_changed |
A candidate moves to another stage |
vacancy.created |
A vacancy is published |
vacancy.closed |
A vacancy is closed |
vacancy.reopened |
A vacancy is reopened |
vacancy.expired |
A job reaches its deadline |
Every delivery body has an id (the same on retries, also sent as Idempotency-Key); use it to ignore repeats. application.* events carry the candidate fields that the candidate has allowed this company to see.
Every delivery has the headers X-Jajob-Event, X-Jajob-Delivery and X-Jajob-Signature. Failed deliveries are retried; private and loopback hosts are blocked.
To feed jakun, register an endpoint with "format": "jakun", key_id and secret (both issued by jakun). The body is then jakun's envelope {id, type, source, occurred_at, data} with X-JaKun-Key and X-JaKun-Signature: t=<unix>,v1=<hmac> (types job.*, candidate.applied, candidate.stage_changed).
Verify the signature
The signature is HMAC-SHA256 of the raw request body with your endpoint secret. The body is already canonical JSON (sorted keys, no spaces, non-ASCII letters such as æ, ø, å as \uXXXX), so compute the HMAC over the bytes exactly as received, before parsing them.
import hashlib, hmac
def verify(secret: str, raw_body: bytes, signature: str) -> bool:
expected = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)
import crypto from "node:crypto";
// rawBody: the request body as received (Buffer), before JSON.parse
export function verify(secret, rawBody, signature) {
const expected = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}
Answer with a 2xx status quickly and do the work afterwards.
Something unclear or missing? Write to info@jajob.dk.