Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[API Update] Native REST E911 — address validation + phone-number assign/status/remove #506

Copy link
Copy link

Description

@glanotte
Issue body actions

references https://github.com/signalwire/cloud-product/issues/19835 and https://github.com/signalwire/cloud-product/issues/20062

Summary

E911 comes to the native REST API (/api/relay/rest, signalwire-rest/relay-rest/), native-shaped (not a Twilio clone — that's the compat/LaML track). Two pieces:

  • Addresses gain carrier E911 validation + full CRUD (Slice A, prime-rails#9565, merged).
  • Phone numbers gain per-number E911 assign / status / remove (Slice B, prime-rails#9575, in review).

Note

TypeSpec/OpenAPI drafted in docs PR #505. Slice A is merged in prime-rails; Slice B is in review — not yet deployed.

Authentication & scope

  • Auth: HTTP Basic — Project ID (username) + API token (password).
  • Required scope: numbers.
  • Base URL: https://<your-space>.signalwire.com/api/relay/rest

Endpoints

Method Path Description
POST /addresses Create an address; emergency_enabled=true (US) validates at the carrier.
POST /addresses/{id} (PUT) New — update an address (same validation gating).
GET /addresses / /addresses/{id} List / fetch (now include E911 fields).
DELETE /addresses/{id} Delete.
POST /phone_numbers/{id}/e911_address New — assign a validated address → provision.
DELETE /phone_numbers/{id}/e911_address New — remove (active-only) → deprovision.
GET /phone_numbers/{id} Now includes e911_status.

Behavior & limitations

  • Address validation is parameter-gated. It runs only when emergency_enabled=true AND country=US. Otherwise the address is stored without carrier validation. auto_correct_address (default true) stores a carrier correction; false rejects with the correction returned as candidates.
  • Validation failure → 422 with an errors array and, when the carrier returns near-matches, a candidates array (each: street_number, street_name, city, state, postal_code).
  • Assigning an address to a number is asynchronous. e911_status goes pending; a background job flips it to active only once the carrier confirms — never trusted from the order response or a billing flag (safety requirement).
  • Removal is active-only and asynchronous: e911_status goes pending_removal; the address stays associated until the carrier confirms teardown.

Fields

Address (response)

Field Type Notes
emergency_enabled boolean E911 enabled for this address.
validated boolean Carrier returned a valid / auto-corrected match.
validated_at string | null ISO 8601 of the last successful validation.

Address (writable, create + update)

Field Type Notes
emergency_enabled boolean Gate carrier validation (US only).
auto_correct_address boolean Default true; store correction vs. return candidates.

Phone number (response)

Field Type Notes
e911_status string | null pending/active/failed/pending_removal/unregistered.

Assign request

Field Type Notes
e911_address_id uuid A validated address in the same project.

Error codes to document

Native REST error shape ({ errors: [...] } via the standard validation error). E911-specific: address not in project / not validatable → 422; assign to unsupported provider or toll-free → 422; remove while not active422.

OpenAPI

See docs PR #505 (referenced, not pasted inline, to avoid drift).

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.