docs(campaign-api): document website and web redirects on campaign PATCH [LIN-2805] - #213
Merged
Merged
Conversation
…TCH [LIN-2805] The Edit Campaign section listed only `name` and `active`, which matched what the endpoint actually did: it read those two fields off the body and dropped `website`, `android_web_redirect` and `ios_web_redirect` without an error. linkrunner-backend#1085 makes the endpoint accept all three. Documents the three fields, the clear-vs-leave-unchanged convention (empty string or null clears, omitting leaves the stored value), the `link_for_desktop_users` alias the Create endpoint uses for the same column, and the new 400s. Adds them to the success response and the JavaScript example. Also corrects the at-least-one-field 400 string, which quoted the dashboard's message rather than the one this endpoint returns. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PbTVbWroJs97joijZE1nQY
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.
Docs companion to linkrunner-backend#1085 · LIN-2805
Merge after the backend PR ships — it documents fields the endpoint does not accept until then.
Why
A customer reported that
PATCH /api/v1/campaigns/{display_id}returns 200 but silently discardswebsite,ios_web_redirectandandroid_web_redirect. That was accurate: the handler read onlynameandactiveoff the body. The Edit Campaign section documented only those two fields, so the docs were not wrong so much as documenting a gap — while the Create Campaign section above it accepts all three, which is what made the asymmetry easy to trip over.Changes
website,android_web_redirectandios_web_redirectto the request body example and parameter table.nullclears a field, omitting it leaves the stored value untouched. Added as its own example, since it is the part a caller cannot guess.websiteis the same column Create accepts aslink_for_desktop_users, that either spelling works on PATCH, and that sending both with different values is rejected.ios_web_redirect: ""to show a clear.Also corrected
The at-least-one-field 400 row quoted the dashboard's error string:
That message comes from
editCampaignSchema, which backs the session-authenticatedPUT /api/campaign— not this endpoint. Replaced with the string this route actually returns.Flagging, not fixing:
custom_channel_namesThis section documents
custom_channel_nameson the PATCH (added in #146, LIN-1956), but the public handler indata.tscontains no custom-channel handling at all —grep custom_channel src/controllers/data.tsreturns nothing on backendmain. As far as I can tell that parameter is not accepted, and the row describes the dashboard route, same as the error string above.I left it in place rather than deleting it, since I do not know whether it was documented ahead of a backend change that was intended to follow. Worth a decision from whoever owns LIN-1956 — if it genuinely is not supported, it should come out, and it is the same class of bug as the one this PR documents the fix for.
Verification
npm run check:routes— passes, 102 pages, no unredirected removals.🤖 Generated with Claude Code
https://claude.ai/code/session_01PbTVbWroJs97joijZE1nQY