RelayAPI

Reddit API

Schedule Reddit text and link posts with RelayAPI, including one media URL as a link, subreddit targeting, and flair support.

Quick Reference

PropertyValue
Platform keyreddit
Auth methodOAuth 2.0
Title limit300 characters (required, cannot edit after posting)
Body text limit40,000 characters
Media URLs per post1, submitted as a Reddit link post
Native image/video uploadNot implemented by the RelayAPI publisher
Gallery uploadNot implemented; more than one media item is rejected
Post typesText/Self, Link
SchedulingYes
AnalyticsLimited (upvotes, comments only)

Client optionsTypeScript · 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_abc123

Content 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

PropertyRequirement
Max per post1 public media URL
Provider behaviorSubmitted as a Reddit link post; bytes are not uploaded by RelayAPI
Multiple mediaRejected before provider submission

Native uploads

PropertyRequirement
SupportNot implemented by RelayAPI's current Reddit publisher
WorkaroundHost 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.

FieldTypeDescription
contentstringOverride content for Reddit specifically
mediaobject[]Override media for Reddit specifically; zero or one item only, submitted as a link
subredditstringTarget subreddit without the r/ prefix. Required.
titlestringPost title (max 300 chars). Falls back to first line of content. Cannot be edited after posting.
urlstringURL for link posts. If provided, creates a link post instead of a text post.
flair_idstringPost flair ID. Required by some subreddits.
force_selfbooleanForce 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

ErrorCauseFix
SUBREDDIT_NOTALLOWED: only trusted membersSubreddit restricts posting to trusted membersBuild karma, engage with the community, or choose a different subreddit.
NO_SELFS: doesn't allow text postsSubreddit only accepts links or imagesProvide a url or attach an image instead.
SUBMIT_VALIDATION_FLAIR_REQUIREDFlair is required by the subredditFetch available flairs and provide a flair_id.
SUBREDDIT_NOEXISTTypo in subreddit name or subreddit is privateCheck spelling. Do not include the r/ prefix.
AI-generated content not allowedSubreddit bans AI-generated contentWrite original content or choose a different subreddit.
Rate limitedReddit rate limit hitNew 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

TypeFires on
reddit_commentComment on your post / reply to your comment
reddit_mentionu/username mention
reddit_new_postNew post in a watched subreddit
reddit_modmailModmail conversation
reddit_dmDirect private message

Send nodes

Base: https://oauth.reddit.com. All endpoints expect form-encoded bodies + a custom User-Agent.

NodeEndpointRequired fields
reddit_reply_to_commentPOST /api/commenttext, thing_id (fullname, e.g. t1_xyz)
reddit_send_pmPOST /api/composeto, text, optional subject
reddit_reply_modmailPOST /api/mod/conversations/{id}body, conversation_id
reddit_submit_postPOST /api/submitsubreddit, title, either text (self) or url (link)

Found something wrong? Help us improve this page.

On this page