Lemmy Post API

Creating and managing posts

Operations 8

GET /post Get a post #
POST /post Create a post #
PUT /post Edit a post #
DELETE /post Delete a post #
GET /post/list List posts #
POST /post/like Vote on a post #
PUT /post/save Save or unsave a post #
POST /post/report Report a post #

Documentation

Specifications

SDKs

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lemmy-post-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lemmy-post-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lemmy REST Account Post API
  description: The Lemmy REST API provides programmatic access to all core platform features of Lemmy, a free, open-source, self-hostable federated link aggregator and discussion platform. Developers can create and manage posts, comments, communities, and user accounts; vote on content; follow communities; search across the federated network; moderate communities; send private messages; and administer instances. Authentication uses JWT bearer tokens obtained via the login endpoint. The API is versioned at /api/v4/ and available on any public Lemmy instance.
  version: 4.0.0
  license:
    name: AGPL-3.0
    url: https://github.com/LemmyNet/lemmy/blob/main/LICENSE
  contact:
    url: https://join-lemmy.org/docs/
servers:
- url: https://lemmy.world/api/v4
  description: Lemmy.world (largest public instance)
- url: https://{instance}/api/v4
  description: Any Lemmy instance
  variables:
    instance:
      default: lemmy.world
      description: The hostname of a Lemmy instance
security:
- bearerAuth: []
tags:
- name: Post
  description: Creating and managing posts
paths:
  /post:
    get:
      operationId: getPost
      summary: Get a post
      description: Retrieve a specific post by ID.
      tags:
      - Post
      security: []
      parameters:
      - name: id
        in: query
        schema:
          $ref: '#/components/schemas/PostId'
      - name: comment_id
        in: query
        schema:
          $ref: '#/components/schemas/CommentId'
      responses:
        '200':
          description: Post details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostResponse'
    post:
      operationId: createPost
      summary: Create a post
      description: Create a new post in a community.
      tags:
      - Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - community_id
              properties:
                name:
                  type: string
                community_id:
                  $ref: '#/components/schemas/CommunityId'
                url:
                  type: string
                  format: uri
                  nullable: true
                body:
                  type: string
                  nullable: true
                honeypot:
                  type: string
                  nullable: true
                nsfw:
                  type: boolean
                  nullable: true
                language_id:
                  $ref: '#/components/schemas/LanguageId'
                custom_thumbnail:
                  type: string
                  nullable: true
                tags:
                  type: array
                  items:
                    type: integer
                  nullable: true
      responses:
        '200':
          description: Post created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostResponse'
    put:
      operationId: editPost
      summary: Edit a post
      description: Update an existing post. Only the post creator can edit.
      tags:
      - Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - post_id
              properties:
                post_id:
                  $ref: '#/components/schemas/PostId'
                name:
                  type: string
                  nullable: true
                url:
                  type: string
                  format: uri
                  nullable: true
                body:
                  type: string
                  nullable: true
                nsfw:
                  type: boolean
                  nullable: true
                language_id:
                  $ref: '#/components/schemas/LanguageId'
      responses:
        '200':
          description: Post updated
    delete:
      operationId: deletePost
      summary: Delete a post
      description: Delete or restore a post. Requires post creator.
      tags:
      - Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - post_id
              - deleted
              properties:
                post_id:
                  $ref: '#/components/schemas/PostId'
                deleted:
                  type: boolean
      responses:
        '200':
          description: Post deleted/restored
  /post/list:
    get:
      operationId: listPosts
      summary: List posts
      description: Retrieve a paginated list of posts filtered by listing type, sort, community, and more.
      tags:
      - Post
      security: []
      parameters:
      - name: type_
        in: query
        schema:
          $ref: '#/components/schemas/ListingType'
      - name: sort
        in: query
        schema:
          $ref: '#/components/schemas/SortType'
      - name: community_id
        in: query
        schema:
          $ref: '#/components/schemas/CommunityId'
      - name: community_name
        in: query
        schema:
          type: string
      - name: saved_only
        in: query
        schema:
          type: boolean
      - name: page
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      - name: show_nsfw
        in: query
        schema:
          type: boolean
      responses:
        '200':
          description: List of posts
  /post/like:
    post:
      operationId: likePost
      summary: Vote on a post
      description: Upvote or downvote a post (score 1, 0, or -1).
      tags:
      - Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - post_id
              - score
              properties:
                post_id:
                  $ref: '#/components/schemas/PostId'
                score:
                  type: integer
                  enum:
                  - -1
                  - 0
                  - 1
      responses:
        '200':
          description: Vote recorded
  /post/save:
    put:
      operationId: savePost
      summary: Save or unsave a post
      description: Bookmark/unbookmark a post for the current user.
      tags:
      - Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - post_id
              - save
              properties:
                post_id:
                  $ref: '#/components/schemas/PostId'
                save:
                  type: boolean
      responses:
        '200':
          description: Save status updated
  /post/report:
    post:
      operationId: createPostReport
      summary: Report a post
      description: Submit a report for a post to the instance moderators.
      tags:
      - Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - post_id
              - reason
              properties:
                post_id:
                  $ref: '#/components/schemas/PostId'
                reason:
                  type: string
      responses:
        '200':
          description: Report submitted
components:
  schemas:
    SortType:
      type: string
      enum:
      - Active
      - Hot
      - New
      - Old
      - TopDay
      - TopWeek
      - TopMonth
      - TopYear
      - TopAll
      - MostComments
      - NewComments
      - TopHour
      - TopSixHour
      - TopTwelveHour
      - TopThreeMonths
      - TopSixMonths
      - TopNineMonths
      - Controversial
      - Scaled
    CommentId:
      type: integer
      description: Unique identifier for a comment
    CommunityId:
      type: integer
      description: Unique identifier for a community
    ListingType:
      type: string
      enum:
      - All
      - Local
      - Subscribed
      - ModeratorView
    PostId:
      type: integer
      description: Unique identifier for a post
    LanguageId:
      type: integer
      description: Unique identifier for a language
    PostResponse:
      type: object
      properties:
        post_view:
          type: object
          description: The post view with associated metadata
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
externalDocs:
  description: Lemmy Documentation
  url: https://join-lemmy.org/docs/