just/mocks_
mockzilla.org →
Catalog /ai /Discourse API

Discourse API

PROVIDER · Discourse SPEC vlatest · OpenAPI 3.1.0 MOCK · LIVE
▸ TRY IT
https://api.justmocks.com/discourse
Open mock →

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

[01]

About

overview

Mock the Discourse API as a turnkey Mockzilla sim with 84 OpenAPI endpoints, realistic JSON payloads, no upstream signup or sandbox keys. This page contains the documentation on how to use Discourse through API calls. Methods: 35x GET, 22x POST, 21x PUT, 6x DELETE. Top resource groups: Users, Topics, Groups, Admin. Hit https://api.justmocks.com/discourse for the Mockzilla API Explorer landing and per-endpoint sample requests.

Endpoints
84 across 15 resource groups
Methods
GET 35 · POST 22 · PUT 21 · DEL 6 none deprecated
OpenAPI
3.1.0 spec version latest
Source spec
386 KB · YAML
[02]

Endpoints

84 operations · 15 resource groups
GET /admin/backups.json
Backups
List backups
POST /admin/backups.json
Backups
Create backup
GET /admin/backups/{filename}
Backups
Download backup
PUT /admin/backups/{filename}
Backups
Send download backup email
GET /admin/badges.json
Badges
List badges
POST /admin/badges.json
Badges
Create badge
DEL /admin/badges/{id}.json
Badges
Delete badge
PUT /admin/badges/{id}.json
Badges
Update badge
POST /admin/groups.json
Groups
Create a group
DEL /admin/groups/{id}.json
Groups
Delete a group
GET /admin/users/list/{flag}.json
UsersAdmin
Get a list of users
DEL /admin/users/{id}.json
UsersAdmin
Delete a user
GET /admin/users/{id}.json
UsersAdmin
Get a user by id
PUT /admin/users/{id}/anonymize.json
UsersAdmin
Anonymize a user
POST /admin/users/{id}/log_out.json
UsersAdmin
Log a user out
PUT /admin/users/{id}/silence.json
UsersAdmin
Silence a user
PUT /admin/users/{id}/suspend.json
UsersAdmin
Suspend a user
GET /c/{id}/show.json
Categories
Show category
GET /c/{slug}/{id}.json
Categories
List topics
GET /categories.json
Categories
Retrieves a list of categories
POST /categories.json
Categories
Creates a category
PUT /categories/{id}.json
Categories
Updates a category
GET /directory_items.json
Users
Get a public list of users
GET /groups.json
Groups
List groups
GET /groups/{id}.json
Groups
Get a group
PUT /groups/{id}.json
Groups
Update a group
DEL /groups/{id}/members.json
Groups
Remove group members
GET /groups/{id}/members.json
Groups
List group members
PUT /groups/{id}/members.json
Groups
Add group members
POST /invites.json
Invites
Create an invite
GET /latest.json
Topics
Get the latest topics
GET /notifications.json
Notifications
Get the notifications that belong to the current user
PUT /notifications/mark-read.json
Notifications
Mark notifications as read
POST /post_actions.json
Posts
Like a post and other actions
GET /posts.json
Posts
List latest posts across topics
POST /posts.json
PostsTopicsPrivate Messages
Creates a new topic, a new post, or a private message
DEL /posts/{id}.json
Posts
delete a single post
GET /posts/{id}.json
Posts
Retrieve a single post
This endpoint can be used to get the number of likes on a post using the actions_summary property in the response. actions_summary responses with the id of 2 signify a like. If there are no actions_summary items with the id of 2, that means there are 0 likes. Other ids likely refer to various different flag types. Mocked via Mockzilla.
PUT /posts/{id}.json
Posts
Update a single post
PUT /posts/{id}/locked.json
Posts
Lock a post from being edited
GET /posts/{id}/replies.json
Posts
List replies to a post
GET /search.json
Search
Search for a term
POST /session/forgot_password.json
Users
Send password reset email
GET /site.json
SiteCategories
Get site info
Can be used to fetch all categories and subcategories
PUT /t/-/{id}.json
Topics
Update a topic
GET /t/external_id/{external_id}.json
Topics
Get topic by external_id
DEL /t/{id}.json
Topics
Remove a topic
GET /t/{id}.json
Topics
Get a single topic
PUT /t/{id}/bookmark.json
Topics
Bookmark topic
PUT /t/{id}/change-timestamp.json
Topics
Update topic timestamp
POST /t/{id}/invite.json
TopicsInvites
Invite to topic
POST /t/{id}/notifications.json
Topics
Set notification level
GET /t/{id}/posts.json
Topics
Get specific posts from a topic
PUT /t/{id}/status.json
Topics
Update the status of a topic
POST /t/{id}/timer.json
Topics
Create topic timer
GET /tag/{name}.json
Tags
Get a specific tag
GET /tag_groups.json
Tags
Get a list of tag groups
POST /tag_groups.json
Tags
Creates a tag group
GET /tag_groups/{id}.json
Tags
Get a single tag group
PUT /tag_groups/{id}.json
Tags
Update tag group
GET /tags.json
Tags
Get a list of tags
GET /top.json
Topics
Get the top topics filtered by period
GET /topics/private-messages-sent/{username}.json
Private Messages
Get a list of private messages sent for a user
GET /topics/private-messages/{username}.json
Private Messages
Get a list of private messages for a user
GET /u/by-external/{external_id}.json
Users
Get a user by external_id
GET /u/by-external/{provider}/{external_id}.json
Users
Get a user by identity provider external ID
GET /u/{username}.json
Users
Get a single user by username
PUT /u/{username}.json
Users
Update a user
GET /u/{username}/emails.json
Users
Get email addresses belonging to a user
PUT /u/{username}/preferences/avatar/pick.json
Users
Update avatar
PUT /u/{username}/preferences/email.json
Users
Update email
PUT /u/{username}/preferences/username.json
Users
Update username
POST /uploads.json
Uploads
Creates an upload
POST /uploads/abort-multipart.json
Uploads
Abort multipart upload
This endpoint aborts the multipart upload initiated with /create-multipart. This should be used when cancelling the upload. It does not matter if parts were already uploaded into the external storage provider. You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See: https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. An external file store must be set up and enable_direct_s3_uploads must be set to true for this endpoint to function.
POST /uploads/batch-presign-multipart-parts.json
Uploads
Generates batches of presigned URLs for multipart parts
Multipart uploads are uploaded in chunks or parts to individual presigned URLs, similar to the one generated by /generate-presigned-put. The part numbers provided must be between 1 and 10000. The total number of parts will depend on the chunk size in bytes that you intend to use to upload each chunk. For example a 12MB file may have 2 5MB chunks and a final 2MB chunk, for part numbers 1, 2, and 3. This endpoint will return a presigned URL for each part number provided, which you can then use to send PUT requests for the binary chunk corresponding to that part. When the part is uploaded, the provider should return an ETag for the part, and this should be stored along with the part number, because this is needed to complete the multipart upload. You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See: https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. An external file store must be set up and enable_direct_s3_uploads must be set to true for this endpoint to function.
POST /uploads/complete-external-upload.json
Uploads
Completes a direct external upload
Completes an external upload initialized with /get-presigned-put. The file will be moved from its temporary location in external storage to a final destination in the S3 bucket. An Upload record will also be created in the database in most cases. If a sha1-checksum was provided in the initial request it will also be compared with the uploaded file in storage to make sure the same file was uploaded. The file size will be compared for the same reason. You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See: https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. An external file store must be set up and enable_direct_s3_uploads must be set to true for this endpoint to function.
POST /uploads/complete-multipart.json
Uploads
Complete multipart upload
Completes the multipart upload in the external store, and copies the file from its temporary location to its final location in the store. All of the parts must have been uploaded to the external storage provider. An Upload record will be completed in most cases once the file is copied to its final location. You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See: https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. An external file store must be set up and enable_direct_s3_uploads must be set to true for this endpoint to function. Available as a Mockzilla mock endpoint.
POST /uploads/create-multipart.json
Uploads
Creates a multipart external upload
Creates a multipart upload in the external storage provider, storing a temporary reference to the external upload similar to /get-presigned-put. You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See: https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. An external file store must be set up and enable_direct_s3_uploads must be set to true for this endpoint to function.
POST /uploads/generate-presigned-put.json
Uploads
Initiates a direct external upload
Direct external uploads bypass the usual method of creating uploads via the POST /uploads route, and upload directly to an external provider, which by default is S3. This route begins the process, and will return a unique identifier for the external upload as well as a presigned URL which is where the file binary blob should be uploaded to. Once the upload is complete to the external service, you must call the POST /complete-external-upload route using the unique identifier returned by this route, which will create any required Upload record in the Discourse database and also move file from its temporary location to the final destination in the external storage service. You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See: https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. An external file store must be set up and enable_direct_s3_uploads must be set to true for this endpoint to function.
GET /user-badges/{username}.json
BadgesUsers
List badges for a user
GET /user_actions.json
Users
Get a list of user actions
POST /user_avatar/{username}/refresh_gravatar.json
UsersAdmin
Refresh gravatar
POST /users.json
Users
Creates a user
PUT /users/password-reset/{token}.json
Users
Change password