Reddit API
Schedule Reddit text and link posts with RelayAPI, including one media URL as a link, subreddit targeting, and flair support.
Quick Reference
| Property | Value |
|---|---|
| Platform key | reddit |
| Auth method | OAuth 2.0 |
| Title limit | 300 characters (required, cannot edit after posting) |
| Body text limit | 40,000 characters |
| Media URLs per post | 1, submitted as a Reddit link post |
| Native image/video upload | Not implemented by the RelayAPI publisher |
| Gallery upload | Not implemented; more than one media item is rejected |
| Post types | Text/Self, Link |
| Scheduling | Yes |
| Analytics | Limited (upvotes, comments only) |
Client options — TypeScript · Python REST/OpenAPI · Go · Java · REST API
Before You Start
Reddit is fundamentally different from every other platform. Each subreddit is independently moderated with its own rules. What works in one subreddit may get you banned in another. Always check subreddit rules before posting. The post title is permanent and cannot be edited after posting. Many subreddits require flair — posts without it will be rejected. RelayAPI's current publisher uses Reddit's documented /api/submit endpoint only: it submits one media URL as a link post and does not perform native image, video, or gallery uploads. New accounts are heavily restricted by karma and account age requirements.
Quick Start
Post to a subreddit:
import Relay from '@relayapi/sdk';
const client = new Relay();
const post = await client.posts.create({
content: 'Tips for learning a new programming language\n\n1. Start with the official tutorial\n2. Build a small project immediately\n3. Read other people\'s code',
targets: ['reddit'],
scheduled_at: 'now',
target_options: {
reddit: {
subreddit: 'learnprogramming'
}
}
});
console.log(post.id); // post_abc123Content Types
Text/Self Post
The first line of content becomes the title, and the rest becomes the body. Reddit Markdown is supported in the body text.
const post = await client.posts.create({
content: 'Tips for learning a new programming language\n\n1. Start with the official tutorial\n2. Build a small project immediately\n3. Read other people\'s code',
targets: ['reddit'],
scheduled_at: 'now',
target_options: {
reddit: {
subreddit: 'learnprogramming'
}
}
});You can also provide the title explicitly using target_options.reddit.title. If not provided, the first line of content is used as the title.
Link Post
Share a URL. The title is the first line of content, and the url field creates a link post instead of a text post.
const post = await client.posts.create({
content: 'Interesting article about modern API design patterns',
targets: ['reddit'],
scheduled_at: 'now',
target_options: {
reddit: {
subreddit: 'programming',
url: 'https://example.com/api-design-article'
}
}
});Media URL as a Link Post
Supplying one media item creates a Reddit link post whose URL is that media item's public URL. RelayAPI does not upload the bytes to Reddit, so this is not a native Reddit image/video upload.
const post = await client.posts.create({
content: 'Check out this view from my hike!',
targets: ['reddit'],
media: [
{ url: 'https://cdn.example.com/hiking-photo.jpg', type: 'image' }
],
scheduled_at: 'now',
target_options: {
reddit: {
subreddit: 'hiking'
}
}
});Multiple Media URLs (Unsupported)
The following multi-image shape is an example of a request RelayAPI rejects. The current publisher does not call Reddit's gallery/media-upload APIs; use a single public URL or create the native gallery outside RelayAPI.
const post = await client.posts.create({
content: 'My weekend woodworking project - start to finish',
targets: ['reddit'],
media: [
{ url: 'https://cdn.example.com/step1.jpg', type: 'image' },
{ url: 'https://cdn.example.com/step2.jpg', type: 'image' },
{ url: 'https://cdn.example.com/finished.jpg', type: 'image' }
],
scheduled_at: 'now',
target_options: {
reddit: {
subreddit: 'woodworking'
}
}
});Post with Flair
Many subreddits require flair on every post. You can list available flairs for a subreddit via the RelayAPI accounts endpoint.
const post = await client.posts.create({
content: 'What is your favorite programming language?',
targets: ['reddit'],
scheduled_at: 'now',
target_options: {
reddit: {
subreddit: 'socialmedia',
flair_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
}
}
});To get available flairs for a subreddit, use GET /v1/accounts/{id}/reddit-flairs?subreddit=NAME. Many subreddits reject posts without flair.
Media Requirements
Media links
| Property | Requirement |
|---|---|
| Max per post | 1 public media URL |
| Provider behavior | Submitted as a Reddit link post; bytes are not uploaded by RelayAPI |
| Multiple media | Rejected before provider submission |
Native uploads
| Property | Requirement |
|---|---|
| Support | Not implemented by RelayAPI's current Reddit publisher |
| Workaround | Host the image/video at a public URL and create a link post, or publish natively |
target_options Fields
All fields go inside target_options.reddit on your post request.
| Field | Type | Description |
|---|---|---|
content | string | Override content for Reddit specifically |
media | object[] | Override media for Reddit specifically; zero or one item only, submitted as a link |
subreddit | string | Target subreddit without the r/ prefix. Required. |
title | string | Post title (max 300 chars). Falls back to first line of content. Cannot be edited after posting. |
url | string | URL for link posts. If provided, creates a link post instead of a text post. |
flair_id | string | Post flair ID. Required by some subreddits. |
force_self | boolean | Force a text/self post even when media or a URL is provided |
Published edits and voting
RelayAPI can edit the self-text of an already-published Reddit target or owned
comment and can upvote, downvote, or clear_vote on a provider post. Titles,
linked URLs, and media cannot be edited. These operations require the edit or
vote OAuth grant, so reconnect an older account that lacks them. See
Published Edits and Social Actions.
Native Reddit image, video, and gallery upload remains intentionally deferred; the publishing adapter still submits at most one public media URL as a link post.
Auto-Retry Behavior
RelayAPI automatically retries failed Reddit posts in certain scenarios:
- Link post in text-only subreddit — automatically retries as a text/self post with the URL included in the body.
- Missing required flair — automatically tries the first available flair for the subreddit.
Common Errors
| Error | Cause | Fix |
|---|---|---|
| SUBREDDIT_NOTALLOWED: only trusted members | Subreddit restricts posting to trusted members | Build karma, engage with the community, or choose a different subreddit. |
| NO_SELFS: doesn't allow text posts | Subreddit only accepts links or images | Provide a url or attach an image instead. |
| SUBMIT_VALIDATION_FLAIR_REQUIRED | Flair is required by the subreddit | Fetch available flairs and provide a flair_id. |
| SUBREDDIT_NOEXIST | Typo in subreddit name or subreddit is private | Check spelling. Do not include the r/ prefix. |
| AI-generated content not allowed | Subreddit bans AI-generated content | Write original content or choose a different subreddit. |
| Rate limited | Reddit rate limit hit | New accounts are limited to ~10 posts/day. Space posts further apart. |
Known Quirks
- Title is permanent — the post title cannot be edited after posting. Double-check before submitting.
- No native media upload — RelayAPI submits one public image/video URL as a link post.
- Each subreddit has unique, independent rules — moderation varies wildly between communities.
- New accounts are heavily restricted — karma requirements and account age gates apply.
- Reddit Markdown supported in body text for formatting.
- Gallery requests are rejected — the current RelayAPI publisher does not invoke Reddit's gallery upload flow.
- Auto-retry behavior — link posts that fail in text-only subreddits are automatically retried as self posts.
- Flair auto-retry — if flair is required but not provided, RelayAPI tries the first available flair.
Automations
Commercial use of Reddit's API requires explicit written approval via the Responsible Builder Policy. OAuth clients are rate-limited to ~100 QPM. Polling-based (no webhooks).
Triggers
| Type | Fires on |
|---|---|
reddit_comment | Comment on your post / reply to your comment |
reddit_mention | u/username mention |
reddit_new_post | New post in a watched subreddit |
reddit_modmail | Modmail conversation |
reddit_dm | Direct private message |
Send nodes
Base: https://oauth.reddit.com. All endpoints expect form-encoded bodies + a custom User-Agent.
| Node | Endpoint | Required fields |
|---|---|---|
reddit_reply_to_comment | POST /api/comment | text, thing_id (fullname, e.g. t1_xyz) |
reddit_send_pm | POST /api/compose | to, text, optional subject |
reddit_reply_modmail | POST /api/mod/conversations/{id} | body, conversation_id |
reddit_submit_post | POST /api/submit | subreddit, title, either text (self) or url (link) |
Found something wrong? Help us improve this page.