> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postqueen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit Settings

> API settings for posting to Reddit

A Reddit post is defined by the `subreddit` array. Each entry names one subreddit, the title to post under, and the post type.

Creating the OAuth app and connecting a channel: [Reddit setup guide](/installation/providers/reddit).

## Settings Schema

```json theme={"system"}
{
  "settings": {
    "__type": "reddit",
    "subreddit": [
      {
        "value": {
          "subreddit": "programming",
          "title": "My Post Title",
          "type": "self",
          "url": "",
          "is_flair_required": false,
          "flair": null
        }
      }
    ]
  }
}
```

## Fields

| Field       | Type     | Required | Description                       |
| ----------- | -------- | -------- | --------------------------------- |
| `__type`    | `string` | Yes      | Must be `reddit`                  |
| `subreddit` | `array`  | Yes      | Array of subreddit configurations |

### Subreddit Object

Each item in the `subreddit` array contains a `value` object with:

| Field               | Type      | Required    | Description                                            |
| ------------------- | --------- | ----------- | ------------------------------------------------------ |
| `subreddit`         | `string`  | Yes         | Subreddit name (without r/)                            |
| `title`             | `string`  | Yes         | Post title (min 2 characters)                          |
| `type`              | `string`  | Yes         | Post type                                              |
| `url`               | `string`  | Conditional | URL for link posts                                     |
| `is_flair_required` | `boolean` | Yes         | Whether flair is required                              |
| `flair`             | `object`  | Conditional | Flair object (required if `is_flair_required` is true) |

<Check>
  That is the whole schema. `__type`, one entry in `subreddit`, and a title of at least two characters make a valid Reddit post.
</Check>

### `type` (Post Type)

| Value   | Description                              |
| ------- | ---------------------------------------- |
| `self`  | Text post (uses content from post value) |
| `link`  | Link post (requires `url` field)         |
| `media` | Image or video post                      |

<Warning>
  A `media` post takes exactly one media item, and you have to upload the file before you attach it. PostQueen picks image or video from the extension.
</Warning>

### Flair Object

Required when `is_flair_required` is `true`:

```json theme={"system"}
{
  "flair": {
    "id": "flair-template-id",
    "name": "Discussion"
  }
}
```

***

## Complete Example

<Tabs>
  <Tab title="Text post">
    ```json theme={"system"}
    {
      "type": "schedule",
      "date": "2024-12-14T10:00:00.000Z",
      "shortLink": false,
      "tags": [],
      "posts": [
        {
          "integration": {
            "id": "your-reddit-integration-id"
          },
          "value": [
            {
              "content": "I've been working on this project for the past few months and wanted to share my experience.\n\n## What I learned\n\n1. Planning is crucial\n2. Start small\n3. Iterate quickly\n\nWhat are your thoughts?",
              "image": []
            }
          ],
          "settings": {
            "__type": "reddit",
            "subreddit": [
              {
                "value": {
                  "subreddit": "programming",
                  "title": "My journey building a side project - lessons learned",
                  "type": "self",
                  "url": "",
                  "is_flair_required": false,
                  "flair": null
                }
              }
            ]
          }
        }
      ]
    }
    ```
  </Tab>

  <Tab title="Link post">
    ```json theme={"system"}
    {
      "type": "schedule",
      "date": "2024-12-14T10:00:00.000Z",
      "shortLink": false,
      "tags": [],
      "posts": [
        {
          "integration": {
            "id": "your-reddit-integration-id"
          },
          "value": [
            {
              "content": "",
              "image": []
            }
          ],
          "settings": {
            "__type": "reddit",
            "subreddit": [
              {
                "value": {
                  "subreddit": "technology",
                  "title": "Interesting article about AI developments",
                  "type": "link",
                  "url": "https://example.com/ai-article",
                  "is_flair_required": false,
                  "flair": null
                }
              }
            ]
          }
        }
      ]
    }
    ```
  </Tab>

  <Tab title="Required flair">
    ```json theme={"system"}
    {
      "type": "schedule",
      "date": "2024-12-14T10:00:00.000Z",
      "shortLink": false,
      "tags": [],
      "posts": [
        {
          "integration": {
            "id": "your-reddit-integration-id"
          },
          "value": [
            {
              "content": "Looking for advice on my situation...",
              "image": []
            }
          ],
          "settings": {
            "__type": "reddit",
            "subreddit": [
              {
                "value": {
                  "subreddit": "personalfinance",
                  "title": "Need advice on budgeting",
                  "type": "self",
                  "url": "",
                  "is_flair_required": true,
                  "flair": {
                    "id": "abc123-flair-id",
                    "name": "Budgeting"
                  }
                }
              }
            ]
          }
        }
      ]
    }
    ```
  </Tab>

  <Tab title="Multiple subreddits">
    ```json theme={"system"}
    {
      "settings": {
        "__type": "reddit",
        "subreddit": [
          {
            "value": {
              "subreddit": "webdev",
              "title": "New CSS feature just dropped!",
              "type": "link",
              "url": "https://example.com/css-news",
              "is_flair_required": false,
              "flair": null
            }
          },
          {
            "value": {
              "subreddit": "frontend",
              "title": "New CSS feature just dropped!",
              "type": "link",
              "url": "https://example.com/css-news",
              "is_flair_required": false,
              "flair": null
            }
          }
        ]
      }
    }
    ```
  </Tab>
</Tabs>

<Tip>
  You can post to multiple subreddits simultaneously by adding multiple objects to the `subreddit` array.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Connect the channel" icon="plug" href="/providers/reddit">
    Create the OAuth app and link the Reddit account.
  </Card>

  <Card title="Schedule the post" icon="paper-plane" href="/public-api/posts/create">
    The create endpoint, field by field, with a worked request.
  </Card>

  <Card title="Upload media first" icon="image" href="/public-api/uploads/upload-file">
    What a `media` post needs before you can attach it.
  </Card>

  <Card title="When a post fails" icon="triangle-exclamation" href="/troubleshooting/post-failed">
    Work out why a post did not reach the subreddit.
  </Card>
</CardGroup>
