{{ message }}
Repository navigation
IMX-3049: Switch domain check to POST /v4/domains/:domain/verify - #1
Open
scorpiofighter wants to merge 3 commits into
Open
scorpiofighter wants to merge 3 commits into
scorpiofighter wants to merge 3 commits into
Conversation
The v3 check endpoint is the last v3-only call we still make from our own code. Move it to the v4 verify endpoint the web app already uses. This also fixes the plain-text output, which read valid/mx/spf from the top level of the response even though they have always been nested under "records" — so it printed MISSING for every domain, however well configured. Only --json was correct, because it prints the body without decoding. The rest of the CLI stays on v3; only this endpoint has moved.
v3 returns {"error": "..."} on a failure, v4 returns {"message": "..."}.
The client only knew the v3 shape, so the new verify call printed the whole
JSON body instead of the sentence in it:
API error (404): {"errors":{},"message":"Not found."}
Now both shapes print as "API error (404): Not found.".
m-tse
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The CLI is the last piece of our own code still calling the old v3 DNS-check endpoint. The web app already moved to the newer v4 one, so this moves the
improvmx domain checkcommand over too.Only this one command moves — every other CLI command stays on v3, because they call different endpoints that aren't being retired.
Merge order: 2 of 2 — merge #2 first. #2 fixes this same command's display bug on v3. This PR redoes that same reading-code fix and switches to v4, so the two diffs overlap on
cmd/domain.go. Once #2 is merged, that overlap drops out and only the v4 switch is left here.Two things worth knowing:
--jsonloses one key: the top-levelsuccess: true. Everything insiderecords(DKIM, DMARC, DNS-provider details) is unchanged, since both endpoints build it from the same server code. That output isn't documented anywhere and the CLI is still v0.1.0.Changes
cmd/domain.go—domain checknow calls the v4 verify endpoint and reads the result from insiderecords.internal/api/client.go— added a v4 base URL alongside the v3 one and aPostV4helper, so this one command can use v4 while the rest of the CLI stays on v3. The request builder now takes a full URL instead of a path.internal/api/client.go— on a failed request, also read the v4messagefield (v3 puts the error inerror, v4 inmessage). Without it the new call printed the raw JSON instead of the sentence inside it —API error (404): {"errors":{},"message":"Not found."}now readsAPI error (404): Not found.While editing that block I also dropped two fields it parsed but never used.Caveats
/check, but the route stays live. It's a public, documented endpoint, so actually retiring it is a separate api-side decision — gated on confirming external customers no longer call it — not a follow-up to this PR.Testing
Ran the built CLI against production with a real API key.
relai.co.za) reportsOK; an unconfigured one reportsMISSING./verify, and only v4 answers that:POST /v3/…/verify→ 404,POST /v4/…/verify→ 200 with the records. The originalGET /v3/…/checkstill returns 200 too — it's untouched and stays live.{"error": "Not found.", "success": false}and v4 returns{"errors": {}, "message": "Not found."}— which is why the client now readsmessageand drops the two unused fields.--jsonoutput matches hitting the endpoint directly.domain list,domain get,alias list,accountandsmtp list— the v3 commands still work.No automated tests — this repo has none.