Discourse API
Emulate the Discourse API in seconds. This page contains the documentation on how to use Discourse through API calls.
[01]
About
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
| GET |
/admin/backups.json
|
List backups
|
| POST |
/admin/backups.json
|
Create backup
|
| GET |
/admin/backups/{filename}
|
Download backup
|
| PUT |
/admin/backups/{filename}
|
Send download backup email
|
| GET |
/admin/badges.json
|
List badges
|
| POST |
/admin/badges.json
|
Create badge
|
| DEL |
/admin/badges/{id}.json
|
Delete badge
|
| PUT |
/admin/badges/{id}.json
|
Update badge
|
| POST |
/admin/groups.json
|
Create a group
|
| DEL |
/admin/groups/{id}.json
|
Delete a group
|
| GET |
/admin/users/list/{flag}.json
|
Get a list of users
|
| DEL |
/admin/users/{id}.json
|
Delete a user
|
| GET |
/admin/users/{id}.json
|
Get a user by id
|
| PUT |
/admin/users/{id}/anonymize.json
|
Anonymize a user
|
| POST |
/admin/users/{id}/log_out.json
|
Log a user out
|
| PUT |
/admin/users/{id}/silence.json
|
Silence a user
|
| PUT |
/admin/users/{id}/suspend.json
|
Suspend a user
|
| GET |
/c/{id}/show.json
|
Show category
|
| GET |
/c/{slug}/{id}.json
|
List topics
|
| GET |
/categories.json
|
Retrieves a list of categories
|
| POST |
/categories.json
|
Creates a category
|
| PUT |
/categories/{id}.json
|
Updates a category
|
| GET |
/directory_items.json
|
Get a public list of users
|
| GET |
/groups.json
|
List groups
|
| GET |
/groups/{id}.json
|
Get a group
|
| PUT |
/groups/{id}.json
|
Update a group
|
| DEL |
/groups/{id}/members.json
|
Remove group members
|
| GET |
/groups/{id}/members.json
|
List group members
|
| PUT |
/groups/{id}/members.json
|
Add group members
|
| POST |
/invites.json
|
Create an invite
|
| GET |
/latest.json
|
Get the latest topics
|
| 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
|
| GET |
/posts.json
|
List latest posts across topics
|
| POST |
/posts.json
|
Creates a new topic, a new post, or a private message
|
| DEL |
/posts/{id}.json
|
delete a single post
|
| GET |
/posts/{id}.json
|
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
|
Update a single post
|
| PUT |
/posts/{id}/locked.json
|
Lock a post from being edited
|
| GET |
/posts/{id}/replies.json
|
List replies to a post
|
| GET |
/search.json
|
Search for a term
|
| POST |
/session/forgot_password.json
|
Send password reset email
|
| GET |
/site.json
|
Get site info Can be used to fetch all categories and subcategories
|
| PUT |
/t/-/{id}.json
|
Update a topic
|
| GET |
/t/external_id/{external_id}.json
|
Get topic by external_id
|
| DEL |
/t/{id}.json
|
Remove a topic
|
| GET |
/t/{id}.json
|
Get a single topic
|
| PUT |
/t/{id}/bookmark.json
|
Bookmark topic
|
| PUT |
/t/{id}/change-timestamp.json
|
Update topic timestamp
|
| POST |
/t/{id}/invite.json
|
Invite to topic
|
| POST |
/t/{id}/notifications.json
|
Set notification level
|
| GET |
/t/{id}/posts.json
|
Get specific posts from a topic
|
| PUT |
/t/{id}/status.json
|
Update the status of a topic
|
| POST |
/t/{id}/timer.json
|
Create topic timer
|
| GET |
/tag/{name}.json
|
Get a specific tag
|
| 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
|
| PUT |
/tag_groups/{id}.json
|
Update tag group
|
| GET |
/tags.json
|
Get a list of tags
|
| GET |
/top.json
|
Get the top topics filtered by period
|
| GET |
/topics/private-messages-sent/{username}.json
|
Get a list of private messages sent for a user
|
| GET |
/topics/private-messages/{username}.json
|
Get a list of private messages for a user
|
| GET |
/u/by-external/{external_id}.json
|
Get a user by external_id
|
| GET |
/u/by-external/{provider}/{external_id}.json
|
Get a user by identity provider external ID
|
| GET |
/u/{username}.json
|
Get a single user by username
|
| PUT |
/u/{username}.json
|
Update a user
|
| GET |
/u/{username}/emails.json
|
Get email addresses belonging to a user
|
| PUT |
/u/{username}/preferences/avatar/pick.json
|
Update avatar
|
| PUT |
/u/{username}/preferences/email.json
|
Update email
|
| PUT |
/u/{username}/preferences/username.json
|
Update username
|
| POST |
/uploads.json
|
Creates an upload
|
| POST |
/uploads/abort-multipart.json
|
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
|
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
|
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
|
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
|
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
|
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
|
List badges for a user
|
| GET |
/user_actions.json
|
Get a list of user actions
|
| POST |
/user_avatar/{username}/refresh_gravatar.json
|
Refresh gravatar
|
| POST |
/users.json
|
Creates a user
|
| PUT |
/users/password-reset/{token}.json
|
Change password
|