Write

Create Post

Create a Reddit post as the authenticated caller. Serves kind "self" (text), "link", "poll", "image", "video" and "videogif". An unsupported kind is refused by NAME with a 400 rather than silently downgraded to a text post. For image and video you supply a URL we fetch: the media is uploaded to Reddit and the request is held open until Reddit confirms the post, so a media post behaves the same as every other kind. NOT YET VERIFIED END TO END against a real Reddit account: the route is unit-tested and the request shape is derived from the live router, but no post has been created through it, and an unverified write fails under YOUR account in a real subreddit. Talk to support before building on it. Cost: $0.012 per call.

post/api/reddit/submit

Request

  • Base URL: https://api.redditapis.com
  • URL: https://api.redditapis.com/api/reddit/submit
  • Auth: HTTP bearer

Request body

subredditstring required

Target subreddit name, without the r/ prefix

kindstring required

Post kind: "self" for a text post, "link" for a URL post, "poll" for a poll, "image", "video" or "videogif" for a media post

titlestring required

Post title

textstring

Body text. Used when kind is "self", and optionally on a media post.

urlstring

Target URL. Used when kind is "link". Not accepted on a media post: an image URL here would create a LINK post pointing at the image, which is a different thing from an image post.

image_urlstring

Publicly readable https URL of the image. Required when kind is "image". We fetch it, so it must not need authentication. The Content-Type you serve decides the media type, so a URL with no file extension works.

video_urlstring

Publicly readable https URL of the video. Required when kind is "video" or "videogif". Same fetch rules as image_url.

video_poster_urlstring

Publicly readable https URL of a poster image for the video. REQUIRED when kind is "video" or "videogif": Reddit will not accept a video without one, and we do not invent a placeholder because it would be published under your name.

optionsstring[]

Poll choices. Required when kind is "poll", at least two, distinct and non-empty. Reddit rules on the maximum, which is not enforced here.

durationinteger

Poll length in whole days. Required when kind is "poll". Reddit rules on the accepted range, which is not enforced here.

nsfwboolean

Mark the post NSFW

spoilerboolean

Mark the post a spoiler

sendrepliesboolean

Send reply notifications to the author inbox

flair_idstring

Subreddit flair template id

flair_textstring

Flair text, where the subreddit allows it

reddit_sessionstring

Account session cookie (from /api/reddit/login)

loidstring

Account loid cookie (from /api/reddit/login)

token_v2string

Reddit token_v2 cookie

csrf_tokenstring

Reddit CSRF token cookie

edgebucketstring

edgebucket cookie

csvstring

csv cookie

session_trackerstring

session_tracker cookie

pcstring

pc cookie

localestring

BCP-47 tag for the browser context, e.g. de-DE. Match it to the proxy's country. Default en-US.

timezonestring

IANA zone for the browser context, e.g. Europe/Berlin. Match it to the proxy's country, or the account acts from your proxy's IP while reporting a New York clock. Casing and aliases are normalised (utc to UTC, europe/berlin to Europe/Berlin, GMT to UTC, Japan to Asia/Tokyo). A numeric offset such as +05:30 is not a timezone and is rejected. Default America/New_York.

Response

Successful response.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.