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

Agent skill: `npx skills add hookdeck/webhook-skills --skill recruitee-webhooks` ([details](https://hookdeck.com/webhooks/recruitee/skill))

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

## At a glance

| Problem | What to do | With Event Gateway |
| --- | --- | --- |
| [Timeouts](#timeouts) | Store the event and return exactly 200 within 10 seconds | Answers Recruitee with a 200, then queues the event for your service |
| [Duplicates](#duplicates) | Deduplicate on `id`, not the whole body | Stops most retries at the source, and can drop repeats on `body.id` |
| [Ordering](#ordering) | Compare `created_at` before applying an event | Logs every event and attempt, so you can see arrival order when debugging |
| [Retries](#retries) | Watch the **Logs** tab and failure emails, and retry after a fix | Accepts deliveries while your service is down and retries them |
| [Choosing events](#choosing-events) | Select only what you process, and route on type and subtype | Filters and routes events by `event_type` and `event_subtype` |
| [Testing](#testing) | Check `test` before dispatch and answer with a 200 | Answers the test request and filters test events |
| [Other limits](#other-limits) | Use `created_at` during rate-limit delays, and rely on the signature rather than IPs | Limits the delivery rate to your service and verifies the signature |

## Recruitee webhook timeouts and the 200 rule {#timeouts}

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](/webhooks/guides/why-implement-asynchronous-processing-webhooks).
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](/docs/retries). Your handler can take longer than 10 seconds without failing a Recruitee delivery.

## Duplicate Recruitee webhooks {#duplicates}

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](/webhooks/guides/implement-webhook-idempotency), 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](/docs/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 {#ordering}

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 {#retries}

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](/docs/retries), and it raises [issues](/docs/issues) when deliveries fail.

## Choosing Recruitee events {#choosing-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_subtype` | `payload.details` |
| --- | --- |
| `stage_changed` | `from_stage` and `to_stage` |
| `disqualified` | `to_stage` and `disqualify_reason` |
| `requalified` | `to_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](/docs/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 {#testing}

**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](/docs/filters) on `test` can keep test events out of production, and the [Hookdeck CLI](/docs/cli) forwards events to your machine.

## Other Recruitee webhook limits {#other-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](/docs/destinations#set-a-max-delivery-rate) on your destination keeps a burst from overwhelming your service.