Skip to content

docs(api/capture): fix invalid JSON and missing imports in code samples - #20011

Merged
ioannisj merged 2 commits into
PostHog:masterfrom
bookingminds:patch-4
Sep 16, 2026
Merged

ioannisj merged 2 commits into
PostHog:masterfrom
bookingminds:patch-4

Conversation

@bookingminds

Copy link
Copy Markdown
Contributor

Changes

Two code samples on the capture API page fail when copied as published.

  1. 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.

  2. 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

  • 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

@github-actions github-actions Bot added docs Improvements or additions to product documentation, "Docs" content PR only touches files under contents/ labels Sep 8, 2026
@ioannisj
ioannisj enabled auto-merge (squash) September 16, 2026 10:13

@ioannisj ioannisj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for this, just pushed a small indentation fix

@ioannisj
ioannisj merged commit f3f8fc4 into PostHog:master Sep 16, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in PostHog.com planning Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content PR only touches files under contents/ docs Improvements or additions to product documentation, "Docs"

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants