# Account, type and requests

> Account type, preferences, the meteorologist and EOC request flows with work email confirmation, and personal placefile keys.

API reference · Reference · https://wxalerts.org/docs/api/account/

Base URL: `https://api.wxalerts.org`

What kind of account this is, the person's preferences, the request forms for a
[meteorologist](/docs/accounts/meteorologist/) or [EOC](/docs/accounts/eoc/)
account, and the personal keys a meteorologist uses for the full
[spotter placefile](/docs/spotter-reports/placefile/).

Every route here takes a signed-in account, from the browser session or the
phone's Bearer token. Routes that change state need the `X-Requested-With:
wxalerts` header on a cookie request and not on a Bearer one. The shared rules
and the errors every route can return are in
[Sessions, Bearer and CSRF](/docs/api/sign-in/#sessions-bearer-and-csrf). An API
key is never accepted here.

## `GET /account/type`

What the account is and what it may do next. Session or Bearer. This is the
route a Bearer client uses to learn its numeric `id`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | the account's numeric id, the `<user id>` in [MQTT V2 topics](/docs/developers/mqtt/alerts/) |
| `type` | string | the highest type that applies, in order `meteorologist`, `eoc`, `spotter`, `personal` |
| `spotter_current` | boolean | a current spotter credential. It is worked out on every call and lapses on its expiry day |
| `meteorologist` | boolean | a live meteorologist grant |
| `meteorologist_offer` | boolean | the account's own verified email qualifies for an automatic grant and none has been made: ask "Are you registering as a meteorologist?" and call [`POST /account/meteorologist/verify-email`](#post-accountmeteorologistverify-email) on a yes |
| `meteorologist_label` | string or null | how the meteorologist's remarks are signed |
| `open_request_status` | string or null | status of the open meteorologist request: `draft`, `pending`, `needs_info`. `null` when none is open |
| `eoc` | boolean | a live EOC grant |
| `eoc_org_name` | string or null | the EOC organization, while the grant is live |
| `can_file` | boolean | same as `spotter_current`: may file a self report |
| `can_relay` | boolean | a live EOC grant on an organization that may relay reports |
| `open_eoc_request_status` | string or null | status of the open EOC request |

One account can hold several types, so read the flags, not only `type`.

```json
{
  "id": 12345, "type": "spotter", "spotter_current": true,
  "meteorologist": false, "meteorologist_offer": false, "meteorologist_label": null,
  "open_request_status": null, "eoc": false, "eoc_org_name": null,
  "can_file": true, "can_relay": false, "open_eoc_request_status": null
}
```

## `GET /account/preferences`

The account's preferences. Session or Bearer.

| Field | Type | Description |
| --- | --- | --- |
| `units` | string or null | `metric` or `us`. `null` until the person chooses; the client then picks from the browser locale and stores nothing |

```json
{ "units": "us" }
```

## `PATCH /account/preferences`

Changes preferences. Session or Bearer. The row is always the caller's own.
Fields you leave out are unchanged. Sending `null` clears a preference.

| Field | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `units` | string or null | no | `metric`, `us`, or `null` |

Any other field is refused (`extra` fields are forbidden). Response `200` is the
`Preferences` object above.

| Status | When |
| --- | --- |
| `422` | an unknown field or a value other than `metric`, `us` or `null`. Default list format, `type` is `extra_forbidden` or `literal_error` |

## `POST /account/meteorologist/verify-email`

Sends a link to confirm a work address. Session or Bearer. When the address is on
the automatic list (noaa.gov, or an exact match on the research list),
confirming the link grants the meteorologist type on its own. Otherwise it only
marks the address verified on the open request.

Body:

| Field | Type | Required | Bounds |
| --- | --- | --- | --- |
| `email` | string | yes | 3 to 320 characters, and it must look like an email address |

Response `200`:

| Field | Type | Description |
| --- | --- | --- |
| `sent_to` | string | the normalised address the link went to |
| `expires_at` | string | when the link stops working. Links last 48 hours and work once |
| `auto_grant` | boolean | confirming will grant the meteorologist type without review |

```json
{ "sent_to": "forecaster@example.noaa.gov", "expires_at": "2026-11-25T17:04:05Z", "auto_grant": true }
```

| Status | Body | When |
| --- | --- | --- |
| `409` | `{"detail": {"code": "already_meteorologist", "message": "..."}}` | the account is already a meteorologist |
| `422` | `{"detail": {"code": "bad_email", "message": "That does not look like an email address."}}` | not a plausible address. This is the one 422 on this route with an object body; a missing or too long `email` gives the default list |
| `429` | `{"detail": {"code": "too_many_links", "message": "..."}}` | 5 links in a day |
| `502` | `{"detail": {"code": "email_refused", "message": "..."}}` | the mail service refused the address |
| `503` | `{"detail": {"code": "email_unavailable", "message": "..."}}` | email is not available right now |

## `POST /account/eoc/verify-email`

The EOC form's version of the route above. The link it sends only marks the
address verified on the EOC request. It never grants anything, so `auto_grant`
is always `false`. Same body, response and errors, except `409 already_meteorologist`
does not apply.

## `GET /account/meteorologist/verify`

The link in the confirmation email points here. Open it in a browser signed in to
the same WxAlerts account that asked for it. Anonymous or signed in, never a
JSON error: every outcome is a `303` back to the site.

| Name | In | Type | Default | Bounds |
| --- | --- | --- | --- | --- |
| `token` | query | string | `""` | at most 128 characters |

The redirect goes to `https://wxalerts.org/account/?verified=1#profile` on success
and `?verified=0&reason=<reason>#profile` on failure. `reason` is `sign_in` when
nobody was signed in (the token is left unused, so the person can sign in and
open the same link again) or another short code for a bad, expired, used or
wrong-account link. A link made by `/account/eoc/verify-email` also works here,
because the link remembers what it was for.

## `GET /account/eoc/verify`

The same confirmation for EOC links. The redirect adds `&purpose=eoc` so the
page opens the EOC form. Same `token` parameter and outcomes.

## `GET /account/meteorologist/request`

The meteorologist request form: the open request, or else the most recent
closed one so a "needs info" or denial note stays readable. Session or Bearer.

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | request id |
| `status` | string | `draft`, `pending`, `needs_info`, `approved`, `denied` or `withdrawn` |
| `agency` | string or null | employer. At most 200 characters |
| `job_title` | string or null | at most 120 |
| `work_email` | string or null | at most 320, stored lower case |
| `work_phone` | string or null | at most 32 |
| `directory_url` | string or null | a staff directory page that lists the person. An `http` or `https` URL |
| `office_kind` | string or null | `nws`, `broadcast` or `other` |
| `office_id` | string or null | at most 12 characters, stored upper case, such as an NWS office id |
| `market` | string or null | at most 120 |
| `ams_cert_no` | string or null | at most 32 |
| `nwa_seal_no` | string or null | at most 32 |
| `supervisor_name` | string or null | at most 160 |
| `attest` | boolean | the person attested that the details are true |
| `work_email_verified` | boolean | the work address has been confirmed by link |
| `submitted_at` | string or null | when it was sent for review |
| `decided_at` | string or null | when a decision was made |
| `decision_note` | string or null | the reviewer's note, shown on `needs_info` and `denied` |

```json
{
  "id": 88, "status": "needs_info", "agency": "KXYZ-TV", "job_title": "Chief Meteorologist",
  "work_email": "pat@kxyz.example", "work_phone": "+15555550100",
  "directory_url": "https://kxyz.example/team/pat", "office_kind": "broadcast", "office_id": "KXYZ",
  "market": "Springfield", "ams_cert_no": null, "nwa_seal_no": null, "supervisor_name": null,
  "attest": true, "work_email_verified": true,
  "submitted_at": "2026-11-20T15:00:00Z", "decided_at": "2026-11-21T09:30:00Z",
  "decision_note": "Please add a directory page that lists you."
}
```

| Status | Body | When |
| --- | --- | --- |
| `404` | `{"detail": "No request."}` | the account has never made one |

## `PUT /account/meteorologist/request`

Creates the draft or saves over it. Session or Bearer. Every field is optional while it
is a draft. It is editable as a draft and on `needs_info`; a `pending` request
is with a reviewer and has to be withdrawn first. Changing the work email
clears its verification unless this account has already confirmed a link to the
new address. A blank string is saved as absent.

Body: the same fields as the response above, without `id`, `status`,
`work_email_verified`, `submitted_at`, `decided_at` and `decision_note`.

| Field | Type | Default | Bounds |
| --- | --- | --- | --- |
| `agency` | string or null | `null` | 200 |
| `job_title` | string or null | `null` | 120 |
| `work_email` | string or null | `null` | 320 |
| `work_phone` | string or null | `null` | 32 |
| `directory_url` | URL or null | `null` | valid `http` or `https` URL |
| `office_kind` | string or null | `null` | `nws`, `broadcast`, `other` |
| `office_id` | string or null | `null` | 12 |
| `market` | string or null | `null` | 120 |
| `ams_cert_no` | string or null | `null` | 32 |
| `nwa_seal_no` | string or null | `null` | 32 |
| `supervisor_name` | string or null | `null` | 160 |
| `attest` | boolean | `false` | `false` removes a previous attestation |

Response `200` is the request, as above.

| Status | Body | When |
| --- | --- | --- |
| `409` | `{"detail": {"code": "already_meteorologist", "message": "..."}}` | the account is already a meteorologist |
| `409` | `{"detail": {"code": "request_pending", "message": "Your request is with an admin. Withdraw it to make changes."}}` | the request is `pending` |
| `422` | default list | a value is too long or not a URL or not an allowed `office_kind` |

## `POST /account/meteorologist/request/submit`

Sends the request for review. Session or Bearer. No body. Submitting a request that
is already `pending` returns it unchanged.

Response `200` is the request, now `pending`.

| Status | Body | When |
| --- | --- | --- |
| `404` | `{"detail": "No open request."}` | nothing to submit |
| `422` | `{"detail": {"code": "incomplete", "message": "Some of the form is still missing.", "missing": ["agency", "attest", "work_email_verified"]}}` | `missing` lists what is absent, in form order: `agency`, `job_title`, `work_phone`, `directory_url`, `office_kind`, `office_id`, then `attest`, then `work_email` or `work_email_verified` |

## `POST /account/meteorologist/request/withdraw`

Withdraws an open request (`draft`, `pending` or `needs_info`). Session or Bearer. No body.
Response `200` is the request with `status` `withdrawn`. `404`
`{"detail": "No open request."}` when none is open.

## `GET /account/eoc/request`

The EOC operator request form, with the same latest-open-or-closed rule.
Session or Bearer. Fields:

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | request id |
| `status` | string | as for the meteorologist request |
| `eoc_name` | string or null | the emergency operations center. At most 160 |
| `jurisdiction` | string or null | the county, city or tribal area it serves. At most 160 |
| `state` | string or null | two letters, stored upper case. Pattern `^([A-Za-z]{2})?$` |
| `agency_kind` | string or null | `county`, `city`, `tribal`, `state` or `other` |
| `job_title` | string or null | at most 120 |
| `work_email` | string or null | at most 320 |
| `work_phone` | string or null | at most 32 |
| `agency_website` | string or null | an `http` or `https` URL |
| `director_name` | string or null | at most 160 |
| `callsign` | string or null | amateur radio callsign for ARES and RACES operators, upper case, at most 12 |
| `attest` | boolean | attested |
| `work_email_verified` | boolean | work address confirmed by link |
| `submitted_at`, `decided_at` | string or null | timestamps |
| `decision_note` | string or null | reviewer note on `needs_info` and `denied` |

`404 {"detail": "No request."}` when none has ever been made.

## `PUT /account/eoc/request`

Creates or saves the EOC draft. Session or Bearer. Body fields are the editable ones
above (`eoc_name`, `jurisdiction`, `state`, `agency_kind`, `job_title`,
`work_email`, `work_phone`, `agency_website`, `director_name`, `callsign`,
`attest`), all optional, with the same bounds. Same editing rules as the
meteorologist form.

| Status | Body | When |
| --- | --- | --- |
| `409` | `{"detail": {"code": "already_eoc", "message": "You are already an EOC operator."}}` | already holds the type |
| `409` | `{"detail": {"code": "request_pending", "message": "..."}}` | request is `pending` |
| `422` | default list | for example `state` is not two letters |

## `POST /account/eoc/request/submit`

Sends the EOC request for review. Session or Bearer. No body. Returns the request as `pending`.
`404 {"detail": "No open request."}`, `409 already_eoc`, or `422` with
`{"code": "incomplete", "message": "...", "missing": [...]}` where `missing` is, in
order, any of `eoc_name`, `jurisdiction`, `state`, `agency_kind`, `job_title`,
`work_phone`, then `work_email` or `work_email_verified`, then `attest`. A request already
`pending` is returned unchanged.

## `POST /account/eoc/request/withdraw`

Withdraws the open EOC request. Session or Bearer. No body. Returns it with `status`
`withdrawn`. `404 {"detail": "No open request."}` when none is open. A `pending` or
`needs_info` or `draft` request can all be withdrawn.

## `GET /account/placefile-keys`

The caller's personal placefile keys, revoked ones included. Session or Bearer.
Meteorologist accounts only.

Response `200`: an array.

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | key id |
| `prefix` | string | the first characters of the key, for recognising it |
| `label` | string or null | the name given at creation |
| `created_at` | string | |
| `last_used_at` | string or null | |
| `revoked_at` | string or null | set once revoked |

```json
[ { "id": 7, "prefix": "wx_live_Ab12", "label": "GR2Analyst at home", "created_at": "2026-11-01T12:00:00Z", "last_used_at": "2026-11-22T20:11:00Z", "revoked_at": null } ]
```

| Status | Body | When |
| --- | --- | --- |
| `403` | `{"detail": {"code": "not_meteorologist", "message": "Personal placefile keys are for meteorologists."}}` | the account holds no live meteorologist grant |

## `POST /account/placefile-keys`

Makes a personal placefile key. Session or Bearer. Meteorologist accounts only. Answers
`201`. The response is the only time the clear key is shown. It is not stored,
so a lost key is revoked and replaced.

Body:

| Field | Type | Required | Bounds |
| --- | --- | --- | --- |
| `label` | string or null | no | at most 80 characters |

Response `201`: the list fields above, plus:

| Field | Type | Description |
| --- | --- | --- |
| `key` | string | the clear key, `wx_live_` followed by 43 characters |
| `placefile_url` | string | the ready to paste URL, `https://api.wxalerts.org/placefile/spotter-reports.txt?key=<key>`. Treat it as private |

| Status | Body | When |
| --- | --- | --- |
| `403` | `not_meteorologist`, as above | not a meteorologist |
| `409` | `{"detail": {"code": "too_many_keys", "message": "Revoke a key first: 10 is the most at once."}}` | 10 live keys already |

The key carries only the `placefile:read` scope. See
[Meteorologist placefile keys](/docs/spotter-reports/meteorologist-keys/).

## `DELETE /account/placefile-keys/{key_id}`

Revokes a key. Session or Bearer. Meteorologist accounts only. Answers `204` with no body.

| Name | In | Type | Bounds |
| --- | --- | --- | --- |
| `key_id` | path | integer | 1 to 9223372036854775807 |

| Status | Body | When |
| --- | --- | --- |
| `403` | `not_meteorologist` | not a meteorologist |
| `404` | `{"detail": "No such key."}` | not one of the caller's keys |
| `422` | default list | `key_id` is not an integer in range |
