Developer guide

Connect your own systems to Ghirbal. With the API, your system reads and changes your hiring data: jobs, applications, candidates, interviews and settings. With webhooks, Ghirbal tells your system the moment something happens. Every endpoint, field and schema is in the OpenAPI file, which also imports into Postman.

Quick start

  • An admin opens Settings → Integrations → API and webhooks, turns it on, and creates a key. It's shown once, so copy it then.
  • Every call goes to https://ghirbal.dev.creativeadvtech.ml/api/v1 with the key as a bearer token:
curl https://ghirbal.dev.creativeadvtech.ml/api/v1/jobs?limit=1 \
  -H "Authorization: Bearer ghb_…"
{ "data": [ { "id": "77b1…", "title": "Cashier", "status": "published", … } ], "next": "c2a9…" }

On dev and staging, /api/v1/docs lets you try every endpoint: paste a key from that environment into Authorize.

Keys and access

  • Keys look like ghb_…. Send one on every call as Authorization: Bearer ghb_…, over HTTPS.
  • A key is read only or read & write. GET is a read; every other method needs a read & write key.
  • A key reaches only its own company's data, and sees what an admin sees. It works only in the environment it was made in.
  • What a key does shows in the candidate's timeline as done through the API, and any email it triggers goes out in the language chosen for the key.
  • Revoking a key, or turning the company's API off, takes effect at once.
  • Team invites and roles, privacy settings, the plan and the keys and webhooks themselves stay in the app, so a leaked key can't create more access.

Endpoints

Paths are relative to https://ghirbal.dev.creativeadvtech.ml/api/v1. GET needs any key; every other method needs a read & write key. The fields of each one are in the OpenAPI file.

Jobs

GET /jobs
The company's jobs, newest first; with updated_since, oldest change first.
POST /jobs
A new draft job. Without flowTemplateId or steps it gets the company's default flow.
GET /jobs/{id}
One job, with its steps, questions, links and counts.
PATCH /jobs/{id}
Change any of the job's details; the rest keep their values. A live job must stay publishable (409 not_ready). Once anyone has applied, criteria can't change (409 criteria_locked).
DELETE /jobs/{id}
Delete a draft. Any other job is 409 not_draft: archive it instead.
POST /jobs/{id}/publish
Publish a draft, or reopen a paused or closed job. The first publish gives it its public link. 409 not_ready names what's missing.
POST /jobs/{id}/pause
Pause a published job.
POST /jobs/{id}/close
Close a published or paused job.
POST /jobs/{id}/archive
Archive a draft, closed or filled job.
GET /jobs/{id}/steps
The hiring flow, in order.
PUT /jobs/{id}/steps
Replace the flow: application first, hired last. Keep a step's id to keep it; a step with candidates can't be removed (409 stage_in_use).
GET /jobs/{id}/questions
The application form's questions, in order.
PUT /jobs/{id}/questions
Replace the questions. Keep a question's id to keep it; one with answers can't be removed or change type (409 question_answered).
PUT /jobs/{id}/steps/{stepId}/guide
Set an interview step's guide (questions with a 1-4 rubric) and scorecard. null puts back the defaults; 409 not_interview on another kind of step.
PUT /jobs/{id}/steps/{stepId}/simulation
Link a company simulation to a simulation step, or switch it to another. There's no unlinking: the step keeps running the last one. 409 not_simulation on another kind of step.

Applications

GET /applications
The company's applications, newest first; with updated_since, oldest change first. Each row has the person, job, step, answers and CV.
GET /applications/{id}
One application: the person, answers, CV, where it stands, scores and history.
GET /applications/{id}/cv
A fresh link to the CV, working for 10 minutes. 404 when there's none.
POST /applications/{id}/move
Move to another step of its job, short of Hired (use /hire). The step's automation runs, as in the app. 409 not_active once it's closed. Moving back is free; moving forward, an Interview, Evaluation or Offer step can't be skipped: 409 skips_step until it has been through each one.
POST /applications/{id}/reject
Reject. timing later waits the company's delay (status rejecting, undoable), now sends the letter at once, never closes it without one. The reason and note stay internal.
POST /applications/{id}/undo-rejection
Take back a rejection before its letter goes. 409 too_late once it has, not_rejecting if there's none waiting.
POST /applications/{id}/hire
Mark as hired, as the app's Hire does. 409 not_active once it's closed. An Interview, Evaluation or Offer step can't be skipped: 409 skips_step until it has been through each one.
POST /applications/{id}/choose
Choose this finalist at Evaluation, with the reason: on to the next step, or hired. 409 blind while a scorecard is still out, filled when the job is, no_next with no step after, not_active when it's not at Evaluation.
PUT /applications/{id}/pool
Add the person to the talent pool.
DELETE /applications/{id}/pool
Take the person out of the talent pool.
PUT /applications/{id}/scores
The team's own score for one competency of a simulation scorecard, next to the AI's. Ids and names are in simulations[].scorecard.
PUT /applications/{id}/quiz
The team's points for one written quiz answer (up to the question's points). Grading the last one decides pass or fail. Ids are in quizzes[].
POST /applications/bulk/move
Move up to 100 applications to a step. Each moves on its own; one that can't (closed, another job's, or it would skip an Interview, Evaluation or Offer step) is skipped.
POST /applications/bulk/reject
Reject up to 100 applications, as /applications/{id}/reject does. One that's no longer active is skipped.

Candidates

GET /candidates
People who applied, newest first; q finds them by name, email or phone.
GET /candidates/{id}
A person and all their applications.
DELETE /candidates/{id}
Privacy erasure, which can't be undone: open applications close as withdrawn without a letter, and the person, answers, files and messages are wiped. Needs ?confirm=erase. 409 unconfirmed_match while an application matched to them by phone or email awaits the team's decision.
GET /candidates/{id}/export
Everything held on the person, for a data request: their record and each application in full, with conversations and messages. 409 unconfirmed_match while an application matched to them by phone or email awaits the team's decision.

Interviews

GET /interviews
The company's interviews, newest first: waiting for a time, booked or cancelled. A candidate gets one when they reach an interview step.
GET /interviews/{id}
One interview: its time, place, interviewers and where it stands.
GET /interviews/{id}/slots
Times to book: the next 10 working days from an hour ahead, in the step's length, with who's busy at each.
POST /interviews/{id}/book
Book a time for the candidate, from /slots. Everyone is told and gets a calendar invite, as in the app. 400 not_offered when the start isn't on /slots, 409 taken when it isn't free, not_allowed once it's booked (use /reschedule).
POST /interviews/{id}/reschedule
Move a booked interview to another free time from /slots, before it starts. Everyone is told. 400 not_offered, 409 taken, closed when it moved meanwhile, or not_allowed once it has started.
POST /interviews/{id}/cancel
Cancel a booked interview before it starts. Everyone is told, and the step opens a new wait for a time, which is what this replies with.
POST /interviews/{id}/remind
While it waits for a time: send the candidate their booking link again. Once it is over: remind the interviewers whose scorecards are still out. 409 too_soon within a day of the last one.
POST /interviews/{id}/no-show
Mark that the candidate didn't come, once it has started. 409 not_allowed once a scorecard is in.
POST /interviews/{id}/rebook
After a no-show: open a new wait for a time at the same step, which is what this replies with.
GET /interviews/{id}/scorecards
The submitted scorecards (1-4 per item) and who's still out. Interviewers fill them in from their own link; the API reads them only.

Settings

GET /settings/company
The company profile the careers and job pages show.
PATCH /settings/company
Change any of the profile; the rest keep their values. An empty string clears a field (not the name).
PUT /settings/company/logo
Replace the logo: the image itself as the body, PNG, JPEG or WebP, up to 2 MB. Its bytes must match its Content-Type.
DELETE /settings/company/logo
Take the logo off.
PUT /settings/company/pattern
Replace the brand pattern, tiled behind the careers page header: the image itself as the body, SVG, PNG or WebP, up to 2 MB. PNG and WebP must be at least 200×200 px; an SVG can't hold scripts, event handlers or outside links.
DELETE /settings/company/pattern
Take the brand pattern off; the header goes back to the plain brand colour.
GET /settings/messages
The messages candidates get, in Arabic and English, as the company has worded them.
PUT /settings/messages/{kind}
Reword one message, in one language or both. A message that carries a link must keep {link} ({الرابط} in Arabic). Sending Ghirbal's own wording back returns to the default.
GET /settings/flows
The company's hiring-flow templates, and the one new jobs start from.
POST /settings/flows
Save a hiring flow as a template. steps are as POST /jobs takes them.
PATCH /settings/flows/{id}
Rename a template or change its steps. Jobs made from it keep theirs.
DELETE /settings/flows/{id}
Delete a template. If it was the default, new jobs go back to standard.
PUT /settings/flows/default
Choose the flow new jobs start from.
GET /settings/questions
The question bank, newest first: application, quiz and interview questions.
POST /settings/questions
Add a question to the bank. usage sets its shape: application and quiz ones take question; interview ones take label and a four-level rubric.
PUT /settings/questions/{id}
Replace a bank question. Jobs that added it keep their copy.
DELETE /settings/questions/{id}
Take a question out of the bank.
GET /settings/interviews
Interview defaults: saved places, the meeting tool, default hours (minutes from midnight, Baghdad) and what candidates may do.
PUT /settings/interviews
Replace the interview defaults: send them all, as anything left out takes Ghirbal's default. A meeting tool other than link must be connected in Settings → Integrations first.
GET /settings/team
The team's active members, for choosing interviewers (an interview step's config.interviewers[].userId). Invites and roles stay in the app.
GET /settings/simulations
The company's simulations, for PUT /jobs/{id}/steps/{stepId}/simulation. Writing a new one uses AI, so it stays in the app.
GET /settings/rejection-reasons
The reasons reject accepts, labelled in the key's language.

Requests and paging

  • Bodies are JSON, up to 1 MB. Times are ISO 8601 in UTC, and ids are UUIDs.
  • One record comes back under data. A list adds next, the cursor for the following page, which is null on the last.
  • Lists take limit (1 to 100, default 50) and cursor. A cursor only works with the same filters.
  • Lists are newest first. With updated_since (jobs and applications), they run oldest change first, so a sync can walk forward.
GET /applications?status=hired&updated_since=2026-11-01T00:00:00Z&limit=50

File links, like a CV's, last 10 minutes. GET /applications/{id}/cv makes a new one.

Errors

Every error has the same shape: a stable code to program against, a readable message, and for invalid input the fields at fault.

HTTP/1.1 400 Bad Request
{
  "error": {
    "code": "invalid_request",
    "message": "Some fields are invalid.",
    "fields": [ { "field": "title", "issue": "required" } ]
  }
}
StatusCodeWhen
400invalid_requestA field, parameter or header is wrong. fields names each one.
401unauthorizedThe key is missing, wrong or revoked, or the company switched the API off.
403read_only_keyA read-only key tried to change something.
404not_foundIt doesn't exist, or belongs to another company. We never say which.
409not_draft, not_active, …Not allowed in its current state, like deleting a published job. The codes are the app's own.
409skips_stepA move or hire would jump past an Interview, Evaluation or Offer step the candidate hasn't been through. Move them one step at a time.
409idempotency_conflictThat Idempotency-Key was used with a different request.
409idempotency_in_progressA request with that Idempotency-Key is still running.
413too_largeThe body is over 1 MB, or the file is over its limit.
429rate_limitedToo many calls. Wait for Retry-After seconds.
500internalSomething went wrong on our side. It's safe to retry.

Rate limits

Each key can make 120 calls a minute, and each company 300. Every reply carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds). Past the limit you get 429 with Retry-After.

Idempotency

Any POST takes an Idempotency-Key header (1 to 255 characters, a UUID is ideal). Sending the same key again within 24 hours returns the first reply, marked Idempotent-Replayed: true, without doing the work twice. So when a call times out, retry it with the same key.

Webhooks

In Settings → Integrations → API and webhooks, an admin adds up to 10 HTTPS URLs and picks the events each one gets. Each URL has its own signing secret, whsec_…, shown once. Send test sends a ping event with empty data, and Deliveries shows the last 50 notices, what your system answered, and Send again.

POST https://hr.example.com/ghirbal/webhook
Content-Type: application/json
User-Agent: Ghirbal-Webhooks/1.0
Ghirbal-Event-Id: 5b0e…
Ghirbal-Event-Type: application.hired
Ghirbal-Delivery-Id: 9f12…
Ghirbal-Signature: t=1794140100,v1=6f1c0a…

{
  "id": "5b0e…",
  "type": "application.hired",
  "createdAt": "2026-11-08T10:15:00.000Z",
  "change": {
    "from": { "stepId": "s6…", "status": "active" },
    "to": { "stepId": "s7…", "status": "hired" }
  },
  "data": { …the application, as GET /applications/{id} returns it… }
}
  • Answer with any 2xx within 10 seconds. Anything else, a timeout or a redirect (we don't follow them) counts as a failure.
  • Retries come after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours: 7 tries over about 21 hours.
  • At least once: the same event can arrive more than once. id is the event's, the same on every retry and Send again, so skip one you've handled.
  • Order isn't kept. Use createdAt to put events in order.
  • data is the record when we prepared the notice, usually moments after the event, and retries send it unchanged. It may have moved on since: go by type and, for a step change (moved, rejected, hired), change, which says what the event itself changed.
  • File links in data are made fresh on every try, and last 10 minutes.
  • Switching off: a 410 Goneswitches the URL off at once, and so does a day of failures. The company's admins get an email, and turning it back on is one click. Notices due while it was off fail rather than wait; Send again sends one.
  • Someone erased for privacy is never sent: their waiting notices are deleted with them.

Verifying a webhook

Ghirbal-Signature is t=<unix seconds>,v1=<hex>, where v1 is the HMAC-SHA256 of `${t}.${rawBody}` with the URL's secret. Check it against the raw body, before parsing, and refuse a t more than five minutes off.

import crypto from "node:crypto";

// rawBody: the request body exactly as received, before any JSON parsing.
function verify(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300; // five minutes
  return fresh && v1?.length === expected.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}

// Express: keep the raw body for this route.
app.post("/ghirbal/webhook", express.raw({ type: "application/json" }), (req, res) => {
  if (!verify(req.body.toString("utf8"), req.get("Ghirbal-Signature") ?? "", process.env.GHIRBAL_WEBHOOK_SECRET)) return res.sendStatus(401);
  const event = JSON.parse(req.body);
  // Skip an event.id you've already handled, then do the work (or queue it) and answer quickly.
  res.sendStatus(204);
});

Events

data is the record as the endpoint shown returns it, in English.

EventWhendata
job.createdA job is created, as a draft.GET /jobs/{id}
job.publishedA job is published.GET /jobs/{id}
job.pausedA job is paused.GET /jobs/{id}
job.closedA job is closed.GET /jobs/{id}
job.archivedA job is archived.GET /jobs/{id}
job.filledA job is filled.GET /jobs/{id}
application.createdSomeone applies.GET /applications/{id}
application.movedAn application moves to another active step.GET /applications/{id}
application.rejectedA rejection is final: when its email goes out, or at once if it has none. Never while it can still be undone.GET /applications/{id}
application.withdrawnThe candidate withdraws, or is erased. Their details are deleted with it, so data holds nothing personal.{ id, status, job: { id } }
application.hiredSomeone is hired.GET /applications/{id}
interview.bookedAn interview is booked.GET /interviews/{id}
interview.rescheduledAn interview moves to another time.GET /interviews/{id}
interview.cancelledAn interview is cancelled.GET /interviews/{id}
interview.no_showThe candidate didn't come.GET /interviews/{id}
interview.completedAn interview is done.GET /interviews/{id}
scorecard.submittedAn interviewer submits their scorecard.GET /interviews/{id}/scorecards, plus interviewId and applicationId

Changelog

Version 1 won't change in a breaking way. A breaking change goes into a version 2, shows here, and admins of every company with a key hear about it well ahead.

  • November 2026, v1. Jobs, applications, candidates, interviews and settings endpoints, and the 17 webhook events. /api/v1/hires is retired: use GET /applications?status=hired or the application.hired webhook.