Recruitee webhooks in production: duplicates, ordering, retries and timeouts

Published · Updated

This guide covers the problems Recruitee webhooks cause in production and how to handle each one. What Recruitee sends is on the Recruitee webhooks overview, every event type is on Recruitee webhook events, and signature verification code is on Verify Recruitee webhooks.

At a glance

ProblemWhat to doWith Event Gateway
TimeoutsStore the event and return exactly 200 within 10 secondsAnswers Recruitee with a 200, then queues the event for your service
DuplicatesDeduplicate on id, not the whole bodyStops most retries at the source, and can drop repeats on body.id
OrderingCompare created_at before applying an eventLogs every event and attempt, so you can see arrival order when debugging
RetriesWatch the Logs tab and failure emails, and retry after a fixAccepts deliveries while your service is down and retries them
Choosing eventsSelect only what you process, and route on type and subtypeFilters and routes events by event_type and event_subtype
TestingCheck test before dispatch and answer with a 200Answers the test request and filters test events
Other limitsUse created_at during rate-limit delays, and rely on the signature rather than IPsLimits the delivery rate to your service and verifies the signature

Recruitee webhook timeouts and the 200 rule

Recruitee times out after 10 seconds and treats any status other than 200 as a failed delivery. Store the event and return exactly 200 before doing any other work.

Why it happens: A handler that updates your HRIS, posts to a chat tool and sends an email before replying can easily run past 10 seconds. A 201, 202 or 204, which most frameworks treat as success, also counts as a failure, so the event is retried even though your work finished.

Fix it in your handler:

  1. Verify the signature and store the raw event.
  2. Return exactly 200, then do the work from a queue. See why to process webhooks asynchronously.
  3. After deploying a change, open the Logs tab and check the response your endpoint gave.

With Event Gateway: Hookdeck answers Recruitee with a 200 as soon as it accepts a delivery and queues the event, then delivers it to your service with its own timeout and retries. Your handler can take longer than 10 seconds without failing a Recruitee delivery.

Duplicate Recruitee webhooks

Recruitee retries any delivery that doesn't get a 200, so the same event can arrive more than once. Retries keep the same id, so deduplicate on it.

Why it happens: A handler that finishes its work and then times out, or returns a 204, receives the event again. attempt_count goes up with each retry, so two deliveries of one event have different bodies and comparing whole bodies won't catch them.

Fix it in your handler:

  1. Record each id you process, using a table with a unique constraint.
  2. Make every handler idempotent, so a repeat has no further effect.
  3. Return 200 for a duplicate, so Recruitee stops retrying it.

With Event Gateway: Because Hookdeck answers with a 200, a slow service doesn't set off Recruitee's retries. Its deduplication can also drop repeats inside a window of up to one hour, using body.id as the field to compare. Exact deduplication won't match them, because attempt_count changes.

Out-of-order Recruitee webhooks

Recruitee's docs don't address delivery order, so don't rely on arrival order. Compare created_at, which is when the event happened and doesn't change on retries.

Why it happens: A failed delivery can wait up to 48 hours for its next attempt, and a newer event for the same candidate can get through first. Requests over the rate limit are delayed by 10 minutes, plus or minus 5, which can also shuffle them.

Fix it in your handler:

  1. Store the created_at of the last event you applied to each candidate or job, and skip an older one for the same state.
  2. Take a candidate's stage from payload.details.to_stage, which all three candidate_moved subtypes carry, rather than working it out from earlier events.
  3. For anything that must be current, read the record from the Recruitee API.

With Event Gateway: Hookdeck logs every event and delivery attempt, so you can see arrival order when you're debugging. It doesn't reorder events, so your handler still has to cope with either order.

Recruitee webhook retries and missed events

Recruitee retries a failed delivery up to nine times over about 90 hours: after 1, 3, 10 and 45 minutes, then 2, 5, 10, 24 and 48 hours. The docs don't say what happens after the ninth retry, so plan to catch failures yourself.

Why it happens: Each delay is counted from the previous failed attempt, so a long outage, or a bug that returns the wrong status, can use up every retry. Recruitee logs each request for 30 days, and after that there's no documented record of it.

Fix it in your handler:

  1. Under Settings > Apps and Plugins > Webhooks, choose the team members who should be emailed about failed deliveries.
  2. After a fix, open the Logs tab. Each request shows its body, your response and the next attempt time, with controls to cancel the automatic retry or retry immediately.
  3. For anything you can't afford to miss, reconcile against the Recruitee API on a schedule.

With Event Gateway: Hookdeck accepts every event as soon as Recruitee sends it, so an outage on your side doesn't use up Recruitee's retries. Hookdeck holds events and retries delivery to your service on a schedule you set, you can retry them by hand or in bulk, and it raises issues when deliveries fail.

Choosing Recruitee events

Select only the events you process, and route on event_type and event_subtype together, because one type can cover several different changes.

Why it happens: Recruitee has no separate disqualification event. candidate_moved covers all of these, and payload.details differs for each event_subtype:

event_subtypepayload.details
stage_changedfrom_stage and to_stage
disqualifiedto_stage and disqualify_reason
requalifiedto_stage

offer_updated works the same way, with offer_changed, status_changed and tags_changed. A new candidate can produce both new_candidate, with an offers list, and candidate_assigned, with one offer and placement_locations.

Fix it in your handler:

  1. Select only the events you need when you create the webhook. You can change them later.
  2. Switch on event_type, then on event_subtype, and return 200 for anything you don't handle.
  3. Pick one of new_candidate and candidate_assigned to act on for assignments, so one application doesn't run your logic twice.
  4. Don't compare event_subtype with candidate.source. The subtype says imported, while the docs list import as the source value.

With Event Gateway: Hookdeck's filters route events on body fields such as event_type and event_subtype, so each service gets only the events it handles.

Testing Recruitee webhooks

Verify and create needs a 200 to the test request, so start your receiver first and answer the request before event dispatch.

Why test requests need care: Test sends {"test":true}, and the Test payload buttons send an example event with test added, so a handler that skips the check runs the example as a real event. Recruitee says the signature header is on all requests, but its example test request shows none, so make sure a signature check doesn't reject the bare {"test":true} body.

Test it:

  1. Start your server and a tunnel. hookdeck listen 3000 recruitee --path /webhooks/recruitee gives you a public HTTPS URL that forwards to your local server.
  2. Use that URL as the POST URL, and click Test, then a Test payload button.
  3. Check that each request gets a 200 and triggers no side effects. The Logs tab shows what your endpoint returned.
  4. Click Verify and create.

With Event Gateway: A Hookdeck source answers the test request with a 200, so you can create the webhook before your service is deployed. A pass therefore doesn't confirm the secret, because a request with the wrong signature still gets a 200, but it's recorded as failed verification and creates no event. A filter on test can keep test events out of production, and the Hookdeck CLI forwards events to your machine.

Other Recruitee webhook limits

Recruitee has three more limits to plan for.

Rate limits delay bursts. Trial companies get 5 requests per minute and all others get 100. Above that, requests are delayed by 10 minutes, plus or minus 5, so during a busy period events can arrive 5 to 15 minutes late. Use created_at rather than the arrival time, and don't rely on webhooks for anything that must happen within seconds.

No timestamp is signed. The signature covers only the body, and created_at is the event time, so a captured request stays valid if it's sent again. Deduplicating on id stops a repeat from having any effect, and rejecting old created_at values would also reject real retries.

No source IP list. Recruitee publishes no IP addresses for its webhooks, and User-Agent: Recruitee-Webhooks proves nothing, so check the signature instead.

With Event Gateway: Hookdeck can't change Recruitee's quota or send delayed events sooner. It verifies the signature on each delivery, and a max delivery rate on your destination keeps a burst from overwhelming your service.

Stop a slow handler or a 201 from setting off Recruitee's retries.

Hookdeck Event Gateway answers Recruitee with a 200 as soon as a delivery arrives, verifies its signature, queues the event and retries to your service on your schedule.

Not affiliated with Recruitee. Facts are compiled from public sources and linked inline.