Replies
Reply under an X post or a reply, find the post in the account's feed first, and read a post's replies.
Early access. Tell us what you're building and we'll set you up. Contact us
Reply To A Post#
POST /posts/{post_id}/comments (accounts.write, Idempotency-Key
required):
curl -sS -X POST "https://api.lempile.com/posts/1850000000000000001/comments" \
-H "X-API-KEY: $LEMPILE_API_KEY" \
-H "Idempotency-Key: reply-1850000000000000001-1" \
-H "Content-Type: application/json" \
-d '{ "account_id": "janedemo", "text": "Congrats on the launch.", "navigation": "timeline", "author_handle": "marclou" }'{ "object": "CommentSent", "provider": "X", "comment_id": "1850000000000000099", "via": "timeline" }text: up to 1,250 characters.comment_id: a reply's id, as a string of digits: the reply goes under that reply instead.navigation:timelinelooks for the post in the account's Following feed first, as a person scrolling would (giveauthor_handle), then falls back to its page;directopens the post's page.viasays which happened.answer: true: this answers someone who replied to the account. It counts toward its own 200 a day instead of the posts' 70.- If the post was edited, the reply goes under its latest version
(
edited_fromnames the id you asked for). comment_idin the answer isnullwhen X gave no link; the reply still went out.
Reply With A Video#
Send the reply as multipart/form-data with one MP4 in attachments, up to
50 MiB (52,428,800 bytes), as a post's video:
curl -sS -X POST "https://api.lempile.com/posts/1850000000000000001/comments" \
-H "X-API-KEY: $LEMPILE_API_KEY" \
-H "Idempotency-Key: reply-1850000000000000001-video-1" \
-F account_id=janedemo \
-F "text=Try it free for 7 days: https://example.com/" \
-F "attachments=@film.mp4;type=video/mp4"- The reply goes only once X shows the video ready (up to 3 minutes), else
422 errors/not_sentwithcodemedia_upload_failedormedia_upload_timeout, nothing sent. - One video, on a reply under the post: not with
comment_id(501). - The video is part of the request's
Idempotency-Key: the same key with another file is refused. - A body over 50 MiB is refused before it is read:
413 errors/payload_too_large. While other big files are being sent:429 errors/files_busywithretry_at, nothing sent; send it again then, same key. - LinkedIn comments take one image, never a video: a video on a LinkedIn
comment answers
400 errors/invalid_parameters. - The answer's
mediais what X showed for the video. When the browser didn't confirm it, the reply is still out andwarningssaysvideo_unconfirmed: check the reply on X.
Dry Run#
Add dry_run=true (or "dry_run": true in JSON) to do everything but press
Reply: the browser reaches the post, types the text, attaches the video and
checks Reply could be pressed, then closes the tab. Nothing is sent.
- The answer is
200withobjectCommentDryRun,not_sent: trueand, with a video,media(X's own words for it and the seconds until Ready). A dry run that doesn't show the video it was asked to attach answers502 errors/not_sentwithcodevideo_unconfirmed. - The key is free again, and a dry run isn't one of the account's writes. It is still paced like one: send it outside the account's planned posts.
dry_runis part of the request'sIdempotency-Key: a dry run's key never stands for a real reply.- X replies under a post only: not with
comment_id(501), not on LinkedIn (400).
When the post's author limits who can reply, nothing is sent:
422 errors/not_sent, with that reason in detail. Replies share the posts'
pace and their 504 errors/timeout rule: read the
receipt before sending again.
Read A Post's Replies#
GET /posts/{post_id}/comments?account_id=&limit=&sort_by=&comment_id=
(accounts.read): the replies the post's page shows (limit up to 100,
default 50).
sort_by:MOST_RECENT(the default) puts them newest first bydate;MOST_RELEVANTkeeps X's own order.comment_id: a reply's id. Its own replies come back instead.cursor: X's replies come in one page, so a cursor answers400 errors/invalid_parameters; every answer'scursorisnull.
{ "object": "CommentList", "total_items": 1, "cursor": null,
"items": [{ "object": "Comment", "post_id": "1850000000000000001", "id": "1850000000000000099",
"author": "Sam Doe", "text": "Congrats on the launch.", "date": "2026-11-06T09:30:00.000Z" }] }Was this page helpful?