APIHub
Back to Explore

Discourse API Documentation

This page contains the documentation on how to use Discourse through API calls.

Social
none
No HTTPS
CORS: Unknown
Visit official documentation

Latency

2768ms p95

Uptime

0.0% 30d

Playground

Verified

live

Endpoints

REST · JSON
PUT

/users/password-reset/{token}.json

Change password

  • token (path, required)
POST

/invites.json

Create an invite

  • Api-Key (header, required)
  • Api-Username (header, required)
GET

/admin/backups.json

List backups

POST

/admin/backups.json

Create backup

GET

/admin/backups/{filename}

Download backup

  • filename (path, required)
  • token (query, required)
PUT

/admin/backups/{filename}

Send download backup email

  • filename (path, required)
GET

/admin/badges.json

List badges

POST

/admin/badges.json

Create badge

DELETE

/admin/badges/{id}.json

Delete badge

  • id (path, required)
PUT

/admin/badges/{id}.json

Update badge

  • id (path, required)
POST

/admin/groups.json

Create a group

DELETE

/admin/groups/{id}.json

Delete a group

  • id (path, required)
POST

/t/{id}/invite.json

Invite to topic

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
POST

/t/{id}/notifications.json

Set notification level

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
GET

/admin/users/list/{flag}.json

Get a list of users

  • flag (path, required)
  • order (query)
  • asc (query)
  • page (query, page)
  • show_emails (query)
DELETE

/admin/users/{id}.json

Delete a user

  • id (path, required)
GET

/admin/users/{id}.json

Get a user by id

  • id (path, required)
PUT

/admin/users/{id}/anonymize.json

Anonymize a user

  • id (path, required)
POST

/admin/users/{id}/log_out.json

Log a user out

  • id (path, required)
PUT

/admin/users/{id}/silence.json

Silence a user

  • id (path, required)
PUT

/admin/users/{id}/suspend.json

Suspend a user

  • id (path, required)
GET

/c/{id}/show.json

Show category

  • id (path, required)
GET

/c/{slug}/{id}.json

List topics

  • slug (path, required)
  • id (path, required)
GET

/categories.json

Retrieves a list of categories

  • include_subcategories (query)
POST

/categories.json

Creates a category

PUT

/categories/{id}.json

Updates a category

  • id (path, required)
GET

/t/{id}/posts.json

Get specific posts from a topic

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
POST

/user_avatar/{username}/refresh_gravatar.json

Refresh gravatar

  • username (path, required)
GET

/directory_items.json

Get a public list of users

  • period (query, required)
  • order (query, required)
  • asc (query)
  • page (query, page)
GET

/groups.json

List groups

GET

/groups/{id}.json

Get a group

  • id (path, required) — Use group name instead of id
PUT

/groups/{id}.json

Update a group

  • id (path, required)
DELETE

/groups/{id}/members.json

Remove group members

  • id (path, required)
GET

/groups/{id}/members.json

List group members

  • id (path, required) — Use group name instead of id
PUT

/groups/{id}/members.json

Add group members

  • id (path, required)
GET

/latest.json

Get the latest topics

  • Api-Key (header, required)
  • Api-Username (header, required)
  • order (query) — Enum: `default`, `created`, `activity`, `views`, `posts`, `category`, `likes`, `op_likes`, `posters`
  • ascending (query) — Defaults to `desc`, add `ascending=true` to sort asc
GET

/notifications.json

Get the notifications that belong to the current user

PUT

/notifications/mark-read.json

Mark notifications as read

POST

/post_actions.json

Like a post and other actions

  • Api-Key (header, required)
  • Api-Username (header, required)
GET

/posts.json

List latest posts across topics

  • Api-Key (header, required)
  • Api-Username (header, required)
  • before (query) — Load posts with an id lower than this value. Useful for pagination.
POST

/posts.json

Creates a new topic, a new post, or a private message

DELETE

/posts/{id}.json

delete a single post

  • id (path, required)
GET

/posts/{id}.json

Retrieve a single post

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
PUT

/posts/{id}.json

Update a single post

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
PUT

/posts/{id}/locked.json

Lock a post from being edited

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
GET

/posts/{id}/replies.json

List replies to a post

  • id (path, required)
GET

/search.json

Search for a term

  • q (query) — The query string needs to be url encoded and is made up of the following options: - Search term. This is just a string. Usually it would be the first item in the query. - `@ `: Use the `@` followed by the username to specify posts by this user. - `# `: Use the `#` followed by the category slug to search within this category. - `tags:`: `api,solved` or for posts that have all the specified tags `api+solved`. - `before:`: `yyyy-mm-dd` - `after:`: `yyyy-mm-dd` - `order:`: `latest`, `likes`, `views`, `latest_topic` - `assigned:`: username (without `@`) - `in:`: `title`, `likes`, `personal`, `messages`, `seen`, `unseen`, `posted`, `created`, `watching`, `tracking`, `bookmarks`, `assigned`, `unassigned`, `first`, `pinned`, `wiki` - `with:`: `images` - `status:`: `open`, `closed`, `public`, `archived`, `noreplies`, `single_user`, `solved`, `unsolved` - `group:`: group_name or group_id - `group_messages:`: group_name or group_id - `min_posts:`: 1 - `max_posts:`: 10 - `min_views:`: 1 - `max_views:`: 10 If you are using cURL you can use the `-G` and the `--data-urlencode` flags to encode the query: ``` curl -i -sS -X GET -G "http://localhost:4200/search.json" \ --data-urlencode 'q=wordpress @scossar #fun after:2020-01-01' ```
  • page (query, page)
POST

/session/forgot_password.json

Send password reset email

GET

/site.json

Get site info

PUT

/t/-/{id}.json

Update a topic

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
GET

/t/external_id/{external_id}.json

Get topic by external_id

  • external_id (path, required)
DELETE

/t/{id}.json

Remove a topic

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
GET

/t/{id}.json

Get a single topic

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
PUT

/t/{id}/bookmark.json

Bookmark topic

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
PUT

/t/{id}/change-timestamp.json

Update topic timestamp

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
POST

/users.json

Creates a user

  • Api-Key (header, required)
  • Api-Username (header, required)
PUT

/t/{id}/status.json

Update the status of a topic

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
POST

/t/{id}/timer.json

Create topic timer

  • Api-Key (header, required)
  • Api-Username (header, required)
  • id (path, required)
GET

/tag/{name}.json

Get a specific tag

  • name (path, required)
GET

/tag_groups.json

Get a list of tag groups

POST

/tag_groups.json

Creates a tag group

GET

/tag_groups/{id}.json

Get a single tag group

  • id (path, required)
PUT

/tag_groups/{id}.json

Update tag group

  • id (path, required)
GET

/tags.json

Get a list of tags

GET

/top.json

Get the top topics filtered by period

  • Api-Key (header, required)
  • Api-Username (header, required)
  • period (query) — Enum: `all`, `yearly`, `quarterly`, `monthly`, `weekly`, `daily`
GET

/topics/private-messages-sent/{username}.json

Get a list of private messages sent for a user

  • username (path, required)
GET

/topics/private-messages/{username}.json

Get a list of private messages for a user

  • username (path, required)
GET

/u/by-external/{external_id}.json

Get a user by external_id

  • Api-Key (header, required)
  • Api-Username (header, required)
  • external_id (path, required)
GET

/u/by-external/{provider}/{external_id}.json

Get a user by identity provider external ID

  • Api-Key (header, required)
  • Api-Username (header, required)
  • provider (path, required) — Authentication provider name. Can be found in the provider callback URL: `/auth/{provider}/callback`
  • external_id (path, required)
GET

/u/{username}.json

Get a single user by username

  • Api-Key (header, required)
  • Api-Username (header, required)
  • username (path, required)
PUT

/u/{username}.json

Update a user

  • Api-Key (header, required)
  • Api-Username (header, required)
  • username (path, required)
GET

/u/{username}/emails.json

Get email addresses belonging to a user

  • username (path, required)
PUT

/u/{username}/preferences/avatar/pick.json

Update avatar

  • username (path, required)
PUT

/u/{username}/preferences/email.json

Update email

  • username (path, required)
PUT

/u/{username}/preferences/username.json

Update username

  • username (path, required)
POST

/uploads.json

Creates an upload

POST

/uploads/abort-multipart.json

Abort multipart upload

POST

/uploads/batch-presign-multipart-parts.json

Generates batches of presigned URLs for multipart parts

POST

/uploads/complete-external-upload.json

Completes a direct external upload

POST

/uploads/complete-multipart.json

Complete multipart upload

POST

/uploads/create-multipart.json

Creates a multipart external upload

POST

/uploads/generate-presigned-put.json

Initiates a direct external upload

GET

/user-badges/{username}.json

List badges for a user

  • username (path, required)
GET

/user_actions.json

Get a list of user actions

  • offset (query, required, offset)
  • username (query, required)
  • filter (query, required)

84 endpoints auto-detected

curl -X PUT \
  "http://discourse.local/users/password-reset/{token}.json"

discourse.local · HTTPS only