---
title: "Job alerts namespace"
label: "Job alerts"
description: "Reference for anonymous double-opt-in job-alert subscriptions and preference management."
publishedAt: 2026-07-10
updatedAt: 2026-11-03
order: 12
status: "published"
---

Use `board.jobAlerts` for anonymous email subscriptions with double opt-in and token-authenticated self-service. These methods do not use a board-user session. New subscription UI is available when `board.context().features.jobAlerts` is true.

The subscribe form follows the board password gate. Confirmation and management links remain open so recipients can confirm, unsubscribe, or change an existing subscription; their email token is the credential.

## Shared behavior

Every method returns the Board API wire body unchanged. A non-2xx response throws `BoardApiError`; inspect `status`, `code`, `details`, and `requestId`. The final `FetchOptions` argument passes abort signals, headers, and other fetch options through to `fetch`.

Confirmation and management responses use `Cache-Control: no-store`. Treat every confirmation or management token as a credential: do not log it, send it to analytics, or expose the containing URL through third-party referrers.

## `board.jobAlerts.subscribe`

Create or find an email subscription and send the double-opt-in message.

```ts no-check
board.jobAlerts.subscribe(
  input: JobAlertSubscribeInput,
  options?: FetchOptions,
): Promise<JobAlertSubscription>
```

`JobAlertSubscribeInput` contains:

| Field | Type | Behavior |
| --- | --- | --- |
| `email` | `string` | Subscriber email. |
| `consent` | `true` | Required literal; the server rejects anything else. |
| `frequency` | `'weekly'` | Optional; the only supported cadence and the default. |
| `filters` | `JobAlertFiltersInput` | Optional digest and preference filters. |
| `context` | `{ source?; jobId?; jobSlug? }` | Optional originating page/job context. |
| `timeZone` | `string` | Optional. The person's IANA time zone, such as `Europe/Berlin`, from `Intl.DateTimeFormat().resolvedOptions().timeZone` read in their browser (on your server it returns the server's zone). The board keeps the first value it receives for a person and ignores an invalid one. |
| `locale` | `string` | Optional. The language of the page the person signed up from, such as `de`: the board language or one of its Interface locales. The board keeps the first value it receives for a person and ignores a language it does not offer. |

`filters.jobFunctions`, `placeSlugs`, and `remoteOptions` affect digest matching. `seniorityLevels` and salary fields are stored for the preference UI but do not currently filter delivery. Unknown place slugs are dropped when Cavuno resolves them.

`filters.query` holds free-text search keywords, at most 200 characters after trimming, stored as given. Send the query a search page ran. A client that instead sends the keyword as its single `jobFunctions` entry with a search-page `context.source` still has it kept as the alert's `query`. A `context` with `source: 'job_detail'` (or `'job_apply_dialog'`) and a `jobId` creates a similar-job alert anchored on that job; it takes no `filters.query`, and sending one returns 400. Without a `jobId`, a job-page `context` with `filters.query` creates a search alert.

```ts
const subscription = await board.jobAlerts.subscribe({
  email: 'reader@example.com',
  consent: true,
  frequency: 'weekly',
  filters: {
    jobFunctions: ['engineering'],
    remoteOptions: ['remote'],
    placeSlugs: ['australia'],
  },
  context: { source: 'jobs_listing' },
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
  locale: 'de',
});

console.log(subscription.status);
```

The result is `{ object: 'job_alert_subscription', status }`, where `status` is always `submitted`. The response is intentionally uniform — it never reveals whether the email was new or already subscribed, so it can't be used to enumerate a board's subscribers. If the email isn't already subscribed, a confirmation email is sent to complete double opt-in, unless the address is suppressed (a hard bounce or spam report). An address that unsubscribed gets one too, at most once every 12 hours (never when the board's team unsubscribed the address).

`job_alerts_disabled` returns status 422; remove the form while the feature is off. A password-protected board without a valid board grant returns `board_password_required` with status 401. Invalid input returns 400, and the per-IP/email protection can return 429. An identical retry after an unknown response is state-safe because the response is uniform regardless of prior state, but never loop on 429—wait and let the user retry.

Related methods: [`board.jobAlerts.confirm`](#boardjobalertsconfirm) and [`board.jobAlerts.resendConfirmation`](#boardjobalertsresendconfirmation).

## `board.jobAlerts.confirm`

Complete double opt-in with the token from the confirmation email.

```ts no-check
board.jobAlerts.confirm(
  input: { token: string },
  options?: FetchOptions,
): Promise<JobAlertConfirmation>
```

```ts
const confirmation = await board.jobAlerts.confirm({ token });

switch (confirmation.status) {
  case 'confirmed':
  case 'already_confirmed':
    console.log('Subscribed');
    break;
  case 'waitlisted':
    console.log('Confirmed; alerts start once a spot opens');
    break;
  case 'unsubscribed':
    console.log('Alerts were turned off; subscribe again to get them back');
    break;
  case 'expired':
    console.log('Request another confirmation email');
    break;
  case 'not_found':
    console.log('Invalid confirmation link');
    break;
}
```

The result is `{ object: 'job_alert_confirmation', status }`. `confirmed`, `already_confirmed`, `expired`, `not_found`, `waitlisted`, and `unsubscribed` all return HTTP 200 so the page can render an outcome. `waitlisted` means the alert is confirmed and starts once the board can send to more people. `unsubscribed` means the link was sent before the alerts were turned off, so it doesn't turn them back on. Subscribing again with [`board.jobAlerts.subscribe`](#boardjobalertssubscribe) emails the address a fresh confirmation link, at most once every 12 hours and never while it is suppressed or when the board's team unsubscribed the address; clicking it resumes the alerts. A manage link with [`board.jobAlerts.resubscribe`](#boardjobalertsresubscribe) resumes them too. Repeating a successful confirmation is safe and yields `already_confirmed`.

Malformed requests can return 400 and rate limiting can return 429. The route is anonymous and open through the board password wall. Do not treat an expired or unknown token status as a transport exception.

Related method: [`board.jobAlerts.resendConfirmation`](#boardjobalertsresendconfirmation).

## `board.jobAlerts.resendConfirmation`

Request another double-opt-in email for an unconfirmed subscription.

```ts no-check
board.jobAlerts.resendConfirmation(
  input: { email: string },
  options?: FetchOptions,
): Promise<JobAlertResendResult>
```

```ts
const resend = await board.jobAlerts.resendConfirmation({
  email: 'reader@example.com',
});

console.log(resend.status);
```

The result is `{ object: 'job_alert_confirmation_resend', status }`, where `status` is always `submitted`. The response is intentionally uniform — it never reveals whether the email is subscribed, already confirmed, or throttled, so it can't be used to enumerate subscribers. If a pending confirmation exists for the email, another confirmation email is sent (subject to the server-side throttle), unless the address is suppressed. Always returns HTTP 200.

The server throttles resends per subscription and per IP; the throttle still applies even though the response never surfaces it. The outer API limiter can also return 429. Never automatically retry email delivery; require a user-triggered retry after waiting.

Related methods: [`board.jobAlerts.subscribe`](#boardjobalertssubscribe) and [`board.jobAlerts.confirm`](#boardjobalertsconfirm).

## `board.jobAlerts.manage`

Load one subscription and its preferences with the subscription-wide HMAC manage token from an alert email.

```ts no-check
board.jobAlerts.manage(
  query: JobAlertManageQuery,
  options?: FetchOptions,
): Promise<JobAlertManageState>
```

`JobAlertManageQuery` requires `subscription` and `token`. Both are sent in the query string, so remove sensitive query data from logs and referrers.

```ts
const state = await board.jobAlerts.manage({
  subscription: subscriptionId,
  token: manageToken,
});

console.log(state.email, state.confirmed, state.unsubscribed);

for (const preference of state.preferences) {
  console.log(preference.id, preference.frequency, preference.isActive);
}
```

`JobAlertManageState` contains `email`, `confirmed`, `unsubscribed`, and `preferences`. Each preference includes its ID, label, frequency, active state, stored filters (including `query` when set), and a new preference-bound `manageToken` for update/delete calls. It also carries the read-only `kind` (`'similar_job'`, `'search'` or `'filters'`) and `anchorJob`: for a similar-job alert, the job it was subscribed from as `{ id, slug, title }`, otherwise `null`. An older search preference can report `kind: 'search'` with no `filters.query`; its keyword is the single `jobFunctions` entry, so show the job functions in that case.

An invalid or mismatched subscription token returns 403. A missing board/subscription returns `job_alert_not_found` with status 404. Retrying this GET once after a transient network failure is safe. Do not cache the result.

Related methods: [`board.jobAlerts.updatePreference`](#boardjobalertsupdatepreference), [`board.jobAlerts.unsubscribe`](#boardjobalertsunsubscribe), and [`board.jobAlerts.deletePreference`](#boardjobalertsdeletepreference).

## `board.jobAlerts.unsubscribe`

Deactivate an entire subscription or one preference with a matching manage token. Call it when the subscriber taps an Unsubscribe button, never when a digest link's page loads: mail scanners and link checkers open every link in a message.

```ts no-check
board.jobAlerts.unsubscribe(
  input: JobAlertUnsubscribeInput,
  options?: FetchOptions,
): Promise<JobAlertManageResult>
```

`JobAlertUnsubscribeInput` requires `subscriptionId` and `token`; `preferenceId` is optional. Omit `preferenceId` when using the subscription-wide token. Include it with the preference-bound token returned by `manage` when targeting one preference.

The optional `alertId` and `emailId` say which digest the subscriber unsubscribed from, so the board's job alert engagement can attribute the unsubscribe to that email. Digest manage and unsubscribe links carry them as `ja_alert` and `ja_email`; `parseJobAlertUnsubscribeParams` reads both from the page URL, or returns `null` for a link that has neither. Send both or neither. They are recorded only when the alert belongs to the subscriber and the subscriber was still subscribed, and the unsubscribe behaves the same with or without them.

```ts
import { parseJobAlertUnsubscribeParams } from '@cavuno/board';

const result = await board.jobAlerts.unsubscribe({
  subscriptionId,
  token: manageToken,
  ...parseJobAlertUnsubscribeParams(pageUrl),
});

console.log(result.success);
```

The result is `{ object: 'job_alert_manage_result', success: true }`. Invalid/mismatched tokens return 403, missing subscriptions/preferences return `job_alert_not_found` with status 404, malformed inputs return 400, and throttling returns 429.

After an unknown response, reload `manage` before retrying so the UI reflects the actual state. Do not assume a write failed because the response was lost.

Related methods: [`board.jobAlerts.resubscribe`](#boardjobalertsresubscribe) and [`board.jobAlerts.manage`](#boardjobalertsmanage).

## `board.jobAlerts.resubscribe`

Reactivate a previously unsubscribed subscription or preference with its manage token.

```ts no-check
board.jobAlerts.resubscribe(
  input: JobAlertManageTokenInput,
  options?: FetchOptions,
): Promise<JobAlertResubscribeResult>
```

```ts
const result = await board.jobAlerts.resubscribe({
  subscriptionId,
  token: manageToken,
});

if (result.status === 'confirmation_sent') {
  // Tell the person to check their inbox; alerts stay off until they click.
}
```

The input matches `unsubscribe`. The response is `{ object: 'job_alert_manage_result', success, status }`. `status` is `resubscribed` when the subscription is resumed (its alerts start again, or wait for a spot when the board can't send to more people yet; an alert still waiting for its confirmation link is emailed a fresh one when possible and starts once it's clicked), or `confirmation_sent` when the address never confirmed: a confirmation email went out, and the alerts start once the person clicks its link. Invalid/mismatched tokens return 403, missing subscriptions/preferences return `job_alert_not_found` with status 404, and invalid inputs return 400. A 429 means rate limiting, or, for an address that never confirmed, a confirmation email requested in the last two minutes; nothing new is sent, and `Retry-After` says when to try again. A 409 (`job_alert_email_suppressed`) means the address never confirmed and can't receive email (a hard bounce or spam report), so nothing was sent; keep the alerts shown as off and don't retry. A 502 (`job_alert_confirmation_send_failed`) means the confirmation email could not be sent.

After an unknown response, reload `manage` before retrying. A resubscribe never bypasses double opt-in: an address that never confirmed resumes only through the emailed link.

Related methods: [`board.jobAlerts.unsubscribe`](#boardjobalertsunsubscribe) and [`board.jobAlerts.manage`](#boardjobalertsmanage).

## `board.jobAlerts.recordClick`

Record a visitor opening a job from a job alert digest email.

```ts no-check
board.jobAlerts.recordClick(
  input: JobAlertClickInput,
  options?: FetchOptions,
): Promise<JobAlertClickReceipt>
```

Every job link in a digest carries `ja_alert`, `ja_email`, `ja_pos` and `ja_mv`. `parseJobAlertClickParams` reads them from the job page URL as `{ alertId, emailId, position, matcherVersion }`, or returns `null` when any is missing or malformed. Call `recordClick` once per job page load that returns a value, with the job's `id`. Recorded clicks appear in the board's job alert engagement next to the digest's deliveries.

`JobAlertClickInput` contains:

| Field | Type | Behavior |
| --- | --- | --- |
| `alertId` | `string` | The link's `ja_alert`. |
| `emailId` | `string` | The link's `ja_email`, 16 lowercase hex characters. |
| `jobId` | `string` | The `id` of the job the visitor landed on. |
| `position` | `number` | The link's `ja_pos`, the job's 1-based position in the digest (1 to 100). |
| `matcherVersion` | `string` | The link's `ja_mv`. |
| `userAgent` | `string` | Optional. The visitor's `User-Agent` header. Pass it when you call from your server. |

```ts
import { parseJobAlertClickParams } from '@cavuno/board';

const click = parseJobAlertClickParams(request.url);
if (click) {
  await board.jobAlerts
    .recordClick({
      ...click,
      jobId: job.id,
      userAgent: request.headers.get('user-agent') ?? undefined,
    })
    .catch(() => undefined);
}
```

The result is `{ object: 'job_alert_click', status: 'accepted' }` with status 202 for every well-formed body. The click is recorded after the response, and only when the alert and the job belong to the board and the user agent is a person's browser. A crawler, a link scanner, or a call with no user agent is accepted and not counted, and the receipt is the same either way.

Call it from the server on a full page load of the job page (`GET`), not on a prefetch, a `HEAD` request, or a client-side navigation back to the same page. When you call from your server, pass the visitor's `userAgent`: your server's own user agent identifies an HTTP library, so without it the click is not counted. The route is anonymous, open through the board password wall, and needs no board-user session.

A body that is not a digest link's params returns 400 (`validation_bad_request`), and the anonymous API limiter can return 429. Recording is analytics: never block the page on it, and never retry it.

Related method: [`board.jobAlerts.unsubscribe`](#boardjobalertsunsubscribe).

## `board.jobAlerts.updatePreference`

Replace one preference’s frequency and filters with a preference-bound manage token.

```ts no-check
board.jobAlerts.updatePreference(
  input: JobAlertUpdatePreferenceInput,
  options?: FetchOptions,
): Promise<JobAlertManageResult>
```

The input requires `subscriptionId`, `preferenceId`, the preference’s `token`, and `frequency: 'weekly'`. `filters` is optional, but the update is a full replacement: restate every filter you want to preserve. The one exception is `filters.query`: omitting it keeps the stored keywords while `jobFunctions` are unchanged, and `null` clears them. The preference keeps its `kind`; setting `filters.query` on a similar-job preference returns 400 (delete it and subscribe to a search alert instead).

```ts
const state = await board.jobAlerts.manage({
  subscription: subscriptionId,
  token: subscriptionToken,
});

const preference = state.preferences[0];

if (preference) {
  const result = await board.jobAlerts.updatePreference({
    subscriptionId,
    preferenceId: preference.id,
    token: preference.manageToken,
    frequency: 'weekly',
    filters: {
      jobFunctions: preference.filters.jobFunctions,
      seniorityLevels: preference.filters.seniorityLevels,
      remoteOptions: ['remote', 'hybrid'],
      salaryMin: preference.filters.salaryMin ?? undefined,
      salaryMax: preference.filters.salaryMax ?? undefined,
      salaryCurrency: preference.filters.salaryCurrency ?? undefined,
    },
  });

  console.log(result.success);
}
```

The result is `{ object: 'job_alert_manage_result', success: true }`. `manage` returns stored `placeIds`, while updates accept public `placeSlugs`; do not pass IDs as slugs. Resolve the user’s selected public places back to slugs before submitting.

An invalid/mismatched preference token returns 403. A missing subscription/preference returns `job_alert_not_found` with status 404. Invalid filters return 400 and throttling returns 429. After an unknown response, reload `manage` before retrying because the full replacement may already have succeeded.

Related methods: [`board.jobAlerts.manage`](#boardjobalertsmanage) and [`board.jobAlerts.deletePreference`](#boardjobalertsdeletepreference).

## `board.jobAlerts.deletePreference`

Delete one preference with its preference-bound manage token.

```ts no-check
board.jobAlerts.deletePreference(
  input: JobAlertDeletePreferenceInput,
  options?: FetchOptions,
): Promise<JobAlertManageResult>
```

`JobAlertDeletePreferenceInput` requires `subscriptionId`, `preferenceId`, and `token`.

```ts
const result = await board.jobAlerts.deletePreference({
  subscriptionId,
  preferenceId,
  token: preferenceManageToken,
});

console.log(result.success);
```

The result is `{ object: 'job_alert_manage_result', success: true }`. Invalid/mismatched tokens return 403, missing subscriptions/preferences return `job_alert_not_found` with status 404, malformed input returns 400, and throttling returns 429.

After an unknown response, reload `manage` before retrying so the UI reflects the actual preference list.

Related methods: [`board.jobAlerts.manage`](#boardjobalertsmanage) and [`board.jobAlerts.subscribe`](#boardjobalertssubscribe).
