Check Whether You Can Post in a Subreddit
Before posting, check whether a post in a subreddit can go through: allowed true, false or unknown, a reason code per block, the posting requirements and the post rules.
/api/reddit/sub/:name/can-post$0.0015 / callCheck before you post whether a post in this subreddit can go through, so an
agent or app does not spend a post that gets removed. Returns allowed, a list of
reasons with a stable code each, the subreddit's posting requirements and the
rules that apply to posts.
Send your Reddit session in the x-reddit-session and x-reddit-loid headers (see
authenticated reads) to also check your own account:
whether it is banned or approved here, its karma, its age and whether its email is
verified. Without them the answer covers the subreddit only.
When to use this
Call it right before a submit or a comment to catch the blocks Reddit tells us about: a ban, a private or restricted subreddit, an archived one, a link-only or text-only subreddit, a required flair, title and body rules, and blocked domains. One read.
What allowed means
| Value | Meaning |
|---|---|
true | Every read succeeded and nothing in them blocks the post. |
false | Something we read blocks it, such as a ban or a restricted subreddit your account is not approved in. |
"unknown" | Nothing we read blocks it, but a read we needed failed, or the answer depends on your account and no session was sent. |
true still cannot see AutoModerator. Subreddits do not publish their karma, age or
email thresholds, so karma and account age only ever add a *_hint reason, never a
false.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Subreddit name (no r/ prefix) |
A subreddit that does not exist returns 404.
Example
curl -H "Authorization: Bearer $TOKEN" \
-H "x-reddit-session: $REDDIT_SESSION" -H "x-reddit-loid: $REDDIT_LOID" \
"https://api.redditapis.com/api/reddit/sub/AskReddit/can-post"const response = await fetch(
"https://api.redditapis.com/api/reddit/sub/AskReddit/can-post",
{ headers: { Authorization: "Bearer TOKEN", "x-reddit-session": SESSION, "x-reddit-loid": LOID } }
);
const data = await response.json();import requests
response = requests.get(
"https://api.redditapis.com/api/reddit/sub/AskReddit/can-post",
headers={"Authorization": "Bearer TOKEN", "x-reddit-session": SESSION, "x-reddit-loid": LOID},
)Response Shape
{
"subreddit": "AskReddit",
"allowed": true,
"reasons": [
{ "code": "submission_type", "detail": "Only text posts are allowed (no links)." },
{ "code": "low_karma_hint", "detail": "The account has 12 karma. Many subreddits filter low-karma posts, with thresholds they do not publish. A hint, not a verdict." }
],
"requirements": {
"flair_required": false,
"title": { "min_length": null, "max_length": 300, "regexes": [], "required_strings": [], "blacklisted_strings": [] },
"body": { "policy": "notAllowed", "min_length": null, "max_length": null, "required_strings": [], "blacklisted_strings": [] },
"domains": { "blocked": [], "allowed_only": [] },
"rules": [{ "name": "Rule 1: Questions only", "description": "Posts must be a question.", "violation_reason": "Not a question" }]
},
"account": {
"name": "your_account",
"karma": 12,
"account_age_days": 9,
"email_verified": true,
"is_banned_here": false,
"is_approved_user": false,
"is_moderator": false
},
"scope": "subreddit_and_account"
}Reason codes
| Code | Blocks? | Meaning |
|---|---|---|
banned | Yes | Your account is banned from this subreddit (needs your session). |
private | Yes, unless approved | Reddit refuses the subreddit to anyone not approved. With your session the answer is false; without one it is "unknown", because approval is per account. requirements is null here: a closed subreddit shows its requirements only to members. |
restricted_approved_only | Yes, unless approved | Only approved users can post. |
archived | Yes | Nobody can post. |
submission_type | No | Only link posts, or only text posts, are allowed. |
flair_required | No | A post flair is required. |
title_rule | No | Title length, required or banned words, or patterns. |
body_rule | No | A body is required, or not allowed, or has length or word rules. |
domain_blocked | No | Links to some domains are blocked, or only some are allowed. |
email_unverified | No | A hint: many filters remove posts from unverified accounts. |
low_karma_hint | No | A hint: low karma, threshold unknown. |
new_account_hint | No | A hint: a new account, threshold unknown. |
account is null and scope is subreddit when no session is sent. If the session is sent but Reddit treats it as logged out, the account cannot be read, so allowed is "unknown", never true.
Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.
Subreddit Rules
Fetch a subreddit's posting rules by name: each rule's name, description, what it applies to, violation reason and priority, plus Reddit's site rules.
Subreddit Moderators
Fetch a subreddit's moderator team by name, each moderator's username, id, mod permissions, flair text, and the time they were added.
