Skip to content

docs(rest): add the CNAM (caller ID name) API for phone numbers - #638

Merged
Devon-White merged 9 commits into
mainfrom
Devon/cnam-api
Aug 31, 2026
Merged

docs(rest): add the CNAM (caller ID name) API for phone numbers#638
Devon-White merged 9 commits into
mainfrom
Devon/cnam-api

Conversation

@Devon-White

Copy link
Copy Markdown
Collaborator

Summary

  • Add REST reference operations to retrieve, request, and clear caller ID name (CNAM) for project-owned phone numbers.
  • Document the request lifecycle, normalization rules, review statuses, reason codes, validation responses, and asynchronous updates.
  • Add the currently applied cnam value to phone number responses.
  • Update the caller ID and spam-label guides with Dashboard and REST API self-service instructions.
  • Keep the new operations in the existing Phone Numbers package and navigation.

Validation

  • yarn build:specs
  • yarn fern-md-check — all 2,823 MDX files valid
  • git diff --check
  • yarn fern-check --warnings — known pre-existing environmental findings reproduced on main

Closes #634

Adds the three caller ID name operations on a phone number, following the
existing /{id}/e911_address sub-resource pattern so they file under the
Phone Numbers tag with no nav change:

  GET    /api/relay/rest/phone_numbers/{id}/cnam
  POST   /api/relay/rest/phone_numbers/{id}/cnam
  DELETE /api/relay/rest/phone_numbers/{id}/cnam

Also adds the `cnam` attribute to the phone number model, which the
serializer already returns but the spec omitted. It is the name live at
the carrier, as distinct from the requested name a CNAM request carries.

Verified against prime-rails: the controller, serializer, contracts,
operations, CnamRequest model, the four Job::Cnam jobs, and the request
spec. Three departures from the shape proposed in the issue:

- No maxLength/pattern on the POST body `name`. Validation runs on the
  normalized form (control chars stripped, whitespace squished,
  upper-cased), so a 19-character lowercase input can be valid and those
  constraints would reject it. The rules are described in prose instead.
  The response-side `name` and `cnam` do carry maxLength 15, matching
  their string(15) columns.
- `reason` is nullable in every status, not only pending and approved.
  Job::Cnam::Process holds an unverified account for review, and rejects
  a suspended one, before review assigns any reason.
- 401 and 404 reuse the shared Types.StatusCodes models rather than
  declaring text/plain bodies. The real bodies are plain text, but that
  mismatch is repo-wide and a CNAM-only divergence would read as drift.

POST does not always return `pending`: Cnam::RequestReview reuses an
already-approved row for the same name on the same number without
resetting it, so that case returns 201 with status still `approved` and
re-applies at the carrier without re-review. Documented as the exception,
along with rejected/failed returning to `pending` on re-request.

The 13 reason codes are documented as a table on the `reason` field:
per-member enum @doc does not survive emission, so that is the only place
a reader sees what each code means.

Two guides said CNAM could only be set by opening a support ticket, which
the API and the dashboard's Caller ID Name field supersede. Both now
point at the self-serve routes and keep the ticket as the fallback for
numbers whose carrier does not offer CNAM.

Closes #634
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

@hey-august
hey-august self-requested a review August 27, 2026 19:24

@hey-august hey-august left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, comments addressed. Approving!

@Devon-White
Devon-White merged commit 8086846 into main Aug 31, 2026
2 checks passed
@Devon-White
Devon-White deleted the Devon/cnam-api branch August 31, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CNAM to REST APIs

2 participants