docs(api/capture): fix invalid JSON and missing imports in code samples - #20011
Merged
Merged
Conversation
ioannisj
enabled auto-merge (squash)
September 16, 2026 10:13
ioannisj
approved these changes
Sep 16, 2026
ioannisj
left a comment
Contributor
There was a problem hiding this comment.
Thank you for this, just pushed a small indentation fix
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.
Changes
Two code samples on the capture API page fail when copied as published.
Group identify, curl. The JSON body is missing a comma after "subscription": "premium", so the body is not valid JSON and the capture endpoint rejects it. The Python sample in the same section already has the comma.
Single event, Python. The first Python sample calls requests.post and json.dumps with no imports, so it fails immediately with NameError. The Node sample beside it imports node-fetch, and the Python sample in the Group identify section already imports both json and requests. This one just missed them.
Both fixes make the samples consistent with the working examples elsewhere on the same page. One file, code blocks only, no prose changes.
Checklist
I've read the docs and/or content style guides.
Words are spelled using American English
Use relative URLs for internal links
I've checked the pages added or changed in the Vercel preview build
If I moved a page, I added a redirect in vercel.json
The preview box is unticked because the preview build is created when this PR opens. I will check the rendered page and tick it.
Checklist
vercel.json