Skip to content

Document the 63-character domain limit for domain applications and SIP addresses - #991

Open
Devon-White wants to merge 2 commits into
mainfrom
devon/rest/domain-63-char-limit
Open

Devon-White wants to merge 2 commits into
mainfrom
devon/rest/domain-63-char-limit

Conversation

@Devon-White

Copy link
Copy Markdown
Collaborator

Summary

A domain application's domain, and the domain a Fabric SIP address gets from its Domain, must fit in 63 characters. The API rejects a longer domain with a 422, unless a domain application in the same Space already uses that domain. This PR documents that limit.

  • Domain applications (POST /api/relay/rest/domain_applications, PUT /api/relay/rest/domain_applications/{id}): identifier now has maxLength: 50 and explains the 63-character domain limit (Space name, separator, identifier). On update, the check runs only when identifier changes. Both operations now use a DomainApplicationStatusCode422 response with the Identifier makes the domain longer than 63 characters example, following the PhoneNumberSearchStatusCode422 pattern.
  • SIP addresses (create and update): context_id explains the domain the Domain's name produces (public/private for the built-in Domains), the 63-character limit, and the domain_too_long and domain_not_available codes.
  • Error codes page: adds domain_not_available and domain_too_long in alphabetical order.
  • Regenerated fern/apis/signalwire-rest/openapi.yaml with yarn build:specs.

Verification

Checked against the API source:

  • Identifier validation: required, at most 50 characters. The domain check returns makes the domain longer than 63 characters on identifier. The update contract inherits the create contract, and the domain is rebuilt only when identifier changes.
  • The domain-length check fails only when the domain is longer than 63 characters and no domain application in the same Space already has that domain.
  • Domain construction: <subdomain>-<name>, or <subdomain>--<name> in Spaces using the double-hyphen separator. Built-in read-only Domains contribute public or private. Other Domains contribute their name in lowercase.
  • Relay REST 422 body: detail is the full message, status and code are "422", and title is Invalid Attribute.
  • SIP address errors: domain_too_long ("Domain is longer than 63 characters.") and domain_not_available ("Domain is not available.", returned when a domain application in another Space already uses the domain), both on context_id.
  • yarn build:specs: passes. yarn fern-md-check: passes.

Notes for reviewers

  • Merge timing: the API change deploys 2026-11-23. Merge this on or after that date.
  • Error-code enums: the API's own Fabric OpenAPI lists domain_too_long in the SIP address 422 error-code enums. This spec doesn't model a code enum for those 422s (SipAddressCreateStatusCode422 and SipAddressUpdateStatusCode422 are a generic StatusCode422 with one example), so there was no enum to extend. The codes are documented in the context_id description and on the error codes page instead.
  • Routes: the SIP address create and update operations are served at both /api/fabric/addresses/sip and the older alias /api/fabric/sip_addresses, with the same validation. This spec documents only /api/fabric/sip_addresses, and update only as PATCH, although PUT is also routed. I left that unchanged because it is out of scope.
  • domain_not_available on domain applications: this check also runs on domain applications. There, Relay REST returns Identifier is not available with code "422", not a named code, so the error codes page entry describes the SIP address case.
  • Not documented: in the dashboard, renaming a Domain that has SIP addresses also enforces the limit. Fabric Domains have no public REST endpoint in this spec, so nothing changes here.
  • Pre-existing example bug: the domain application response's domain example, your-space-test_id, contains an underscore, which identifier doesn't allow. Left as is.
  • Possible conflict with Correct REST token scope requirements and callout Markdown export #985: Correct REST token scope requirements and callout Markdown export #985 edits the permission lines in these main.tsp files. This PR doesn't touch those lines. If openapi.yaml conflicts, rerun yarn build:specs instead of merging the file by hand.

Preview

…P addresses

- identifier (domain application create/update): maxLength 50, the
  63-character domain limit, and a 422 example for it
- context_id (SIP address create/update): the domain the Domain's name
  produces, domain_too_long and domain_not_available
- Error codes page: add domain_not_available and domain_too_long
@Devon-White Devon-White self-assigned this Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

@Manny-r31

Copy link
Copy Markdown
Collaborator

Nice work, Devon. The core facts check out against the source code, and the generated diff matches the .tsp changes. A few accuracy gaps on the domain application side and some wording on the SIP side need fixing before merge.

What I verified as correct: the 63-character domain limit, the 50-character identifier limit, the exemption when your Space already uses the domain, the domain being rebuilt only when identifier changes, domain_too_long and domain_not_available on context_id for SIP address create and update with those messages, public and private for the built-in Domains, and the Relay REST 422 body in the new example. The openapi.yaml diff has nothing the .tsp edits don't explain, and the branch is current with main.

Technical

1. The identifier math is wrong in two-hyphen Spaces. specs/signalwire-rest/relay-rest/domain-applications/models/requests.tsp lines 14 and 129 say "63 minus the Space name and the hyphen." In Spaces that use two hyphens, the limit is 63 minus the Space name minus 2. The reader also has no way to tell which kind of Space they're in. Suggested fix:

With a long Space name, the identifier's limit drops below 50, to 63 minus the length of your Space name and separator. The domain field in the response shows the full domain your Space builds.

2. Allowed identifier characters aren't documented. The API accepts letters, digits, and hyphens only. The identifier must start and end with a letter or digit and can't contain two hyphens in a row. Anything else returns a 422. Please add @pattern("^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$") next to @maxLength(50) on both models, plus one sentence of prose. While you're there, consider fixing the your-space-test_id response example you flagged. It's a one-line change and the new pattern makes the underscore look even more wrong.

3. The cross-Space conflict for domain applications is missing. The SIP address docs cover domain_not_available, but the identifier docs don't. When another Space already uses the domain, create and update return a 422 with detail Identifier is not available. Add a sentence to both identifier descriptions so the two resources match.

4. Scope the new error-code entries to SIP addresses. fern/products/apis/pages/core/error-codes.mdx lines 334 to 342 describe codes that only the SIP address endpoints return. Domain application endpoints report the same conditions with code "422". Name the endpoints, like already_a_member does:

Returned on context_id by POST /api/fabric/sip_addresses and PATCH /api/fabric/sip_addresses/{id}.

Related and pre-existing: line 58 says Relay REST's "code field still maps to the reference below." For these endpoints code is the status string "422", so that line is wrong. A follow-up fix would help, since this PR is the first to document a case where the two shapes report the same condition differently.

5. Worth adding to the update identifier description. When you change identifier, the API rebuilds the domain with your Space's current separator. A domain that used one hyphen can end up with two. Customers will see this in the returned domain, so one sentence saves a support ticket.

Style

6. "Domain" and "domain" share one sentence. specs/signalwire-rest/fabric-api/sip-addresses/models/requests.tsp lines 21 and 79, and the domain_too_long entry in error-codes.mdx, use "Domain" for the grouping object and "domain" for the built hostname label in the same sentence. Readers will mix them up. Call the built value "the address's SIP domain" every time it appears.

7. "the error below" in the 422 description. specs/signalwire-rest/relay-rest/domain-applications/models/errors.tsp line 8. The example doesn't render below the description in every layout, so the pointer is fragile. Following PhoneNumberSearchStatusCode422 more closely would work better. List the identifier failures as bullets: too long for the domain, invalid characters, not available, and already used with the same user.

The added text is otherwise clean: no em dashes, banned terms, or internal details.

- Domain applications: add the identifier character rule (@pattern plus
  prose), describe the separator generically, document the cross-Space
  "Identifier is not available" 422, and note that changing identifier
  rebuilds the domain and can change its separator.
- List the identifier failures in DomainApplicationStatusCode422.
- Fix the domain example (your-space-test-id).
- SIP addresses: call the built hostname "the address's SIP domain".
- Error codes page: scope domain_not_available and domain_too_long to the
  SIP address endpoints, and correct the Relay REST note: there, code
  repeats the HTTP status.
- Regenerate openapi.yaml.
@Devon-White

Copy link
Copy Markdown
Collaborator Author

Addressed at 3ce5c05.

  • Two-hyphen Spaces: applied your wording on both identifier descriptions, including the pointer to the response domain field.
  • Identifier characters: added @pattern("^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$") and a sentence on both models. Matches the API's format and double-hyphen checks. Fixed the domain example to your-space-test-id.
  • Cross-Space conflict: both identifier descriptions now cover the 422 with detail Identifier is not available.
  • Error-code scope: domain_not_available and domain_too_long now name the SIP address create and update endpoints. Also fixed the Relay REST note: in that shape code repeats the HTTP status, so readers should use detail. Campaign Registry endpoints use the standard shape and keep named codes.
  • Separator on update: added. Worded as "can come back with two" because a one-hyphen domain already in use in the Space keeps its one hyphen.
  • SIP domain naming: "the address's SIP domain" throughout the context_id descriptions and both error-code entries.
  • 422 description: replaced "the error below" with a bulleted list of identifier failures, following PhoneNumberSearchStatusCode422.

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.

2 participants