Reddit - post a comment as a registered app
PythonSocial MediaPOST api.upapi.io/reddit-oauth-post-comment.postPosts a comment through Reddit's documented OAuth2 API using a refresh token, with the caller's own User-Agent. Verifies the token's account against expectedUsername before creating anything, and turns Reddit's HTTP-200 `json.errors` refusals (locked thread, subreddit ban, rate limit) into classified failures. No browser, no captcha, no cookies.
Request schema
| Field | Type | Description |
|---|---|---|
textreq | string | The comment body, markdown, exactly as it will appear. |
thingIdreq | string | Fullname of what is being replied to: t3_<id> for a post, t1_<id> for another comment. This is the complete address of the parent -- unlike the cookie path, no page URL is needed or accepted. |
clientIdreq | string | Reddit app client id |
proxyUrl | Optional exit IP. Omit for the worker's default egress -- the OAuth lane has no per-account IP requirement of its own.· default: null | |
userAgentreq | string | The User-Agent this request is made with, sent verbatim. REQUIRED and never defaulted -- Reddit's API rules ask for a descriptive UA naming the app. |
clientSecretreq | string | Reddit app client secret. Never logged. |
refreshTokenreq | string | OAuth2 refresh token for the posting account. Never logged, never returned. |
expectedUsernamereq | string | The account this comment must be attributed to. REQUIRED, unlike on the read operation: a refresh token is opaque, so without this a mis-filed credential posts under an identity nobody chose -- and every gate upstream reasoned about a different account. Compared against the name Reddit itself reports, before anything is created. |
Response schema
| Field | Type | Description |
|---|---|---|
postedAsreq | string | The username Reddit reported for the token, echoed so a caller records who actually spoke rather than who it believed it had asked for. |
commentIdreq | string | The new comment's id, without the t1_ prefix |
elapsedMsreq | integer | |
permalinkreq | string | Absolute permalink to the comment. Reddit returns a site-relative path; it is made absolute here so no caller has to know which host to prepend. |
createdUtcreq | number | Creation time Reddit recorded, epoch seconds UTC |
parentThingIdreq | string | The fullname this comment replies to |
commentFullnamereq | string | The new comment's fullname, e.g. t1_abc123 |
Try it
Try it
The comment body, markdown, exactly as it will appear.
Fullname of what is being replied to: t3_<id> for a post, t1_<id> for another comment. This is the complete address of the parent -- unlike the cookie path, no page URL is needed or accepted.
Reddit app client id
The User-Agent this request is made with, sent verbatim. REQUIRED and never defaulted -- Reddit's API rules ask for a descriptive UA naming the app.
Reddit app client secret. Never logged.
OAuth2 refresh token for the posting account. Never logged, never returned.
The account this comment must be attributed to. REQUIRED, unlike on the read operation: a refresh token is opaque, so without this a mis-filed credential posts under an identity nobody chose -- and every gate upstream reasoned about a different account. Compared against the name Reddit itself reports, before anything is created.
Optional exit IP. Omit for the worker's default egress -- the OAuth lane has no per-account IP requirement of its own.
Run this endpoint live
Jump in as a guest — no signup — and run reddit-oauth-post-comment.post with your own inputs. Create a free account anytime to get your own API key.
Code examples
curl -X POST https://api.upapi.io/reddit-oauth-post-comment.post \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{ "text": "Hello, world", "thingId": "example", "clientId": "example", "userAgent": "example", "clientSecret": "example", "refreshToken": "example", "expectedUsername": "example" }'