# Reddit - post a comment as a registered app API

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

Category: [Social Media APIs](https://upapi.io/apis/social-media) · Last updated 2026-11-02

## How to call it

- Endpoint: `POST https://api.upapi.io/reddit-oauth-post-comment.post`, key in the `X-Api-Key` header, JSON body.
- Cost: 4 weighted units per call.
- Timeout: 60 seconds.
- Cache: none; every call runs the operation.
- Try it without writing code: https://app.upapi.io/try/reddit-oauth-post-comment.post

```bash
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" }'
```

## Request parameters

- `text` (string, required) — The comment body, markdown, exactly as it will appear.
- `thingId` (string, required) — 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.
- `clientId` (string, required) — Reddit app client id
- `proxyUrl` (string) — Optional exit IP. Omit for the worker's default egress -- the OAuth lane has no per-account IP requirement of its own.
- `userAgent` (string, required) — 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.
- `clientSecret` (string, required) — Reddit app client secret. Never logged.
- `refreshToken` (string, required) — OAuth2 refresh token for the posting account. Never logged, never returned.
- `expectedUsername` (string, required) — 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 fields

- `postedAs` (string, required) — The username Reddit reported for the token, echoed so a caller records who actually spoke rather than who it believed it had asked for.
- `commentId` (string, required) — The new comment's id, without the `t1_` prefix
- `elapsedMs` (integer, required)
- `permalink` (string, required) — 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.
- `createdUtc` (number, required) — Creation time Reddit recorded, epoch seconds UTC
- `parentThingId` (string, required) — The fullname this comment replies to
- `commentFullname` (string, required) — The new comment's fullname, e.g. `t1_abc123`

## Example request and response

The example response is generated from the published output schema: it shows the shape and field names, not values from a recorded call.

```json
{
  "text": "Hello, world",
  "thingId": "example",
  "clientId": "example",
  "userAgent": "example",
  "clientSecret": "example",
  "refreshToken": "example",
  "expectedUsername": "example"
}
```

```json
{
  "postedAs": "example",
  "commentId": "example",
  "elapsedMs": 1,
  "permalink": "example",
  "createdUtc": 1,
  "parentThingId": "example",
  "commentFullname": "`t1_abc123`"
}
```

## Frequently asked questions

### How much does the Reddit - post a comment as a registered app API cost per call?

Each call spends 4 weighted units of your plan's monthly quota. Full pricing is at https://upapi.io/pricing.

### How do I authenticate to the Reddit - post a comment as a registered app API?

Send your key in the X-Api-Key header. A free guest key is available without creating an account.

### Are Reddit - post a comment as a registered app API responses cached?

No — every call runs the operation live; responses are not cached.

## More Social Media APIs

- [Reddit - who does this OAuth app speak as?](https://upapi.io/apis/social-media/reddit-oauth-me)
- [Scrape Reddit Post & Comments](https://upapi.io/apis/social-media/reddit-scrape-post)
- [Check Reddit Comment Visibility](https://upapi.io/apis/social-media/reddit-check-comment-visibility)
- [Search Reddit Posts](https://upapi.io/apis/social-media/reddit-search-posts)
- [Check Reddit Account Health](https://upapi.io/apis/social-media/reddit-check-account-health)
- [Get Subreddit Info](https://upapi.io/apis/social-media/reddit-subreddit-info)
- [Get Trending Reddit Posts](https://upapi.io/apis/social-media/reddit-get-trending)
- [TikTok Get Comment Replies](https://upapi.io/apis/social-media/tiktok-get-comment-replies)
