diff --git a/.gitignore b/.gitignore index 03f5182..351d4e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules/ -dist/ +dist/* +!dist/schema.json *.log .env .DS_Store diff --git a/dist/schema.json b/dist/schema.json new file mode 100644 index 0000000..0a8fc46 --- /dev/null +++ b/dist/schema.json @@ -0,0 +1,7826 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Mastodon API", + "version": "4.2.0", + "description": "Documentation for the Mastodon API" + }, + "servers": [ + { + "url": "https://mastodon.example", + "description": "Production server" + } + ], + "paths": { + "/api/v1/accounts": { + "post": { + "summary": "Register an account", + "description": "Creates a user and account records. Returns an account access token for the app that initiated the request. The app should save this token for later, and should wait for the user to confirm their account by clicking a link in their email inbox.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string", + "description": "String. The desired username for the account" + }, + "email": { + "type": "string", + "description": "String. The email address to be used for login" + }, + "password": { + "type": "string", + "description": "String. The password to be used for login" + }, + "agreement": { + "type": "string", + "description": "Boolean. Whether the user agrees to the local rules, terms, and policies. These should be presented to the user in order to allow them to consent before setting this parameter to TRUE." + }, + "locale": { + "type": "string", + "description": "String. The language of the confirmation email that will be sent." + }, + "reason": { + "type": "string", + "description": "String. If registrations require manual approval, this text will be reviewed by moderators." + }, + "date_of_birth": { + "type": "string", + "description": "String (), required if the server has a minimum age requirement." + } + }, + "required": [ + "date_of_birth" + ] + } + } + } + } + }, + "get": { + "summary": "Get multiple accounts", + "description": "View information about multiple profiles.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + } + } + }, + "/api/v1/accounts/verify_credentials": { + "get": { + "summary": "Verify account credentials", + "description": "Test to make sure that the user token works.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/accounts/update_credentials": { + "patch": { + "summary": "Update account credentials", + "description": "Update the user's display and preferences.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "display_name": { + "type": "string", + "description": "String. The display name to use for the profile." + }, + "note": { + "type": "string", + "description": "String. The account bio." + }, + "avatar": { + "type": "string", + "description": "Avatar image encoded using `multipart/form-data`" + }, + "header": { + "type": "string", + "description": "Header image encoded using `multipart/form-data`" + }, + "locked": { + "type": "string", + "description": "Boolean. Whether manual approval of follow requests is required." + }, + "bot": { + "type": "string", + "description": "Boolean. Whether the account has a bot flag." + }, + "discoverable": { + "type": "string", + "description": "Boolean. Whether the account should be shown in the profile directory." + }, + "hide_collections": { + "type": "string", + "description": "Boolean. Whether to hide followers and followed accounts." + }, + "indexable": { + "type": "string", + "description": "Boolean. Whether public posts should be searchable to anyone." + }, + "fields_attributes": { + "type": "string", + "description": "Hash. The profile fields to be set. Inside this hash, the key is an integer cast to a string (although the exact integer does not matter), and the value is another hash including `name` and `value`. By default, max 4 fields." + } + }, + "required": [ + "locked" + ] + } + } + } + } + } + }, + "/api/v1/accounts/{id}": { + "get": { + "summary": "Get account", + "description": "View information about a profile.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/statuses": { + "get": { + "summary": "Get account's statuses", + "description": "Statuses posted to the given account.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/followers": { + "get": { + "summary": "Get account's followers", + "description": "Accounts which follow the given account, if network is not hidden by the account owner.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/following": { + "get": { + "summary": "Get account's following", + "description": "Accounts which the given account is following, if network is not hidden by the account owner.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/featured_tags": { + "get": { + "summary": "Get account's featured tags", + "description": "Tags featured by this account.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/lists": { + "get": { + "summary": "Get lists containing this account", + "description": "User lists that you have added this account to.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/follow": { + "post": { + "summary": "Follow account", + "description": "Follow the given account. Can also be used to update whether to show reblogs or enable notifications.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "reblogs": { + "type": "string", + "description": "Boolean. Receive this account's reblogs in home timeline? Defaults to true." + }, + "notify": { + "type": "string", + "description": "Boolean. Receive notifications when this account posts a status? Defaults to false." + } + } + } + } + } + } + } + }, + "/api/v1/accounts/{id}/unfollow": { + "post": { + "summary": "Unfollow account", + "description": "Unfollow the given account.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/remove_from_followers": { + "post": { + "summary": "Remove account from followers", + "description": "Remove the given account from your followers.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/block": { + "post": { + "summary": "Block account", + "description": "Block the given account. Clients should filter statuses from this account if received (e.g. due to a boost in the Home timeline)", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/unblock": { + "post": { + "summary": "Unblock account", + "description": "Unblock the given account.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/mute": { + "post": { + "summary": "Mute account", + "description": "Mute the given account. Clients should filter statuses and notifications from this account, if received (e.g. due to a boost in the Home timeline).", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "notifications": { + "type": "string", + "description": "Boolean. Mute notifications in addition to statuses? Defaults to true." + }, + "duration": { + "type": "string", + "description": "Number. How long the mute should last, in seconds. Defaults to 0 (indefinite)." + } + } + } + } + } + } + } + }, + "/api/v1/accounts/{id}/unmute": { + "post": { + "summary": "Unmute account", + "description": "Unmute the given account.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/endorsements": { + "get": { + "summary": "Get featured accounts", + "description": "Accounts that the user is currently featuring on their profile.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/endorse": { + "post": { + "summary": "Feature account on your profile", + "description": "Add the given account to the user's featured profiles.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/unendorse": { + "post": { + "summary": "Unfeature account from profile", + "description": "Remove the given account from the user's featured profiles.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/accounts/{id}/note": { + "post": { + "summary": "Set private note on profile", + "description": "Sets a private note on a user.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "String. The comment to be set on that user. Provide an empty string or leave out this parameter to clear the currently set note." + } + } + } + } + } + } + } + }, + "/api/v1/accounts/relationships": { + "get": { + "summary": "Check relationships to other accounts", + "description": "Find out whether a given account is followed, blocked, muted, etc.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/accounts/familiar_followers": { + "get": { + "summary": "Find familiar followers", + "description": "Obtain a list of all accounts that follow a given account, filtered for accounts you follow.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/accounts/search": { + "get": { + "summary": "Search for matching accounts", + "description": "Search for matching accounts by username or display name.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/accounts/lookup": { + "get": { + "summary": "Lookup account ID from Webfinger address", + "description": "Quickly lookup a username to see if it is available, skipping WebFinger resolution.", + "tags": [ + "accounts API methods" + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/announcements": { + "get": { + "summary": "View all announcements", + "description": "See all currently active announcements set by admins.", + "tags": [ + "announcements API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/announcements/{id}/dismiss": { + "post": { + "summary": "Dismiss an announcement", + "description": "Allows a user to mark the announcement as read.", + "tags": [ + "announcements API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/announcements/{id}/reactions/{name}": { + "put": { + "summary": "Add a reaction to an announcement", + "description": "React to an announcement with an emoji.", + "tags": [ + "announcements API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "name parameter", + "schema": { + "type": "string" + } + } + ] + }, + "delete": { + "summary": "Remove a reaction from an announcement", + "description": "Undo a react emoji to an announcement.", + "tags": [ + "announcements API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "name parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/apps": { + "post": { + "summary": "Create an application", + "description": "Create a new application to obtain OAuth2 credentials.", + "tags": [ + "apps API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "client_name": { + "type": "string", + "description": "String. A name for your application" + }, + "redirect_uris": { + "type": "string", + "description": "String or Array of Strings. Where the user should be redirected after authorization. To display the authorization code to the user instead of redirecting to a web page, use `urn:ietf:wg:oauth:2.0:oob` in this parameter." + }, + "scopes": { + "type": "string", + "description": "String. Space separated list of scopes. If none is provided, defaults to `read`. See for a list of possible scopes." + }, + "website": { + "type": "string", + "description": "String. A URL to the homepage of your app" + } + } + } + } + } + } + } + }, + "/api/v1/apps/verify_credentials": { + "get": { + "summary": "Verify your app works", + "description": "Confirm that the app's OAuth2 credentials work.", + "tags": [ + "apps API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/blocks": { + "get": { + "summary": "View blocked users", + "description": "##### 401: Unauthorized", + "tags": [ + "blocks API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/bookmarks": { + "get": { + "summary": "View bookmarked statuses", + "description": "Statuses the user has bookmarked.", + "tags": [ + "bookmarks API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/conversations": { + "get": { + "summary": "View all conversations", + "description": "##### 401: Unauthorized", + "tags": [ + "conversations API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/conversations/{id}": { + "delete": { + "summary": "Remove a conversation", + "description": "Removes a conversation from your list of conversations.", + "tags": [ + "conversations API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/conversations/{id}/read": { + "post": { + "summary": "Mark a conversation as read", + "description": "", + "tags": [ + "conversations API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/custom_emojis": { + "get": { + "summary": "View all custom emoji", + "description": "Returns custom emojis that are available on the server.", + "tags": [ + "custom_emojis API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + } + } + }, + "/api/v1/directory": { + "get": { + "summary": "View profile directory", + "description": "List accounts visible in the directory.", + "tags": [ + "directory API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + } + } + }, + "/api/v1/domain_blocks": { + "get": { + "summary": "Get domain blocks", + "description": "View domains the user has blocked.", + "tags": [ + "domain_blocks API methods" + ], + "responses": { + "200": { + "description": "Array of String" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + }, + "post": { + "summary": "Block a domain", + "description": "Block a domain to:", + "tags": [ + "domain_blocks API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "String. Domain to block." + } + } + } + } + } + } + }, + "delete": { + "summary": "Unblock a domain", + "description": "Remove a domain block, if it exists in the user's array of blocked domains.", + "tags": [ + "domain_blocks API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "String. Domain to unblock." + } + } + } + } + } + } + } + }, + "/api/v1/emails/confirmations": { + "post": { + "summary": "Resend confirmation email", + "description": "Resend a new confirmation email. If an email is provided, updates the unconfirmed user's email before resending the confirmation email.", + "tags": [ + "emails API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "String. If provided, updates the unconfirmed user's email before resending the confirmation email." + } + } + } + } + } + } + } + }, + "/api/v1/endorsements": { + "get": { + "summary": "View currently featured profiles", + "description": "Accounts that the user is currently featuring on their profile.", + "tags": [ + "endorsements API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/favourites": { + "get": { + "summary": "View favourited statuses", + "description": "Statuses the user has favourited.", + "tags": [ + "favourites API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/featured_tags": { + "get": { + "summary": "View your featured tags", + "description": "List all hashtags featured on your profile.", + "tags": [ + "featured_tags API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + }, + "post": { + "summary": "Feature a tag", + "description": "Promote a hashtag on your profile.", + "tags": [ + "featured_tags API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "String. The hashtag to be featured, without the hash sign." + } + } + } + } + } + } + } + }, + "/api/v1/featured_tags/{id}": { + "delete": { + "summary": "Unfeature a tag", + "description": "Stop promoting a hashtag on your profile.", + "tags": [ + "featured_tags API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/featured_tags/suggestions": { + "get": { + "summary": "View suggested tags to feature", + "description": "Shows up to 10 recently-used tags.", + "tags": [ + "featured_tags API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2/filters": { + "get": { + "summary": "Server-side (v2) methods", + "description": "Obtain a list of all filter groups for the current user.", + "tags": [ + "filters API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "title", + "in": "query", + "description": "String. The name of the filter group.", + "schema": { + "type": "string" + } + }, + { + "name": "filter_action", + "in": "query", + "description": "String. The policy to be applied when the filter is matched. Specify `warn`, `hide` or `blur`.", + "schema": { + "type": "string" + } + }, + { + "name": "expires_in", + "in": "query", + "description": "Integer. How many seconds from now should the filter expire?", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/filters": { + "get": { + "summary": "Client-side (v1) methods", + "description": "Replaces a filter's parameters in-place.", + "tags": [ + "filters API methods" + ], + "responses": { + "200": { + "description": "List of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "phrase", + "in": "query", + "description": "String. The text to be filtered.", + "schema": { + "type": "string" + } + }, + { + "name": "irreversible", + "in": "query", + "description": "Boolean. Should the server irreversibly drop matching entities from home and notifications? Defaults to false.", + "schema": { + "type": "string" + } + }, + { + "name": "whole_word", + "in": "query", + "description": "Boolean. Should the filter consider word boundaries for this keyword? Defaults to false.", + "schema": { + "type": "string" + } + }, + { + "name": "expires_in", + "in": "query", + "description": "Integer. Number of seconds from now that the filter should expire. Otherwise, `null` for a filter that doesn't expire.", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/follow_requests": { + "get": { + "summary": "View pending follow requests", + "description": "##### 401: Unauthorized", + "tags": [ + "follow_requests API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/follow_requests/{account_id}/authorize": { + "post": { + "summary": "Accept follow request", + "description": "", + "tags": [ + "follow_requests API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "path", + "required": true, + "description": "account_id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/follow_requests/{account_id}/reject": { + "post": { + "summary": "Reject follow request", + "description": "", + "tags": [ + "follow_requests API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "path", + "required": true, + "description": "account_id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/followed_tags": { + "get": { + "summary": "View all followed tags", + "description": "List your followed hashtags.", + "tags": [ + "followed_tags API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2/notifications": { + "get": { + "summary": "Get all grouped notifications", + "description": "Return grouped notifications concerning the user. This API returns Link headers containing links to the next/previous page. However, the links can also be constructed dynamically using query params and `id` values.", + "tags": [ + "Grouped notifications API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2/notifications/{group_key}": { + "get": { + "summary": "Get a single notification group", + "description": "View information about a specific notification group with a given group key.", + "tags": [ + "Grouped notifications API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "group_key", + "in": "path", + "required": true, + "description": "group_key parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v2/notifications/{group_key}/dismiss": { + "post": { + "summary": "Dismiss a single notification group", + "description": "Dismiss a single notification group from the server.", + "tags": [ + "Grouped notifications API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "group_key", + "in": "path", + "required": true, + "description": "group_key parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v2/notifications/{group_key}/accounts": { + "get": { + "summary": "Get accounts of all notifications in a notification group", + "description": "", + "tags": [ + "Grouped notifications API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "group_key", + "in": "path", + "required": true, + "description": "group_key parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v2/notifications/unread_count": { + "get": { + "summary": "Get the number of unread notifications", + "description": "Get the (capped) number of unread notification groups for the current user.", + "tags": [ + "Grouped notifications API methods" + ], + "responses": { + "200": { + "description": "Hash with a single key of `count`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2/instance": { + "get": { + "summary": "View server information", + "description": "Obtain general information about the server.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/instance/peers": { + "get": { + "summary": "List of connected domains", + "description": "Domains that this instance is aware of.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Array of String" + } + } + } + }, + "/api/v1/instance/activity": { + "get": { + "summary": "Weekly activity", + "description": "Instance activity over the last 3 months, binned weekly.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Array of Hash" + } + } + } + }, + "/api/v1/instance/rules": { + "get": { + "summary": "List of rules", + "description": "Rules that the users of this service should follow.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + } + } + }, + "/api/v1/instance/domain_blocks": { + "get": { + "summary": "View moderated servers", + "description": "Obtain a list of domains that have been blocked.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/instance/extended_description": { + "get": { + "summary": "View extended description", + "description": "Obtain an extended description of this server", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/instance/privacy_policy": { + "get": { + "summary": "View privacy policy", + "description": "Obtain the contents of this server's privacy policy.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/instance/terms_of_service": { + "get": { + "summary": "View terms of service", + "description": "Obtain the contents of this server's terms of service, if configured.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/api/v1/instance/terms_of_service/{date}": { + "get": { + "summary": "View a specific version of the terms of service", + "description": "Obtain the contents of this server's terms of service, for a specified date, if configured.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "parameters": [ + { + "name": "date", + "in": "path", + "required": true, + "description": "date parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/instance/translation_languages": { + "get": { + "summary": "View translation languages", + "description": "Translation language pairs supported by the translation engine used by the server.", + "tags": [ + "instance API methods" + ], + "responses": { + "200": { + "description": "Object with source language codes as keys and arrays of target language codes as values." + } + } + } + }, + "/api/v1/lists": { + "get": { + "summary": "View your lists", + "description": "Fetch all lists that the user owns.", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + }, + "post": { + "summary": "Create a list", + "description": "Create a new list.", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "String. The title of the list to be created." + }, + "replies_policy": { + "type": "string", + "description": "String. One of `followed`, `list`, or `none`. Defaults to `list`." + }, + "exclusive": { + "type": "string", + "description": "Boolean. Whether members of this list need to get removed from the “Home” feed" + } + } + } + } + } + } + } + }, + "/api/v1/lists/{id}": { + "get": { + "summary": "Show a single list", + "description": "Fetch the list with the given ID. Used for verifying the title of a list, and which replies to show within that list.", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "put": { + "summary": "Update a list", + "description": "Change the title of a list, or which replies to show.", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "String. The title of the list to be created." + }, + "replies_policy": { + "type": "string", + "description": "String. One of `followed`, `list`, or `none`. Defaults to `list`." + }, + "exclusive": { + "type": "string", + "description": "Boolean. Whether members of this list need to get removed from the “Home” feed" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete a list", + "description": "", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/lists/{id}/accounts": { + "get": { + "summary": "View accounts in a list", + "description": "##### 401: Unauthorized", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "post": { + "summary": "Add accounts to a list", + "description": "Add accounts to the given list. Note that the user must be following these accounts.", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "delete": { + "summary": "Remove accounts from list", + "description": "Remove accounts from the given list.", + "tags": [ + "lists API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/markers": { + "get": { + "summary": "Get saved timeline positions", + "description": "Get current positions in timelines.", + "tags": [ + "markers API methods" + ], + "responses": { + "200": { + "description": "Hash of timeline key and associated" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + }, + "post": { + "summary": "Save your position in a timeline", + "description": "Save current position in timeline.", + "tags": [ + "markers API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2/media": { + "post": { + "summary": "Upload media as an attachment (async)", + "description": "Creates a media attachment to be used with a new status. The full sized media will be processed asynchronously in the background for large uploads.", + "tags": [ + "media API methods" + ], + "responses": { + "200": { + "description": ", but without a URL" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "description": "Object. The file to be attached, encoded using multipart form data. The file must have a MIME type." + }, + "thumbnail": { + "type": "string", + "description": "Object. The custom thumbnail of the media to be attached, encoded using multipart form data." + }, + "description": { + "type": "string", + "description": "String. A plain-text description of the media, for accessibility purposes." + }, + "focus": { + "type": "string", + "description": "String. Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0. See for more information." + } + } + } + } + } + } + } + }, + "/api/v1/media/{id}": { + "get": { + "summary": "Get media attachment", + "description": "Get a media attachment, before it is attached to a status and posted, but after it is accepted for processing. Use this method to check that the full-sized media has finished processing.", + "tags": [ + "media API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "delete": { + "summary": "Delete media attachment", + "description": "Delete a media attachment that is not currently attached to a status.", + "tags": [ + "media API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "put": { + "summary": "Update media attachment", + "description": "Update a MediaAttachment's parameters, before it is attached to a status and posted.", + "tags": [ + "media API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "thumbnail": { + "type": "string", + "description": "Object. The custom thumbnail of the media to be attached, encoded using multipart form data." + }, + "description": { + "type": "string", + "description": "String. A plain-text description of the media, for accessibility purposes." + }, + "focus": { + "type": "string", + "description": "String. Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0. See for more information." + } + } + } + } + } + } + } + }, + "/api/v1/mutes": { + "get": { + "summary": "View muted accounts", + "description": "Accounts the user has muted.", + "tags": [ + "mutes API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/notifications": { + "get": { + "summary": "Get all notifications", + "description": "Notifications concerning the user. This API returns Link headers containing links to the next/previous page. However, the links can also be constructed dynamically using query params and `id` values.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/notifications/{id}": { + "get": { + "summary": "Get a single notification", + "description": "View information about a notification with a given ID.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/notifications/clear": { + "post": { + "summary": "Dismiss all notifications", + "description": "Clear all notifications from the server.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/notifications/{id}/dismiss": { + "post": { + "summary": "Dismiss a single notification", + "description": "Dismiss a single notification from the server.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "String. The ID of the notification in the database." + } + } + } + } + } + } + } + }, + "/api/v1/notifications/unread_count": { + "get": { + "summary": "Get the number of unread notifications", + "description": "Get the (capped) number of unread notifications for the current user.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Hash with a single key of `count`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2/notifications/policy": { + "get": { + "summary": "Get the filtering policy for notifications", + "description": "Notifications filtering policy for the user.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/notifications/requests": { + "get": { + "summary": "Get all notification requests", + "description": "Notification requests for notifications filtered by the user's policy. This API returns Link headers containing links to the next/previous page.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/notifications/requests/{id}": { + "get": { + "summary": "Get a single notification request", + "description": "View information about a notification request with a given ID.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/notifications/requests/{id}/accept": { + "post": { + "summary": "Accept a single notification request", + "description": "Accept a notification request, which merges the filtered notifications from that user back into the main notification and accepts any future notification from them.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/notifications/requests/{id}/dismiss": { + "post": { + "summary": "Dismiss a single notification request", + "description": "Dismiss a notification request, which hides it and prevent it from contributing to the pending notification requests count.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/notifications/requests/accept": { + "post": { + "summary": "Accept multiple notification requests", + "description": "Accepts multiple notification requests, which merges the filtered notifications from those users back into the main notifications and accepts any future notification from them.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/notifications/requests/dismiss": { + "post": { + "summary": "Dismiss multiple notification requests", + "description": "Dismiss multiple notification requests, which hides them and prevent them from contributing to the pending notification requests count.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/notifications/requests/merged": { + "get": { + "summary": "Check if accepted notification requests have been merged", + "description": "Check whether accepted notification requests have been merged.", + "tags": [ + "notifications API methods" + ], + "responses": { + "200": { + "description": "Hash with a single boolean attribute `merged`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2_alpha/notifications": { + "get": { + "summary": "Get all grouped notifications", + "description": "Return grouped notifications concerning the user. This API returns Link headers containing links to the next/previous page. However, the links can also be constructed dynamically using query params and `id` values.", + "tags": [ + "notifications API alpha methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2_alpha/notifications/{group_key}": { + "get": { + "summary": "Get a single notification group", + "description": "View information about a specific notification group with a given group key.", + "tags": [ + "notifications API alpha methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "group_key", + "in": "path", + "required": true, + "description": "group_key parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v2_alpha/notifications/{group_key}/dismiss": { + "post": { + "summary": "Dismiss a single notification group", + "description": "Dismiss a single notification group from the server.", + "tags": [ + "notifications API alpha methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "group_key", + "in": "path", + "required": true, + "description": "group_key parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v2_alpha/notifications/unread_count": { + "get": { + "summary": "Get the number of unread notifications", + "description": "Get the (capped) number of unread notification groups for the current user.", + "tags": [ + "notifications API alpha methods" + ], + "responses": { + "200": { + "description": "Hash with a single key of `count`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/oauth/authorize": { + "get": { + "summary": "Authorize a user", + "description": "Displays an authorization form to the user. If approved, it will create and return an authorization code, then redirect to the desired `redirect_uri`, or show the authorization code if `urn:ietf:wg:oauth:2.0:oob` was requested. The authorization code can be used while requesting a token to obtain access to user-level methods.", + "tags": [ + "OAuth API methods" + ], + "responses": { + "200": { + "description": "String (URL) or HTML response" + } + } + } + }, + "/oauth/token": { + "post": { + "summary": "Obtain a token", + "description": "Obtain an access token, to be used during API calls that are not public.", + "tags": [ + "OAuth API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "grant_type": { + "type": "string", + "description": "String. Set equal to `authorization_code` if `code` is provided in order to gain user-level access. Otherwise, set equal to `client_credentials` to obtain app-level access only." + }, + "code": { + "type": "string", + "description": "String. A user authorization code, obtained from the redirect after an is approved. May alternatively be displayed to the user if `urn:ietf:wg:oauth:2.0:oob` is used as the `redirect_uri`." + }, + "client_id": { + "type": "string", + "description": "String. The client ID, obtained during app registration." + }, + "client_secret": { + "type": "string", + "description": "String. The client secret, obtained during app registration." + }, + "redirect_uri": { + "type": "string", + "description": "String. Must match the `redirect_uri` used during the ." + }, + "code_verifier": { + "type": "string", + "description": "String. Required if is used during the authorization request. This is the code verifier which was used to create the `code_challenge` using the `code_challenge_method` for the authorization request." + }, + "scope": { + "type": "string", + "description": "String. When `grant_type` is set to `client_credentials`, the list of requested OAuth scopes, separated by spaces (or pluses, if using query parameters). Must be a subset of the scopes requested at the time the application was created. If omitted, it defaults to `read`. Has no effect when `grant_type` is `authorization_code`." + } + } + } + } + } + } + } + }, + "/oauth/revoke": { + "post": { + "summary": "Revoke a token", + "description": "Revoke an access token to make it no longer valid for use.", + "tags": [ + "OAuth API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "client_id": { + "type": "string", + "description": "String. The client ID, obtained during app registration." + }, + "client_secret": { + "type": "string", + "description": "String. The client secret, obtained during app registration." + }, + "token": { + "type": "string", + "description": "String. The previously obtained token, to be invalidated." + } + } + } + } + } + } + } + }, + "/.well-known/oauth-authorization-server": { + "get": { + "summary": "Discover OAuth Server Configuration", + "description": "Returns the OAuth 2 Authorization Server Metadata for the Mastodon server, as defined by [RFC 8414](https://datatracker.ietf.org/doc/html/rfc8414#section-3.2).", + "tags": [ + "OAuth API methods" + ], + "responses": { + "200": { + "description": "JSON as per the above description" + } + } + } + }, + "/api/oembed": { + "get": { + "summary": "Get OEmbed info as JSON", + "description": "", + "tags": [ + "oembed API methods" + ], + "responses": { + "200": { + "description": "OEmbed metadata" + } + } + } + }, + "/api/v1/polls/{id}": { + "get": { + "summary": "View a poll", + "description": "View a poll attached to a status.", + "tags": [ + "polls API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/polls/{id}/votes": { + "post": { + "summary": "Vote on a poll", + "description": "Vote on a poll attached to a status.", + "tags": [ + "polls API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/preferences": { + "get": { + "summary": "View user preferences", + "description": "Preferences defined by the user in their account settings.", + "tags": [ + "preferences API methods" + ], + "responses": { + "200": { + "description": "Preferences by key and value" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/push/subscription": { + "post": { + "summary": "Subscribe to push notifications", + "description": "Add a Web Push API subscription to receive notifications. Each access token can have one push subscription. If you create a new subscription, the old subscription is deleted.", + "tags": [ + "push API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + }, + "get": { + "summary": "Get current subscription", + "description": "View the PushSubscription currently associated with this access token.", + "tags": [ + "push API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + }, + "put": { + "summary": "Change types of notifications", + "description": "Updates the current push subscription. Only the data part can be updated. To change fundamentals, a new subscription must be created instead.", + "tags": [ + "push API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "policy": { + "type": "string", + "description": "String. Specify whether to receive push notifications from `all`, `followed`, `follower`, or `none` users." + } + } + } + } + } + } + }, + "delete": { + "summary": "Remove current subscription", + "description": "Removes the current Web Push API subscription.", + "tags": [ + "push API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/reports": { + "post": { + "summary": "File a report", + "description": "", + "tags": [ + "reports API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "account_id": { + "type": "string", + "description": "String. ID of the account to report." + }, + "comment": { + "type": "string", + "description": "String. The reason for the report. Default maximum of 1000 characters." + }, + "forward": { + "type": "string", + "description": "Boolean. If the account is remote, should the report be forwarded to the remote admin? Defaults to false." + }, + "category": { + "type": "string", + "description": "String. Specify if the report is due to `spam`, `legal` (illegal content), `violation` of enumerated instance rules, or some `other` reason. Defaults to `other`. Will be set to `violation` if `rule_ids[]` is provided (regardless of any category value you provide)." + } + } + } + } + } + } + } + }, + "/api/v1/scheduled_statuses": { + "get": { + "summary": "View scheduled statuses", + "description": "", + "tags": [ + "scheduled_statuses API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/scheduled_statuses/{id}": { + "get": { + "summary": "View a single scheduled status", + "description": "", + "tags": [ + "scheduled_statuses API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "put": { + "summary": "Update a scheduled status's publishing date", + "description": "", + "tags": [ + "scheduled_statuses API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "scheduled_at": { + "type": "string", + "description": "String. at which the status will be published. Must be at least 5 minutes into the future." + } + } + } + } + } + } + }, + "delete": { + "summary": "Cancel a scheduled status", + "description": "", + "tags": [ + "scheduled_statuses API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v2/search": { + "get": { + "summary": "Perform a search", + "description": "", + "tags": [ + "search API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/statuses": { + "post": { + "summary": "Post a new status", + "description": "Publish a status with the given parameters.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": ". When `scheduled_at` is present, is returned instead." + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "String. The text content of the status. If `media_ids` is provided, this becomes optional. Attaching a `poll` is optional while `status` is provided." + }, + "in_reply_to_id": { + "type": "string", + "description": "String. ID of the status being replied to, if status is a reply." + }, + "sensitive": { + "type": "string", + "description": "Boolean. Mark status and attached media as sensitive? Defaults to false." + }, + "spoiler_text": { + "type": "string", + "description": "String. Text to be shown as a warning or subject before the actual content. Statuses are generally collapsed behind this field." + }, + "visibility": { + "type": "string", + "description": "String. Sets the visibility of the posted status to `public`, `unlisted`, `private`, `direct`." + }, + "language": { + "type": "string", + "description": "String. ISO 639 language code for this status." + }, + "scheduled_at": { + "type": "string", + "description": "String. at which to schedule a status. Providing this parameter will cause ScheduledStatus to be returned instead of Status. Must be at least 5 minutes in the future." + } + } + } + } + } + } + }, + "get": { + "summary": "View multiple statuses", + "description": "Obtain information about multiple statuses.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/statuses/{id}": { + "get": { + "summary": "View a single status", + "description": "Obtain information about a status.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "delete": { + "summary": "Delete a status", + "description": "Delete one of your own statuses.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "with source `text` and `poll` or `media_attachments`" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + }, + "put": { + "summary": "Edit a status", + "description": "Edit a given status to change its text, sensitivity, media attachments, or poll. Note that editing a poll's options will reset the votes.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "String. The plain text content of the status." + }, + "spoiler_text": { + "type": "string", + "description": "String. The plain text subject or content warning of the status." + }, + "sensitive": { + "type": "string", + "description": "Boolean. Whether the status should be marked as sensitive." + }, + "language": { + "type": "string", + "description": "String. ISO 639 language code for the status." + } + } + } + } + } + } + } + }, + "/api/v1/statuses/{id}/context": { + "get": { + "summary": "Get parent and child statuses in context", + "description": "View statuses above and below this status in the thread.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/translate": { + "post": { + "summary": "Translate a status", + "description": "Translate the status content into some language.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "lang": { + "type": "string", + "description": "String (ISO 639 language code). The status content will be translated into this language. Defaults to the user's current locale." + } + } + } + } + } + } + } + }, + "/api/v1/statuses/{id}/reblogged_by": { + "get": { + "summary": "See who boosted a status", + "description": "View who boosted a given status.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/favourited_by": { + "get": { + "summary": "See who favourited a status", + "description": "View who favourited a given status.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/favourite": { + "post": { + "summary": "Favourite a status", + "description": "Add a status to your favourites list.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/unfavourite": { + "post": { + "summary": "Undo favourite of a status", + "description": "Remove a status from your favourites list.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/reblog": { + "post": { + "summary": "Boost a status", + "description": "Reshare a status on your own profile.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Form data parameters", + "required": false, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "type": "object", + "properties": { + "visibility": { + "type": "string", + "description": "String. Any visibility except `limited` or `direct` (i.e. `public`, `unlisted`, `private`). Defaults to public." + } + } + } + } + } + } + } + }, + "/api/v1/statuses/{id}/unreblog": { + "post": { + "summary": "Undo boost of a status", + "description": "Undo a reshare of a status.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/bookmark": { + "post": { + "summary": "Bookmark a status", + "description": "Privately bookmark a status.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/unbookmark": { + "post": { + "summary": "Undo bookmark of a status", + "description": "Remove a status from your private bookmarks.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/mute": { + "post": { + "summary": "Mute a conversation", + "description": "Do not receive notifications for the thread that this status is part of. Must be a thread in which you are a participant.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/unmute": { + "post": { + "summary": "Unmute a conversation", + "description": "Start receiving notifications again for the thread that this status is part of.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/pin": { + "post": { + "summary": "Pin status to profile", + "description": "Feature one of your own public statuses at the top of your profile.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/unpin": { + "post": { + "summary": "Unpin status from profile", + "description": "Unfeature a status from the top of your profile.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/history": { + "get": { + "summary": "View edit history of a status", + "description": "Get all known versions of a status, including the initial and current states.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/statuses/{id}/source": { + "get": { + "summary": "View status source", + "description": "Obtain the source properties for a status so that it can be edited.", + "tags": [ + "statuses" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/streaming/health": { + "get": { + "summary": "Check if the server is alive", + "description": "Verify that the streaming service is alive before connecting to it", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "String" + } + } + } + }, + "/api/v1/streaming/user": { + "get": { + "summary": "Watch your home timeline and notifications", + "description": "Returns events that are relevant to the authorized user, i.e. home timeline and notifications", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`update`, `delete`, `notification`, `filters_changed`, `announcement`, `announcement.reaction`, `announcement.delete`, `status.update`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/user/notification": { + "get": { + "summary": "Watch your notifications", + "description": "Returns events for received notifications", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`notification`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/public": { + "get": { + "summary": "Watch the federated timeline", + "description": "Returns all public statuses", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`update`, `delete`, `status.update`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/public/local": { + "get": { + "summary": "Watch the local timeline", + "description": "Returns all local public statuses", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`update`, `delete`, `status.update`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/public/remote": { + "get": { + "summary": "Watch for remote statuses", + "description": "Returns all public statuses from remote servers.", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`update`, `delete`, `status.update`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/hashtag": { + "get": { + "summary": "Watch the public timeline for a hashtag", + "description": "Returns all public statuses for a particular hashtag", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`update`, `delete`, `status.update`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/hashtag/local": { + "get": { + "summary": "Watch the local timeline for a hashtag", + "description": "Returns all local public statuses for a particular hashtag", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`update`, `delete`, `status.update`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/list": { + "get": { + "summary": "Watch for list updates", + "description": "Returns statuses for a list", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`update`, `delete`, `status.update`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/streaming/direct": { + "get": { + "summary": "Watch for direct messages", + "description": "Returns events for received direct messages.", + "tags": [ + "streaming API methods" + ], + "responses": { + "200": { + "description": "`conversation`" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v2/suggestions": { + "get": { + "summary": "View follow suggestions (v2)", + "description": "Accounts that are promoted by staff, or that the user has had past positive interactions with, but is not yet following.", + "tags": [ + "suggestions API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/suggestions/{account_id}": { + "delete": { + "summary": "Remove a suggestion", + "description": "Remove an account from follow suggestions.", + "tags": [ + "suggestions API methods" + ], + "responses": { + "200": { + "description": "Empty" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "account_id", + "in": "path", + "required": true, + "description": "account_id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/tags/{id}": { + "get": { + "summary": "View information about a single tag", + "description": "Show a hashtag and its associated information", + "tags": [ + "tags API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/tags/{id}/follow": { + "post": { + "summary": "Follow a hashtag", + "description": "Follow a hashtag. Posts containing a followed hashtag will be inserted into your home timeline.", + "tags": [ + "tags API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/tags/{id}/unfollow": { + "post": { + "summary": "Unfollow a hashtag", + "description": "Unfollow a hashtag. Posts containing this hashtag will no longer be inserted into your home timeline.", + "tags": [ + "tags API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/tags/{id}/feature": { + "post": { + "summary": "Feature a hashtag", + "description": "Feature the hashtag on your profile.", + "tags": [ + "tags API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/tags/{id}/unfeature": { + "post": { + "summary": "Unfeature a hashtag", + "description": "Stop featuring the hashtag on your profile.", + "tags": [ + "tags API methods" + ], + "responses": { + "200": { + "description": "Success" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/timelines/public": { + "get": { + "summary": "View public timeline", + "description": "View public statuses.", + "tags": [ + "timelines API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/timelines/tag/{hashtag}": { + "get": { + "summary": "View hashtag timeline", + "description": "View public statuses containing the given hashtag.", + "tags": [ + "timelines API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "hashtag", + "in": "path", + "required": true, + "description": "hashtag parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/timelines/home": { + "get": { + "summary": "View home timeline", + "description": "View statuses from followed users and hashtags.", + "tags": [ + "timelines API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ] + } + }, + "/api/v1/timelines/link?url={url}": { + "get": { + "summary": "View link timeline", + "description": "View public statuses containing a link to the specified currently-trending article. This only lists statuses from people who have opted in to discoverability features.", + "tags": [ + "timelines API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "url", + "in": "path", + "required": true, + "description": "url parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/timelines/list/{list_id}": { + "get": { + "summary": "View list timeline", + "description": "View statuses in the given list timeline.", + "tags": [ + "timelines API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + }, + "security": [ + { + "OAuth2": [] + } + ], + "parameters": [ + { + "name": "list_id", + "in": "path", + "required": true, + "description": "list_id parameter", + "schema": { + "type": "string" + } + } + ] + } + }, + "/api/v1/trends/tags": { + "get": { + "summary": "View trending tags", + "description": "Tags that are being used more frequently within the past week.", + "tags": [ + "trends API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + } + } + }, + "/api/v1/trends/statuses": { + "get": { + "summary": "View trending statuses", + "description": "Statuses that have been interacted with more than others.", + "tags": [ + "trends API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + } + } + }, + "/api/v1/trends/links": { + "get": { + "summary": "View trending links", + "description": "Links that have been shared more than others.", + "tags": [ + "trends API methods" + ], + "responses": { + "200": { + "description": "Array of" + } + } + } + } + }, + "components": { + "schemas": { + "Account": { + "type": "object", + "description": "Represents a user of Mastodon and their associated profile.", + "properties": { + "id": { + "description": "The account id.", + "type": "string" + }, + "username": { + "description": "The username of the account, not including domain.", + "type": "string" + }, + "acct": { + "description": "The Webfinger account URI. Equal to `username` for local users, or `username@domain` for remote users.", + "type": "string" + }, + "url": { + "description": "The location of the user's profile page.", + "type": "string", + "format": "uri" + }, + "uri": { + "description": "The user's ActivityPub actor identifier.", + "type": "string", + "format": "uri" + }, + "display_name": { + "description": "The profile's display name.", + "type": "string" + }, + "note": { + "description": "The profile's bio or description.", + "type": "string" + }, + "avatar": { + "description": "An image icon that is shown next to statuses and in the profile.", + "type": "string", + "format": "uri" + }, + "avatar_static": { + "description": "A static version of the avatar. Equal to `avatar` if its value is a static image; different if `avatar` is an animated GIF.", + "type": "string", + "format": "uri" + }, + "header": { + "description": "An image banner that is shown above the profile and in profile cards.", + "type": "string", + "format": "uri" + }, + "header_static": { + "description": "A static version of the header. Equal to `header` if its value is a static image; different if `header` is an animated GIF.", + "type": "string", + "format": "uri" + }, + "locked": { + "description": "Whether the account manually approves follow requests.", + "type": "boolean" + }, + "fields": { + "description": "Additional metadata attached to a profile as name-value pairs.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + } + }, + "emojis": { + "description": "Custom emoji entities to be used when rendering the profile.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomEmoji" + } + }, + "bot": { + "description": "Indicates that the account may perform automated actions, may not be monitored, or identifies as a robot.", + "type": "boolean" + }, + "group": { + "description": "Indicates that the account represents a Group actor.", + "type": "boolean" + }, + "discoverable": { + "description": "Whether the account has opted into discovery features such as the profile directory.", + "type": "boolean" + }, + "noindex": { + "description": "Whether the local user has opted out of being indexed by search engines.", + "type": "boolean" + }, + "moved": { + "description": "Indicates that the profile is currently inactive and that its user has moved to a new account.", + "$ref": "#/components/schemas/Account" + }, + "suspended": { + "description": "An extra attribute returned only when an account is suspended.", + "type": "boolean" + }, + "limited": { + "description": "An extra attribute returned only when an account is silenced. If true, indicates that the account should be hidden behind a warning screen.", + "type": "boolean" + }, + "created_at": { + "description": "When the account was created.", + "$ref": "#/components/schemas/Datetime" + }, + "last_status_at": { + "description": "When the most recent status was posted.", + "$ref": "#/components/schemas/Date" + }, + "statuses_count": { + "description": "How many statuses are attached to this account.", + "type": "integer" + }, + "followers_count": { + "description": "The reported followers of this profile.", + "type": "integer" + }, + "following_count": { + "description": "The reported follows of this profile.", + "type": "integer" + }, + "hide_collections": { + "description": "Whether the user hides the contents of their follows and followers collections.", + "type": "boolean" + } + }, + "required": [ + "id", + "username", + "acct", + "url", + "uri", + "display_name", + "note", + "avatar", + "avatar_static", + "header", + "header_static", + "locked", + "fields", + "emojis", + "bot", + "group", + "discoverable", + "created_at", + "last_status_at", + "statuses_count", + "followers_count", + "following_count", + "hide_collections" + ] + }, + "AccountWarning": { + "type": "object", + "description": "Moderation warning against a particular account.", + "properties": { + "id": { + "description": "The ID of the account warning in the database.", + "type": "string" + }, + "action": { + "description": "Action taken against the account.", + "type": "string" + }, + "text": { + "description": "Message from the moderator to the target account.", + "type": "string" + }, + "status_ids": { + "description": "List of status IDs that are relevant to the warning. When `action` is `mark_statuses_as_sensitive` or `delete_statuses`, those are the affected statuses.", + "type": "array", + "items": { + "type": "string" + } + }, + "target_account": { + "description": "Account against which a moderation decision has been taken.", + "$ref": "#/components/schemas/Account" + }, + "appeal": { + "description": "Appeal submitted by the target account, if any.", + "$ref": "#/components/schemas/Appeal" + }, + "created_at": { + "description": "When the event took place.", + "$ref": "#/components/schemas/Datetime" + } + }, + "required": [ + "id", + "action", + "text", + "status_ids", + "target_account", + "appeal", + "created_at" + ] + }, + "Admin::Account": { + "type": "object", + "description": "Admin-level information about a given account.", + "properties": { + "id": { + "description": "The ID of the account in the database.", + "type": "string" + }, + "username": { + "description": "The username of the account.", + "type": "string" + }, + "domain": { + "description": "The domain of the account, if it is remote.", + "type": "string" + }, + "created_at": { + "description": "When the account was first discovered.", + "$ref": "#/components/schemas/Datetime" + }, + "email": { + "description": "The email address associated with the account.", + "type": "string" + }, + "ip": { + "description": "The IP address last used to login to this account.", + "type": "string" + }, + "ips": { + "description": "All known IP addresses associated with this account.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Admin::Ip" + } + }, + "locale": { + "description": "The locale of the account.", + "type": "string" + }, + "invite_request": { + "description": "The reason given when requesting an invite (for instances that require manual approval of registrations)", + "type": "string" + }, + "role": { + "description": "The current role of the account.", + "$ref": "#/components/schemas/Role" + }, + "confirmed": { + "description": "Whether the account has confirmed their email address.", + "type": "boolean" + }, + "approved": { + "description": "Whether the account is currently approved.", + "type": "boolean" + }, + "disabled": { + "description": "Whether the account is currently disabled.", + "type": "boolean" + }, + "silenced": { + "description": "Whether the account is currently silenced.", + "type": "boolean" + }, + "suspended": { + "description": "Whether the account is currently suspended.", + "type": "boolean" + }, + "account": { + "description": "User-level information about the account.", + "$ref": "#/components/schemas/Account" + }, + "created_by_application_id": { + "description": "The ID of the [Application]({{< relref \"entities/application\" >}}) that created this account, if applicable.", + "type": "string" + }, + "invited_by_account_id": { + "description": "The ID of the [Account]({{< relref \"entities/account\" >}}) that invited this user, if applicable.", + "type": "string" + } + }, + "required": [ + "id", + "username", + "domain", + "created_at", + "email", + "ip", + "ips", + "locale", + "invite_request", + "role", + "confirmed", + "approved", + "disabled", + "silenced", + "suspended", + "account" + ] + }, + "Admin::CanonicalEmailBlock": { + "type": "object", + "description": "Represents a canonical email block (hashed).", + "properties": { + "id": { + "description": "The ID of the email block in the database.", + "type": "string" + }, + "canonical_email_hash": { + "description": "The SHA256 hash of the canonical email address.", + "type": "string" + } + }, + "required": [ + "id", + "canonical_email_hash" + ] + }, + "Admin::Cohort": { + "type": "object", + "description": "Represents a retention metric.", + "properties": { + "period": { + "description": "The timestamp for the start of the period, at midnight.", + "$ref": "#/components/schemas/Datetime" + }, + "frequency": { + "description": "The size of the bucket for the returned data.", + "type": "string" + }, + "data": { + "description": "Retention data for users who registered during the given period.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CohortData" + } + } + }, + "required": [ + "period", + "frequency", + "data" + ] + }, + "Admin::Dimension": { + "type": "object", + "description": "Represents qualitative data about the server.", + "properties": { + "key": { + "description": "The unique keystring for the requested dimension.", + "type": "string" + }, + "data": { + "description": "The data available for the requested dimension.", + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "key", + "data" + ] + }, + "Admin::DomainAllow": { + "type": "object", + "description": "Represents a domain allowed to federate.", + "properties": { + "id": { + "description": "The ID of the DomainAllow in the database.", + "type": "string" + }, + "domain": { + "description": "The domain that is allowed to federate.", + "type": "string" + }, + "created_at": { + "description": "When the domain was allowed to federate.", + "$ref": "#/components/schemas/Datetime" + } + }, + "required": [ + "id", + "domain", + "created_at" + ] + }, + "Admin::DomainBlock": { + "type": "object", + "description": "Represents a domain limited from federating.", + "properties": { + "id": { + "description": "The ID of the DomainBlock in the database.", + "type": "string" + }, + "domain": { + "description": "The domain that is not allowed to federate.", + "type": "string" + }, + "digest": { + "description": "The sha256 hex digest of the domain that is not allowed to federated.", + "type": "string" + }, + "created_at": { + "description": "When the domain was blocked from federating.", + "$ref": "#/components/schemas/Datetime" + }, + "severity": { + "description": "The policy to be applied by this domain block.", + "type": "string" + }, + "reject_media": { + "description": "Whether to reject media attachments from this domain", + "type": "boolean" + }, + "reject_reports": { + "description": "Whether to reject reports from this domain", + "type": "boolean" + }, + "private_comment": { + "description": "", + "type": "string" + }, + "public_comment": { + "description": "", + "type": "string" + }, + "obfuscate": { + "description": "Whether to obfuscate public displays of this domain block", + "type": "boolean" + } + }, + "required": [ + "id", + "domain", + "digest", + "created_at", + "severity", + "reject_media", + "reject_reports", + "private_comment", + "public_comment", + "obfuscate" + ] + }, + "Admin::EmailDomainBlock": { + "type": "object", + "description": "Represents an email domain that cannot be used to sign up.", + "properties": { + "id": { + "description": "The ID of the EmailDomainBlock in the database.", + "type": "string" + }, + "domain": { + "description": "The email domain that is not allowed to be used for signups.", + "type": "string" + }, + "created_at": { + "description": "When the email domain was disallowed from signups.", + "$ref": "#/components/schemas/Datetime" + }, + "history": { + "description": "Usage statistics for given days (typically the past week).", + "type": "array", + "items": { + "type": "object" + } + }, + "history[][day]": { + "description": "UNIX timestamp on midnight of the given day.", + "type": "string" + }, + "history[][accounts]": { + "description": "The counted accounts signup attempts using that email domain within that day.", + "type": "string" + }, + "history[][uses]": { + "description": "The counted IP signup attempts of that email domain within that day.", + "type": "string" + } + }, + "required": [ + "id", + "domain", + "created_at", + "history", + "history[][day]", + "history[][accounts]", + "history[][uses]" + ] + }, + "Admin::Ip": { + "type": "object", + "description": "Represents an IP address associated with a user.", + "properties": { + "ip": { + "description": "The IP address.", + "type": "string" + }, + "used_at": { + "description": "The timestamp of when the IP address was last used for this account.", + "$ref": "#/components/schemas/Datetime" + } + }, + "required": [ + "ip", + "used_at" + ] + }, + "Admin::IpBlock": { + "type": "object", + "description": "Represents an IP address range that cannot be used to sign up.", + "properties": { + "id": { + "description": "The ID of the DomainBlock in the database.", + "type": "string" + }, + "ip": { + "description": "The IP address range that is not allowed to federate.", + "type": "string" + }, + "severity": { + "description": "The associated policy with this IP block.", + "type": "string" + }, + "comment": { + "description": "The recorded reason for this IP block.", + "type": "string" + }, + "created_at": { + "description": "When the IP block was created.", + "$ref": "#/components/schemas/Datetime" + }, + "expires_at": { + "description": "When the IP block will expire.", + "$ref": "#/components/schemas/Datetime" + } + }, + "required": [ + "id", + "ip", + "severity", + "comment", + "created_at", + "expires_at" + ] + }, + "Admin::Measure": { + "type": "object", + "description": "Represents quantitative data about the server.", + "properties": { + "key": { + "description": "The unique keystring for the requested measure.", + "type": "string" + }, + "unit": { + "description": "The units associated with this data item's value, if applicable.", + "type": "string" + }, + "total": { + "description": "The numeric total associated with the requested measure.", + "type": "string" + }, + "human_value": { + "description": "A human-readable formatted value for this data item.", + "type": "string" + }, + "previous_total": { + "description": "The numeric total associated with the requested measure, in the previous period. Previous period is calculated by subtracting the start_at and end_at dates, then offsetting both start and end dates backwards by the length of the time period.", + "type": "string" + }, + "data": { + "description": "The data available for the requested measure, split into daily buckets.", + "type": "array", + "items": { + "type": "object" + } + }, + "data[][date]": { + "description": "Midnight on the requested day in the time period.", + "$ref": "#/components/schemas/Datetime" + }, + "data[][value]": { + "description": "The numeric value for the requested measure.", + "type": "string" + } + }, + "required": [ + "key", + "unit", + "total", + "data", + "data[][date]", + "data[][value]" + ] + }, + "Admin::Report": { + "type": "object", + "description": "Admin-level information about a filed report.", + "properties": { + "id": { + "description": "The ID of the report in the database.", + "type": "string" + }, + "action_taken": { + "description": "Whether an action was taken to resolve this report.", + "type": "boolean" + }, + "action_taken_at": { + "description": "When an action was taken, if this report is currently resolved.", + "$ref": "#/components/schemas/Datetime" + }, + "category": { + "description": "The category under which the report is classified.", + "type": "string" + }, + "comment": { + "description": "An optional reason for reporting.", + "type": "string" + }, + "forwarded": { + "description": "Whether a report was forwarded to a remote instance.", + "type": "boolean" + }, + "created_at": { + "description": "The time the report was filed.", + "$ref": "#/components/schemas/Datetime" + }, + "updated_at": { + "description": "The time of last action on this report.", + "$ref": "#/components/schemas/Datetime" + }, + "account": { + "description": "The account which filed the report.", + "$ref": "#/components/schemas/Admin::Account" + }, + "target_account": { + "description": "The account being reported.", + "$ref": "#/components/schemas/Admin::Account" + }, + "assigned_account": { + "description": "The account of the moderator assigned to this report.", + "$ref": "#/components/schemas/Admin::Account" + }, + "action_taken_by_account": { + "description": "The account of the moderator who handled the report.", + "$ref": "#/components/schemas/Admin::Account" + }, + "statuses": { + "description": "Statuses attached to the report, for context.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Status" + } + }, + "rules": { + "description": "Rules attached to the report, for context.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Rule" + } + } + }, + "required": [ + "id", + "action_taken", + "action_taken_at", + "category", + "comment", + "forwarded", + "created_at", + "updated_at", + "account", + "target_account", + "assigned_account", + "action_taken_by_account", + "statuses", + "rules" + ] + }, + "Announcement": { + "type": "object", + "description": "Represents an announcement set by an administrator.", + "properties": { + "id": { + "description": "The ID of the announcement in the database.", + "type": "string" + }, + "content": { + "description": "The text of the announcement.", + "type": "string" + }, + "starts_at": { + "description": "When the announcement will start.", + "$ref": "#/components/schemas/Datetime" + }, + "ends_at": { + "description": "When the announcement will end.", + "$ref": "#/components/schemas/Datetime" + }, + "published": { + "description": "Whether the announcement is currently active.", + "type": "boolean" + }, + "all_day": { + "description": "Whether the announcement should start and end on dates only instead of datetimes. Will be false if there is no `starts_at` or `ends_at` time.", + "type": "boolean" + }, + "published_at": { + "description": "When the announcement was published.", + "$ref": "#/components/schemas/Datetime" + }, + "updated_at": { + "description": "When the announcement was last updated.", + "$ref": "#/components/schemas/Datetime" + }, + "read": { + "description": "Whether the announcement has been read by the current user.", + "type": "boolean" + }, + "mentions": { + "description": "Accounts mentioned in the announcement text.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Announcement::Account" + } + }, + "statuses": { + "description": "Statuses linked in the announcement text.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Announcement::Status" + } + }, + "tags": { + "description": "Tags linked in the announcement text.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Status::Tag" + } + }, + "emojis": { + "description": "Custom emoji used in the announcement text.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomEmoji" + } + }, + "reactions": { + "description": "Emoji reactions attached to the announcement.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Reaction" + } + } + }, + "required": [ + "id", + "content", + "starts_at", + "ends_at", + "published", + "all_day", + "published_at", + "updated_at", + "mentions", + "statuses", + "tags", + "emojis", + "reactions" + ] + }, + "Appeal": { + "type": "object", + "description": "Appeal against a moderation action.", + "properties": { + "text": { + "description": "Text of the appeal from the moderated account to the moderators.", + "type": "string" + }, + "state": { + "description": "State of the appeal.", + "type": "string" + } + }, + "required": [ + "text", + "state" + ] + }, + "Application": { + "type": "object", + "description": "Represents an application that interfaces with the REST API to access accounts or post statuses.", + "properties": { + "name": { + "description": "The name of your application.", + "type": "string" + }, + "website": { + "description": "The website associated with your application.", + "type": "string", + "format": "uri" + }, + "scopes": { + "description": "The scopes for your application. This is the registered `scopes` string split on whitespace.", + "type": "array", + "items": { + "type": "string" + } + }, + "redirect_uris": { + "description": "The registered redirection URI(s) for your application.", + "type": "array", + "items": { + "type": "string" + } + }, + "vapid_key": { + "description": "Used for Push Streaming API. Returned with [POST /api/v1/apps]({{< relref \"methods/apps#create\" >}}). Equivalent to [WebPushSubscription#server_key]({{< relref \"entities/WebPushSubscription#server_key\" >}}) and [Instance#vapid_public_key]({{< relref \"entities/Instance#vapid_public_key\" >}})", + "deprecated": true, + "type": "string" + } + }, + "required": [ + "name", + "scopes", + "redirect_uris", + "vapid_key" + ] + }, + "Context": { + "type": "object", + "description": "Represents the tree around a given status. Used for reconstructing threads of statuses.", + "properties": { + "ancestors": { + "description": "Parents in the thread.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Status" + } + }, + "descendants": { + "description": "Children in the thread.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Status" + } + } + }, + "required": [ + "ancestors", + "descendants" + ] + }, + "Conversation": { + "type": "object", + "description": "Represents a conversation with \"direct message\" visibility.", + "properties": { + "id": { + "description": "The ID of the conversation in the database.", + "type": "string" + }, + "unread": { + "description": "Is the conversation currently marked as unread?", + "type": "boolean" + }, + "accounts": { + "description": "Participants in the conversation.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + }, + "last_status": { + "description": "The last status in the conversation.", + "$ref": "#/components/schemas/Status" + } + }, + "required": [ + "id", + "unread", + "accounts", + "last_status" + ] + }, + "CustomEmoji": { + "type": "object", + "description": "Represents a custom emoji.", + "properties": { + "shortcode": { + "description": "The name of the custom emoji.", + "type": "string" + }, + "url": { + "description": "A link to the custom emoji.", + "type": "string", + "format": "uri" + }, + "static_url": { + "description": "A link to a static copy of the custom emoji.", + "type": "string", + "format": "uri" + }, + "visible_in_picker": { + "description": "Whether this Emoji should be visible in the picker or unlisted.", + "type": "boolean" + }, + "category": { + "description": "Used for sorting custom emoji in the picker.", + "type": "string" + } + }, + "required": [ + "shortcode", + "url", + "static_url", + "visible_in_picker", + "category" + ] + }, + "DomainBlock": { + "type": "object", + "description": "Represents a domain that is blocked by the instance.", + "properties": { + "domain": { + "description": "The domain which is blocked. This may be obfuscated or partially censored.", + "type": "string" + }, + "digest": { + "description": "The SHA256 hash digest of the domain string.", + "type": "string" + }, + "severity": { + "description": "The level to which the domain is blocked.", + "type": "string" + }, + "comment": { + "description": "An optional reason for the domain block.", + "type": "string" + } + }, + "required": [ + "domain", + "digest", + "severity" + ] + }, + "EncryptedMessage": { + "type": "object", + "description": "Represents an encrypted message.", + "properties": { + "id": { + "description": "The ID of the EncryptedMessage in the database.", + "type": "string" + }, + "account_id": { + "description": "The ID of the Account that sent this message.", + "type": "string" + }, + "device_id": { + "description": "The ID of the Device that sent this message.", + "type": "string" + }, + "type": { + "description": "Whether the message is a pre-key message (used to establish a new session) or a normally encrypted message (part of an existing session).", + "type": "string" + }, + "body": { + "description": "The encrypted message content.", + "type": "string" + }, + "digest": { + "description": "An HMAC SHA-256 digest hash of the message.", + "type": "string" + }, + "message_franking": { + "description": "A signed value to be used when reporting the message body for its content.", + "type": "string" + }, + "created_at": { + "description": "A timestamp for when the message was created.", + "$ref": "#/components/schemas/Datetime" + } + }, + "required": [ + "id", + "account_id", + "device_id", + "type", + "body", + "digest", + "message_franking", + "created_at" + ] + }, + "Error": { + "type": "object", + "description": "Represents an error message.", + "properties": { + "error": { + "description": "The error message.", + "type": "string" + }, + "error_description": { + "description": "A longer description of the error, mainly provided with the OAuth API.", + "type": "string" + } + }, + "required": [ + "error" + ] + }, + "ExtendedDescription": { + "type": "object", + "description": "Represents an extended description for the instance, to be shown on its about page.", + "properties": { + "updated_at": { + "description": "A timestamp of when the extended description was last updated.", + "$ref": "#/components/schemas/Datetime" + }, + "content": { + "description": "The rendered HTML content of the extended description.", + "type": "string" + } + }, + "required": [ + "updated_at", + "content" + ] + }, + "FamiliarFollowers": { + "type": "object", + "description": "Represents a subset of your follows who also follow some other user.", + "properties": { + "id": { + "description": "The ID of the Account in the database.", + "type": "string" + }, + "accounts": { + "description": "Accounts you follow that also follow this account.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + } + }, + "required": [ + "id", + "accounts" + ] + }, + "FeaturedTag": { + "type": "object", + "description": "Represents a hashtag that is featured on a profile.", + "properties": { + "id": { + "description": "The internal ID of the featured tag in the database.", + "type": "string" + }, + "name": { + "description": "The name of the hashtag being featured.", + "type": "string" + }, + "url": { + "description": "A link to all statuses by a user that contain this hashtag.", + "type": "string", + "format": "uri" + }, + "statuses_count": { + "description": "The number of authored statuses containing this hashtag.", + "type": "string" + }, + "last_status_at": { + "description": "The date of the last authored status containing this hashtag.", + "$ref": "#/components/schemas/Date" + } + }, + "required": [ + "id", + "name", + "url", + "statuses_count", + "last_status_at" + ] + }, + "Filter": { + "type": "object", + "description": "Represents a user-defined filter for determining which statuses should not be shown to the user.", + "properties": { + "id": { + "description": "The ID of the Filter in the database.", + "type": "string" + }, + "title": { + "description": "A title given by the user to name the filter.", + "type": "string" + }, + "context": { + "description": "The contexts in which the filter should be applied.", + "type": "array", + "items": { + "type": "string" + } + }, + "expires_at": { + "description": "When the filter should no longer be applied.", + "$ref": "#/components/schemas/Datetime" + }, + "filter_action": { + "description": "The action to be taken when a status matches this filter.", + "type": "string" + }, + "keywords": { + "description": "The keywords grouped under this filter. Omitted when part of a [FilterResult]({{< relref \"entities/FilterResult\" >}}).", + "type": "array", + "items": { + "$ref": "#/components/schemas/FilterKeyword" + } + }, + "statuses": { + "description": "The statuses grouped under this filter. Omitted when part of a [FilterResult]({{< relref \"entities/FilterResult\" >}}).", + "type": "array", + "items": { + "$ref": "#/components/schemas/FilterStatus" + } + } + }, + "required": [ + "id", + "title", + "context", + "expires_at", + "filter_action" + ] + }, + "FilterKeyword": { + "type": "object", + "description": "Represents a keyword that, if matched, should cause the filter action to be taken.", + "properties": { + "id": { + "description": "The ID of the FilterKeyword in the database.", + "type": "string" + }, + "keyword": { + "description": "The phrase to be matched against.", + "type": "string" + }, + "whole_word": { + "description": "Should the filter consider word boundaries? See [implementation guidelines for filters]({{< relref \"api/guidelines#filters\" >}}).", + "type": "boolean" + } + }, + "required": [ + "id", + "keyword", + "whole_word" + ] + }, + "FilterResult": { + "type": "object", + "description": "Represents a filter whose keywords matched a given status.", + "properties": { + "filter": { + "description": "The filter that was matched.", + "$ref": "#/components/schemas/Filter" + }, + "keyword_matches": { + "description": "The keyword within the filter that was matched.", + "type": "array", + "items": { + "type": "string" + } + }, + "status_matches": { + "description": "The status ID within the filter that was matched.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "filter", + "keyword_matches", + "status_matches" + ] + }, + "FilterStatus": { + "type": "object", + "description": "Represents a status ID that, if matched, should cause the filter action to be taken.", + "properties": { + "id": { + "description": "The ID of the FilterStatus in the database.", + "type": "string" + }, + "status_id": { + "description": "The ID of the Status that will be filtered.", + "type": "string" + } + }, + "required": [ + "id", + "status_id" + ] + }, + "IdentityProof": { + "type": "object", + "description": "Represents a proof from an external identity provider.", + "properties": { + "provider": { + "description": "The name of the identity provider.", + "type": "string" + }, + "provider_username": { + "description": "The account owner's username on the identity provider's service.", + "type": "string" + }, + "updated_at": { + "description": "When the identity proof was last updated.", + "$ref": "#/components/schemas/Datetime" + }, + "proof_url": { + "description": "A link to a statement of identity proof, hosted by the identity provider.", + "type": "string", + "format": "uri" + }, + "profile_url": { + "description": "The account owner's profile URL on the identity provider.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "provider", + "provider_username", + "updated_at", + "proof_url", + "profile_url" + ] + }, + "Instance": { + "type": "object", + "description": "Represents the software instance of Mastodon running on this domain.", + "properties": { + "domain": { + "description": "The WebFinger domain name of the instance.", + "type": "string" + }, + "title": { + "description": "The title of the website.", + "type": "string" + }, + "version": { + "description": "The version of Mastodon installed on the instance.", + "type": "string" + }, + "source_url": { + "description": "The URL for the source code of the software running on this instance, in keeping with AGPL license requirements.", + "type": "string", + "format": "uri" + }, + "description": { + "description": "A short, plain-text description defined by the admin.", + "type": "string" + }, + "usage": { + "description": "Usage data for this instance.", + "type": "object" + }, + "usage[users]": { + "description": "Usage data related to users on this instance.", + "type": "object" + }, + "usage[users][active_month]": { + "description": "The number of active users in the past 4 weeks. This is set to zero for servers with `configuration[limited_federation]`.", + "type": "integer" + }, + "thumbnail": { + "description": "An image used to represent this instance.", + "type": "object" + }, + "thumbnail[url]": { + "description": "The URL for the thumbnail image.", + "type": "string", + "format": "uri" + }, + "icon": { + "description": "The list of available size variants for this instance configured icon.", + "type": "array", + "items": { + "$ref": "#/components/schemas/InstanceIcon" + } + }, + "languages": { + "description": "Primary languages of the website and its staff.", + "type": "array", + "items": { + "type": "string" + } + }, + "configuration": { + "description": "Configured values and limits for this website.", + "type": "object" + }, + "configuration[urls]": { + "description": "URLs of interest for clients apps.", + "type": "object" + }, + "configuration[urls][streaming]": { + "description": "The Websockets URL for connecting to the streaming API.", + "type": "string", + "format": "uri" + }, + "configuration[urls][about]": { + "description": "The URL of the server's about page.", + "type": "string", + "format": "uri" + }, + "configuration[urls][privacy_policy]": { + "description": "The URL of the server's privacy policy.", + "type": "string", + "format": "uri" + }, + "configuration[urls][terms_of_service]": { + "description": "The URL of the server's current terms of service, if any.", + "type": "string", + "format": "uri" + }, + "configuration[accounts]": { + "description": "Limits related to accounts.", + "type": "object" + }, + "configuration[accounts][max_featured_tags]": { + "description": "The maximum number of featured tags allowed for each account.", + "type": "integer" + }, + "configuration[accounts][max_pinned_statuses]": { + "description": "The maximum number of pinned statuses for each account.", + "type": "integer" + }, + "configuration[statuses]": { + "description": "Limits related to authoring statuses.", + "type": "object" + }, + "configuration[statuses][max_characters]": { + "description": "The maximum number of allowed characters per status.", + "type": "integer" + }, + "configuration[statuses][max_media_attachments]": { + "description": "The maximum number of media attachments that can be added to a status.", + "type": "integer" + }, + "configuration[statuses][characters_reserved_per_url]": { + "description": "Each URL in a status will be assumed to be exactly this many characters.", + "type": "integer" + }, + "configuration[media_attachments]": { + "description": "Hints for which attachments will be accepted.", + "type": "object" + }, + "configuration[media_attachments][supported_mime_types]": { + "description": "Contains MIME types that can be uploaded.", + "type": "array", + "items": { + "type": "string" + } + }, + "configuration[media_attachments][description_limit]": { + "description": "The maximum size of a description, in characters.", + "type": "integer" + }, + "configuration[media_attachments][image_size_limit]": { + "description": "The maximum size of any uploaded image, in bytes.", + "type": "integer" + }, + "configuration[media_attachments][image_matrix_limit]": { + "description": "The maximum number of pixels (width times height) for image uploads.", + "type": "integer" + }, + "configuration[media_attachments][video_size_limit]": { + "description": "The maximum size of any uploaded video, in bytes.", + "type": "integer" + }, + "configuration[media_attachments][video_frame_rate_limit]": { + "description": "The maximum frame rate for any uploaded video.", + "type": "integer" + }, + "configuration[media_attachments][video_matrix_limit]": { + "description": "The maximum number of pixels (width times height) for video uploads.", + "type": "integer" + }, + "configuration[polls]": { + "description": "Limits related to polls.", + "type": "object" + }, + "configuration[polls][max_options]": { + "description": "Each poll is allowed to have up to this many options.", + "type": "integer" + }, + "configuration[polls][max_characters_per_option]": { + "description": "Each poll option is allowed to have this many characters.", + "type": "integer" + }, + "configuration[polls][min_expiration]": { + "description": "The shortest allowed poll duration, in seconds.", + "type": "integer" + }, + "configuration[polls][max_expiration]": { + "description": "The longest allowed poll duration, in seconds.", + "type": "integer" + }, + "configuration[translation]": { + "description": "Hints related to translation.", + "type": "object" + }, + "configuration[translation][enabled]": { + "description": "Whether the Translations API is available on this instance.", + "type": "boolean" + }, + "configuration[limited_federation]": { + "description": "Whether federation is limited to explicitly allowed domains.", + "type": "boolean" + }, + "registrations": { + "description": "Whether registrations are enabled.", + "type": "boolean" + }, + "registrations[approval_required]": { + "description": "Whether registrations require moderator approval.", + "type": "boolean" + }, + "registrations[message]": { + "description": "A custom message to be shown when registrations are closed.", + "type": "string" + }, + "registrations[min_age]": { + "description": "A minimum age required to register, if configured.", + "type": "integer" + }, + "registrations[reason_required]": { + "description": "Whether registrations require the user to provide a reason for joining. Only applicable when `registrations[approval_required]` is true.", + "type": "boolean" + }, + "api_versions": { + "description": "Information about which version of the API is implemented by this server. It contains at least a `mastodon` attribute, and other implementations may have their own additional attributes.", + "type": "object" + }, + "api_versions[mastodon]": { + "description": "Hints related to contacting a representative of the website.", + "type": "object" + }, + "contact[email]": { + "description": "An email address that can be messaged regarding inquiries or issues.", + "type": "string", + "format": "email" + }, + "contact[account]": { + "description": "An account that can be contacted natively over the network regarding inquiries or issues.", + "$ref": "#/components/schemas/Account" + }, + "rules": { + "description": "An itemized list of rules for this website.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Rule" + } + } + }, + "required": [ + "domain", + "title", + "version", + "source_url", + "description", + "usage", + "usage[users]", + "usage[users][active_month]", + "thumbnail", + "thumbnail[url]", + "icon", + "languages", + "configuration", + "configuration[urls]", + "configuration[urls][streaming]", + "configuration[urls][about]", + "configuration[urls][privacy_policy]", + "configuration[urls][terms_of_service]", + "configuration[accounts]", + "configuration[accounts][max_featured_tags]", + "configuration[accounts][max_pinned_statuses]", + "configuration[statuses]", + "configuration[statuses][max_characters]", + "configuration[statuses][max_media_attachments]", + "configuration[statuses][characters_reserved_per_url]", + "configuration[media_attachments]", + "configuration[media_attachments][supported_mime_types]", + "configuration[media_attachments][description_limit]", + "configuration[media_attachments][image_size_limit]", + "configuration[media_attachments][image_matrix_limit]", + "configuration[media_attachments][video_size_limit]", + "configuration[media_attachments][video_frame_rate_limit]", + "configuration[media_attachments][video_matrix_limit]", + "configuration[polls]", + "configuration[polls][max_options]", + "configuration[polls][max_characters_per_option]", + "configuration[polls][min_expiration]", + "configuration[polls][max_expiration]", + "configuration[translation]", + "configuration[translation][enabled]", + "configuration[limited_federation]", + "registrations", + "registrations[approval_required]", + "registrations[message]", + "registrations[min_age]", + "registrations[reason_required]", + "api_versions", + "api_versions[mastodon]", + "contact[email]", + "contact[account]", + "rules" + ] + }, + "List": { + "type": "object", + "description": "Represents a list of some users that the authenticated user follows.", + "properties": { + "id": { + "description": "The internal database ID of the list.", + "type": "string" + }, + "title": { + "description": "The user-defined title of the list.", + "type": "string" + }, + "replies_policy": { + "description": "Which replies should be shown in the list.", + "type": "string" + } + }, + "required": [ + "id", + "title", + "replies_policy" + ] + }, + "Marker": { + "type": "object", + "description": "Represents the last read position within a user's timelines.", + "properties": { + "last_read_id": { + "description": "The ID of the most recently viewed entity.", + "type": "string" + }, + "version": { + "description": "An incrementing counter, used for locking to prevent write conflicts.", + "type": "integer" + }, + "updated_at": { + "description": "The timestamp of when the marker was set.", + "$ref": "#/components/schemas/Datetime" + } + }, + "required": [ + "last_read_id", + "version", + "updated_at" + ] + }, + "MediaAttachment": { + "type": "object", + "description": "Represents a file or media attachment that can be added to a status.", + "properties": { + "id": { + "description": "The ID of the attachment in the database.", + "type": "string" + }, + "type": { + "description": "The type of the attachment.", + "type": "string" + }, + "url": { + "description": "The location of the original full-size attachment.", + "type": "string", + "format": "uri" + }, + "preview_url": { + "description": "The location of a scaled-down preview of the attachment.", + "type": "string", + "format": "uri" + }, + "remote_url": { + "description": "The location of the full-size original attachment on the remote website.", + "type": "string", + "format": "uri" + }, + "meta": { + "description": "Metadata returned by Paperclip.", + "type": "object" + }, + "description": { + "description": "Alternate text that describes what is in the media attachment, to be used for the visually impaired or when media attachments do not load.", + "type": "string" + }, + "blurhash": { + "description": "A hash computed by [the BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.", + "type": "string" + }, + "text_url": { + "description": "A shorter URL for the attachment.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "type", + "url", + "preview_url", + "remote_url", + "meta", + "description", + "blurhash", + "text_url" + ] + }, + "Notification": { + "type": "object", + "description": "Represents a notification of an event relevant to the user.", + "properties": { + "id": { + "description": "The id of the notification in the database.", + "type": "string" + }, + "type": { + "description": "The type of event that resulted in the notification.", + "type": "string" + }, + "group_key": { + "description": "Group key shared by similar notifications, to be used in the grouped notifications feature. Should be considered opaque, but ungrouped notifications can be assumed to have a `group_key` of the form `ungrouped-{notification_id}`.", + "type": "string" + }, + "created_at": { + "description": "The timestamp of the notification.", + "$ref": "#/components/schemas/Datetime" + }, + "account": { + "description": "The account that performed the action that generated the notification.", + "$ref": "#/components/schemas/Account" + }, + "status": { + "description": "Status that was the object of the notification. Attached when `type` of the notification is `favourite`, `reblog`, `status`, `mention`, `poll`, or `update`.", + "$ref": "#/components/schemas/Status" + }, + "report": { + "description": "Report that was the object of the notification. Attached when `type` of the notification is `admin.report`.", + "$ref": "#/components/schemas/Report" + }, + "event": { + "description": "Summary of the event that caused follow relationships to be severed. Attached when `type` of the notification is `severed_relationships`.", + "$ref": "#/components/schemas/RelationshipSeveranceEvent" + }, + "moderation_warning": { + "description": "Moderation warning that caused the notification. Attached when `type` of the notification is `moderation_warning`.", + "$ref": "#/components/schemas/AccountWarning" + } + }, + "required": [ + "id", + "type", + "group_key", + "created_at", + "account" + ] + }, + "NotificationPolicy": { + "type": "object", + "description": "Represents the notification filtering policy of the user.", + "properties": { + "for_not_following": { + "description": "Whether to `accept`, `filter` or `drop` notifications from accounts the user is not following. `drop` will prevent creation of the notification object altogether (without preventing the underlying activity), `filter` will cause it to be marked as filtered, and `accept` will not affect its processing.", + "type": "string" + }, + "for_not_followers": { + "description": "Whether to `accept`, `filter` or `drop` notifications from accounts that are not following the user. `drop` will prevent creation of the notification object altogether (without preventing the underlying activity), `filter` will cause it to be marked as filtered, and `accept` will not affect its processing.", + "type": "string" + }, + "for_new_accounts": { + "description": "Whether to `accept`, `filter` or `drop` notifications from accounts created in the past 30 days. `drop` will prevent creation of the notification object altogether (without preventing the underlying activity), `filter` will cause it to be marked as filtered, and `accept` will not affect its processing.", + "type": "string" + }, + "for_private_mentions": { + "description": "Whether to `accept`, `filter` or `drop` notifications from private mentions. `drop` will prevent creation of the notification object altogether (without preventing the underlying activity), `filter` will cause it to be marked as filtered, and `accept` will not affect its processing. Replies to private mentions initiated by the user, as well as accounts the user follows, are always allowed, regardless of this value.", + "type": "string" + }, + "for_limited_accounts": { + "description": "Whether to `accept`, `filter` or `drop` notifications from accounts that were limited by a moderator. `drop` will prevent creation of the notification object altogether (without preventing the underlying activity), `filter` will cause it to be marked as filtered, and `accept` will not affect its processing.", + "type": "string" + }, + "summary": { + "description": "Summary of the filtered notifications", + "type": "object" + }, + "summary[pending_requests_count]": { + "description": "Number of different accounts from which the user has non-dismissed filtered notifications. Capped at 100.", + "type": "integer" + }, + "summary[pending_notifications_count]": { + "description": "Number of total non-dismissed filtered notifications. May be inaccurate.", + "type": "integer" + } + }, + "required": [ + "for_not_following", + "for_not_followers", + "for_new_accounts", + "for_private_mentions", + "for_limited_accounts", + "summary", + "summary[pending_requests_count]", + "summary[pending_notifications_count]" + ] + }, + "NotificationRequest": { + "type": "object", + "description": "Represents a group of filtered notifications from a specific user.", + "properties": { + "id": { + "description": "The id of the notification request in the database.", + "type": "string" + }, + "created_at": { + "description": "The timestamp of the notification request, i.e. when the first filtered notification from that user was created.", + "$ref": "#/components/schemas/Datetime" + }, + "updated_at": { + "description": "The timestamp of when the notification request was last updated.", + "$ref": "#/components/schemas/Datetime" + }, + "account": { + "description": "The account that performed the action that generated the filtered notifications.", + "$ref": "#/components/schemas/Account" + }, + "notifications_count": { + "description": "How many of this account's notifications were filtered.", + "type": "string" + }, + "last_status": { + "description": "Most recent status associated with a filtered notification from that account.", + "$ref": "#/components/schemas/Status" + } + }, + "required": [ + "id", + "created_at", + "updated_at", + "account", + "notifications_count" + ] + }, + "Poll": { + "type": "object", + "description": "Represents a poll attached to a status.", + "properties": { + "id": { + "description": "The ID of the poll in the database.", + "type": "string" + }, + "expires_at": { + "description": "When the poll ends.", + "$ref": "#/components/schemas/Datetime" + }, + "expired": { + "description": "Is the poll currently expired?", + "type": "boolean" + }, + "multiple": { + "description": "Does the poll allow multiple-choice answers?", + "type": "boolean" + }, + "votes_count": { + "description": "How many votes have been received.", + "type": "integer" + }, + "voters_count": { + "description": "How many unique accounts have voted on a multiple-choice poll.", + "type": "integer" + }, + "options": { + "description": "Possible answers for the poll.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Poll::Option" + } + }, + "emojis": { + "description": "Custom emoji to be used for rendering poll options.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomEmoji" + } + }, + "voted": { + "description": "When called with a user token, has the authorized user voted?", + "type": "boolean" + }, + "own_votes": { + "description": "When called with a user token, which options has the authorized user chosen? Contains an array of index values for `options`.", + "type": "array", + "items": { + "type": "integer" + } + } + }, + "required": [ + "id", + "expires_at", + "expired", + "multiple", + "votes_count", + "voters_count", + "options", + "emojis" + ] + }, + "Preferences": { + "type": "object", + "description": "Represents a user's preferences.", + "properties": { + "posting:default:visibility": { + "description": "Default visibility for new posts. Equivalent to [CredentialAccount#source\\[privacy\\]]({{< relref \"entities/Account#source-privacy\" >}}).", + "type": "string" + }, + "posting:default:sensitive": { + "description": "Default sensitivity flag for new posts. Equivalent to [CredentialAccount#source\\[sensitive\\]]({{< relref \"entities/Account#source-sensitive\" >}}).", + "type": "boolean" + }, + "posting:default:language": { + "description": "Default language for new posts. Equivalent to [CredentialAccount#source\\[language\\]]({{< relref \"entities/Account#source-language\" >}})", + "type": "string" + }, + "reading:expand:media": { + "description": "Whether media attachments should be automatically displayed or blurred/hidden.", + "type": "string" + }, + "reading:expand:spoilers": { + "description": "Whether CWs should be expanded by default.", + "type": "boolean" + } + }, + "required": [ + "posting:default:visibility", + "posting:default:sensitive", + "posting:default:language", + "reading:expand:media", + "reading:expand:spoilers" + ] + }, + "PreviewCard": { + "type": "object", + "description": "Represents a rich preview card that is generated using OpenGraph tags from a URL.", + "properties": { + "url": { + "description": "Location of linked resource.", + "type": "string", + "format": "uri" + }, + "title": { + "description": "Title of linked resource.", + "type": "string" + }, + "description": { + "description": "Description of preview.", + "type": "string" + }, + "type": { + "description": "The type of the preview card.", + "type": "string" + }, + "authors": { + "description": "Fediverse account of the authors of the original resource.", + "type": "array", + "items": { + "$ref": "#/components/schemas/PreviewCardAuthor" + } + }, + "author_name": { + "description": "The author of the original resource. Deprecated since 4.3.0, clients should use `authors` instead.", + "type": "string" + }, + "author_url": { + "description": "A link to the author of the original resource. Deprecated since 4.3.0, clients should use `authors` instead.", + "type": "string", + "format": "uri" + }, + "provider_name": { + "description": "The provider of the original resource.", + "type": "string" + }, + "provider_url": { + "description": "A link to the provider of the original resource.", + "type": "string", + "format": "uri" + }, + "html": { + "description": "HTML to be used for generating the preview card.", + "type": "string" + }, + "width": { + "description": "Width of preview, in pixels.", + "type": "integer" + }, + "height": { + "description": "Height of preview, in pixels.", + "type": "integer" + }, + "image": { + "description": "Preview thumbnail.", + "type": "string", + "format": "uri" + }, + "embed_url": { + "description": "Used for photo embeds, instead of custom `html`.", + "type": "string", + "format": "uri" + }, + "blurhash": { + "description": "A hash computed by [the BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.", + "type": "string" + } + }, + "required": [ + "url", + "title", + "description", + "type", + "authors", + "author_name", + "author_url", + "provider_name", + "provider_url", + "html", + "width", + "height", + "image", + "embed_url", + "blurhash" + ] + }, + "PreviewCardAuthor": { + "type": "object", + "description": "Represents an author in a rich preview card.", + "properties": { + "name": { + "description": "The original resource author's name. Replaces the deprecated `author_name` attribute of the preview card.", + "type": "string" + }, + "url": { + "description": "A link to the author of the original resource. Replaces the deprecated `author_url` attribute of the preview card.", + "type": "string", + "format": "uri" + }, + "account": { + "description": "The fediverse account of the author.", + "$ref": "#/components/schemas/Account" + } + }, + "required": [ + "name", + "url", + "account" + ] + }, + "PrivacyPolicy": { + "type": "object", + "description": "Represents the privacy policy of the instance.", + "properties": { + "updated_at": { + "description": "A timestamp of when the privacy policy was last updated.", + "$ref": "#/components/schemas/Datetime" + }, + "content": { + "description": "The rendered HTML content of the privacy policy.", + "type": "string" + } + }, + "required": [ + "updated_at", + "content" + ] + }, + "Quote": { + "type": "object", + "description": "Represents a quote or a quote placeholder, with the current authorization status.", + "properties": { + "state": { + "description": "The state of the quote.", + "type": "string" + }, + "status": { + "description": "The status being quoted, if the quote has been accepted. This will be `null`, unless the `state` attribute is `accepted`.", + "$ref": "#/components/schemas/Status" + } + }, + "required": [ + "state", + "status" + ] + }, + "Reaction": { + "type": "object", + "description": "Represents an emoji reaction to an Announcement.", + "properties": { + "name": { + "description": "The emoji used for the reaction. Either a unicode emoji, or a custom emoji's shortcode.", + "type": "string" + }, + "count": { + "description": "The total number of users who have added this reaction.", + "type": "integer" + }, + "me": { + "description": "If there is a currently authorized user: Have you added this reaction?", + "type": "boolean" + }, + "url": { + "description": "If the reaction is a custom emoji: A link to the custom emoji.", + "type": "string", + "format": "uri" + }, + "static_url": { + "description": "If the reaction is a custom emoji: A link to a non-animated version of the custom emoji.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "name", + "count" + ] + }, + "Relationship": { + "type": "object", + "description": "Represents the relationship between accounts, such as following / blocking / muting / etc.", + "properties": { + "id": { + "description": "The account ID.", + "type": "string" + }, + "following": { + "description": "Are you following this user?", + "type": "boolean" + }, + "showing_reblogs": { + "description": "Are you receiving this user's boosts in your home timeline?", + "type": "boolean" + }, + "notifying": { + "description": "Have you enabled notifications for this user?", + "type": "boolean" + }, + "languages": { + "description": "Which languages are you following from this user?", + "type": "array", + "items": { + "type": "string" + } + }, + "followed_by": { + "description": "Are you followed by this user?", + "type": "boolean" + }, + "blocking": { + "description": "Are you blocking this user?", + "type": "boolean" + }, + "blocked_by": { + "description": "Is this user blocking you?", + "type": "boolean" + }, + "muting": { + "description": "Are you muting this user?", + "type": "boolean" + }, + "muting_notifications": { + "description": "Are you muting notifications from this user?", + "type": "boolean" + }, + "requested": { + "description": "Do you have a pending follow request for this user?", + "type": "boolean" + }, + "requested_by": { + "description": "Has this user requested to follow you?", + "type": "boolean" + }, + "domain_blocking": { + "description": "Are you blocking this user's domain?", + "type": "boolean" + }, + "endorsed": { + "description": "Are you featuring this user on your profile?", + "type": "boolean" + }, + "note": { + "description": "This user's profile bio", + "type": "string" + } + }, + "required": [ + "id", + "following", + "showing_reblogs", + "notifying", + "languages", + "followed_by", + "blocking", + "blocked_by", + "muting", + "muting_notifications", + "requested", + "requested_by", + "domain_blocking", + "endorsed", + "note" + ] + }, + "RelationshipSeveranceEvent": { + "type": "object", + "description": "Summary of a moderation or block event that caused follow relationships to be severed.", + "properties": { + "id": { + "description": "The ID of the relationship severance event in the database.", + "type": "string" + }, + "type": { + "description": "Type of event.", + "type": "string" + }, + "purged": { + "description": "Whether the list of severed relationships is unavailable because the underlying issue has been purged.", + "type": "boolean" + }, + "target_name": { + "description": "Name of the target of the moderation/block event. This is either a domain name or a user handle, depending on the event type.", + "type": "string" + }, + "followers_count": { + "description": "Number of followers that were removed as result of the event.", + "type": "integer" + }, + "following_count": { + "description": "Number of accounts the user stopped following as result of the event.", + "type": "integer" + }, + "created_at": { + "description": "When the event took place.", + "$ref": "#/components/schemas/Datetime" + } + }, + "required": [ + "id", + "type", + "purged", + "target_name", + "followers_count", + "following_count", + "created_at" + ] + }, + "Report": { + "type": "object", + "description": "Reports filed against users and/or statuses, to be taken action on by moderators.", + "properties": { + "id": { + "description": "The ID of the report in the database.", + "type": "string" + }, + "action_taken": { + "description": "Whether an action was taken yet.", + "type": "boolean" + }, + "action_taken_at": { + "description": "When an action was taken against the report.", + "$ref": "#/components/schemas/Datetime" + }, + "category": { + "description": "The generic reason for the report.", + "type": "string" + }, + "comment": { + "description": "The reason for the report.", + "type": "string" + }, + "forwarded": { + "description": "Whether the report was forwarded to a remote domain.", + "type": "boolean" + }, + "created_at": { + "description": "When the report was created.", + "$ref": "#/components/schemas/Datetime" + }, + "status_ids": { + "description": "IDs of statuses that have been attached to this report for additional context.", + "type": "array", + "items": { + "type": "string" + } + }, + "rule_ids": { + "description": "IDs of the rules that have been cited as a violation by this report.", + "type": "array", + "items": { + "type": "string" + } + }, + "target_account": { + "description": "The account that was reported.", + "$ref": "#/components/schemas/Account" + } + }, + "required": [ + "id", + "action_taken", + "action_taken_at", + "category", + "comment", + "forwarded", + "created_at", + "status_ids", + "rule_ids", + "target_account" + ] + }, + "Role": { + "type": "object", + "description": "Represents a custom user role that grants permissions.", + "properties": { + "id": { + "description": "The ID of the Role in the database.", + "type": "string" + }, + "name": { + "description": "The name of the role.", + "type": "string" + }, + "color": { + "description": "The hex code assigned to this role. If no hex code is assigned, the string will be empty.", + "type": "string" + }, + "permissions": { + "description": "A bitmask that represents the sum of all permissions granted to the role.", + "type": "string" + }, + "highlighted": { + "description": "Whether the role is publicly visible as a badge on user profiles.", + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "color", + "permissions", + "highlighted" + ] + }, + "Rule": { + "type": "object", + "description": "Represents a rule that server users should follow.", + "properties": { + "id": { + "description": "An identifier for the rule.", + "type": "string" + }, + "text": { + "description": "The rule to be followed.", + "type": "string" + }, + "hint": { + "description": "Longer-form description of the rule.", + "type": "string" + }, + "translations": { + "description": "Available translations for this rule's `text` and `hint`, as a Hash where keys are locale codes and values are hashes with `text` and `hint` keys.", + "type": "object" + } + }, + "required": [ + "id", + "text", + "hint", + "translations" + ] + }, + "ScheduledStatus": { + "type": "object", + "description": "Represents a status that will be published at a future scheduled date.", + "properties": { + "id": { + "description": "ID of the scheduled status in the database.", + "type": "string" + }, + "scheduled_at": { + "description": "The timestamp for when the status will be posted.", + "$ref": "#/components/schemas/Datetime" + }, + "params": { + "description": "The parameters that were used when scheduling the status, to be used when the status is posted.", + "type": "object" + }, + "params[text]": { + "description": "Text to be used as status content.", + "type": "string" + }, + "params[poll]": { + "description": "Poll to be attached to the status.", + "type": "object" + }, + "params[poll][options[]]": { + "description": "The poll options to be used.", + "type": "array", + "items": { + "type": "string" + } + }, + "params[poll][expires_in]": { + "description": "How many seconds the poll should last before closing.", + "type": "string" + }, + "params[poll][multiple]": { + "description": "Whether the poll allows multiple choices.", + "type": "boolean" + }, + "params[poll][hide_totals]": { + "description": "Whether the poll should hide total votes until after voting has ended.", + "type": "boolean" + }, + "params[media_ids]": { + "description": "IDs of the MediaAttachments that will be attached to the status.", + "type": "array", + "items": { + "type": "string" + } + }, + "params[sensitive]": { + "description": "Whether the status will be marked as sensitive.", + "type": "boolean" + }, + "params[spoiler_text]": { + "description": "The text of the content warning or summary for the status.", + "type": "string" + }, + "params[visibility]": { + "description": "The visibility that the status will have once it is posted.", + "type": "string" + }, + "params[in_reply_to_id]": { + "description": "ID of the Status that will be replied to.", + "type": "integer" + }, + "params[language]": { + "description": "The language that will be used for the status.", + "type": "string" + }, + "params[application_id]": { + "description": "Internal ID of the Application that posted the status. Provided for historical compatibility only and can be ignored.", + "deprecated": true, + "type": "integer" + }, + "params[scheduled_at]": { + "description": "When the status will be scheduled. This will be null because the status is only scheduled once.", + "type": "string" + }, + "params[idempotency]": { + "description": "Idempotency key to prevent duplicate statuses.", + "type": "string" + }, + "params[with_rate_limit]": { + "description": "Whether status creation is subject to rate limiting. Provided for historical compatibility only and can be ignored.", + "deprecated": true, + "type": "boolean" + }, + "media_attachments": { + "description": "Media that will be attached when the status is posted.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaAttachment" + } + } + }, + "required": [ + "id", + "scheduled_at", + "params", + "params[text]", + "params[poll]", + "params[poll][options[]]", + "params[poll][expires_in]", + "params[poll][multiple]", + "params[poll][hide_totals]", + "params[media_ids]", + "params[sensitive]", + "params[spoiler_text]", + "params[visibility]", + "params[in_reply_to_id]", + "params[language]", + "params[application_id]", + "params[scheduled_at]", + "params[idempotency]", + "params[with_rate_limit]", + "media_attachments" + ] + }, + "Search": { + "type": "object", + "description": "Represents the results of a search.", + "properties": { + "accounts": { + "description": "Accounts which match the given query", + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + }, + "statuses": { + "description": "Statuses which match the given query", + "type": "array", + "items": { + "$ref": "#/components/schemas/Status" + } + }, + "hashtags": { + "description": "Hashtags which match the given query", + "type": "array", + "items": { + "$ref": "#/components/schemas/Tag" + } + } + }, + "required": [ + "accounts", + "statuses", + "hashtags" + ] + }, + "ShallowQuote": { + "type": "object", + "description": "Represents a quote or a quote placeholder, with the current authorization status.", + "properties": { + "state": { + "description": "The state of the quote.", + "type": "string" + }, + "status_id": { + "description": "The identifier of the status being quoted, if the quote has been accepted. This will be `null`, unless the `state` attribute is `accepted`.", + "type": "string" + } + }, + "required": [ + "state", + "status_id" + ] + }, + "Status": { + "type": "object", + "description": "Represents a status posted by an account.", + "properties": { + "id": { + "description": "ID of the status in the database.", + "type": "string" + }, + "uri": { + "description": "URI of the status used for federation.", + "type": "string" + }, + "created_at": { + "description": "The date when this status was created.", + "$ref": "#/components/schemas/Datetime" + }, + "account": { + "description": "The account that authored this status.", + "$ref": "#/components/schemas/Account" + }, + "content": { + "description": "HTML-encoded status content.", + "type": "string" + }, + "visibility": { + "description": "Visibility of this status.", + "type": "string" + }, + "sensitive": { + "description": "Is this status marked as sensitive content?", + "type": "boolean" + }, + "spoiler_text": { + "description": "Subject or summary line, below which status content is collapsed until expanded.", + "type": "string" + }, + "media_attachments": { + "description": "Media that is attached to this status.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaAttachment" + } + }, + "application": { + "description": "The application used to post this status.", + "type": "object" + }, + "application[name]": { + "description": "The name of the application that posted this status.", + "type": "string" + }, + "application[website]": { + "description": "The website associated with the application that posted this status.", + "type": "string", + "format": "uri" + }, + "mentions": { + "description": "Mentions of users within the status content.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Status::Mention" + } + }, + "tags": { + "description": "Hashtags used within the status content.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Status::Tag" + } + }, + "emojis": { + "description": "Custom emoji to be used when rendering status content.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomEmoji" + } + }, + "reblogs_count": { + "description": "How many boosts this status has received.", + "type": "integer" + }, + "favourites_count": { + "description": "How many favourites this status has received.", + "type": "integer" + }, + "replies_count": { + "description": "How many replies this status has received.", + "type": "integer" + }, + "url": { + "description": "A link to the status's HTML representation.", + "type": "string", + "format": "uri" + }, + "in_reply_to_id": { + "description": "ID of the status being replied to.", + "type": "string" + }, + "in_reply_to_account_id": { + "description": "ID of the account that authored the status being replied to.", + "type": "string" + }, + "reblog": { + "description": "The status being reblogged.", + "$ref": "#/components/schemas/Status" + }, + "poll": { + "description": "The poll attached to the status.", + "$ref": "#/components/schemas/Poll" + }, + "card": { + "description": "Preview card for links included within status content.", + "$ref": "#/components/schemas/PreviewCard" + }, + "language": { + "description": "Primary language of this status.", + "type": "string" + }, + "text": { + "description": "Plain-text source of a status. Returned instead of `content` when status is deleted, so the user may redraft from the source text without the client having to reverse-engineer the original text from the HTML content.", + "type": "string" + }, + "edited_at": { + "description": "Timestamp of when the status was last edited.", + "$ref": "#/components/schemas/Datetime" + }, + "favourited": { + "description": "If the current token has an authorized user: Have you favourited this status?", + "type": "boolean" + }, + "reblogged": { + "description": "If the current token has an authorized user: Have you boosted this status?", + "type": "boolean" + }, + "muted": { + "description": "If the current token has an authorized user: Have you muted notifications for this status's conversation?", + "type": "boolean" + }, + "bookmarked": { + "description": "If the current token has an authorized user: Have you bookmarked this status?", + "type": "boolean" + }, + "pinned": { + "description": "If the current token has an authorized user: Have you pinned this status? Only appears if the status is pinnable.", + "type": "boolean" + }, + "filtered": { + "description": "If the current token has an authorized user: The filter and keywords that matched this status.", + "type": "array", + "items": { + "$ref": "#/components/schemas/FilterResult" + } + } + }, + "required": [ + "id", + "uri", + "created_at", + "account", + "content", + "visibility", + "sensitive", + "spoiler_text", + "media_attachments", + "application[name]", + "application[website]", + "mentions", + "tags", + "emojis", + "reblogs_count", + "favourites_count", + "replies_count", + "url", + "in_reply_to_id", + "in_reply_to_account_id", + "reblog", + "poll", + "card", + "language", + "text", + "edited_at" + ] + }, + "StatusEdit": { + "type": "object", + "description": "Represents a revision of a status that has been edited.", + "properties": { + "content": { + "description": "The content of the status at this revision.", + "type": "string" + }, + "spoiler_text": { + "description": "The content of the subject or content warning at this revision.", + "type": "string" + }, + "sensitive": { + "description": "Whether the status was marked sensitive at this revision.", + "type": "boolean" + }, + "created_at": { + "description": "The timestamp of when the revision was published.", + "$ref": "#/components/schemas/Datetime" + }, + "account": { + "description": "The account that published this revision.", + "$ref": "#/components/schemas/Account" + }, + "poll": { + "description": "The current state of the poll options at this revision. Note that edits changing the poll options will be collapsed together into one edit, since this action resets the poll.", + "type": "object" + }, + "poll.options[]": { + "description": "The poll options at this revision.", + "type": "array", + "items": { + "type": "object" + } + }, + "poll.options[].title": { + "description": "The text for a poll option.", + "type": "string" + }, + "media_attachments": { + "description": "The current state of the media attachments at this revision.", + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaAttachment" + } + }, + "emojis": { + "description": "Any custom emoji that are used in the current revision.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomEmoji" + } + } + }, + "required": [ + "content", + "spoiler_text", + "sensitive", + "created_at", + "account", + "poll.options[]", + "poll.options[].title", + "media_attachments", + "emojis" + ] + }, + "StatusSource": { + "type": "object", + "description": "Represents a status's source as plain text.", + "properties": { + "id": { + "description": "ID of the status in the database.", + "type": "string" + }, + "text": { + "description": "The plain text used to compose the status.", + "type": "string" + }, + "spoiler_text": { + "description": "The plain text used to compose the status's subject or content warning.", + "type": "string" + } + }, + "required": [ + "id", + "text", + "spoiler_text" + ] + }, + "Suggestion": { + "type": "object", + "description": "Represents a suggested account to follow and an associated reason for the suggestion.", + "properties": { + "source": { + "description": "The reason this account is being suggested.", + "type": "string" + }, + "sources": { + "description": "A list of reasons this account is being suggested. This replaces `source`", + "type": "array", + "items": { + "type": "string" + } + }, + "account": { + "description": "The account being recommended to follow.", + "$ref": "#/components/schemas/Account" + } + }, + "required": [ + "source", + "sources", + "account" + ] + }, + "Tag": { + "type": "object", + "description": "Represents a hashtag used within the content of a status.", + "properties": { + "name": { + "description": "The value of the hashtag after the # sign.", + "type": "string" + }, + "url": { + "description": "A link to the hashtag on the instance.", + "type": "string", + "format": "uri" + }, + "history": { + "description": "Usage statistics for given days (typically the past week).", + "type": "array", + "items": { + "type": "object" + } + }, + "history[][day]": { + "description": "UNIX timestamp on midnight of the given day.", + "type": "string" + }, + "history[][uses]": { + "description": "The counted usage of the tag within that day.", + "type": "string" + }, + "history[][accounts]": { + "description": "The total of accounts using the tag within that day.", + "type": "string" + }, + "following": { + "description": "Whether the current token's authorized user is following this tag.", + "type": "boolean" + }, + "featuring": { + "description": "Whether the current token's authorized user is featuring this tag on their profile.", + "type": "boolean" + } + }, + "required": [ + "name", + "url", + "history", + "history[][day]", + "history[][uses]", + "history[][accounts]" + ] + }, + "TermsOfService": { + "type": "object", + "description": "Represents the terms of service of the instance.", + "properties": { + "effective_date": { + "description": "The date these terms of service are coming or have come in effect.", + "$ref": "#/components/schemas/Date" + }, + "effective": { + "description": "Whether these terms of service are currently in effect.", + "type": "boolean" + }, + "content": { + "description": "The rendered HTML content of the terms of service.", + "type": "string" + }, + "succeeded_by": { + "description": "If there are newer terms of service, their effective date.", + "$ref": "#/components/schemas/Date" + } + }, + "required": [ + "effective_date", + "effective", + "content", + "succeeded_by" + ] + }, + "Token": { + "type": "object", + "description": "Represents an OAuth token used for authenticating with the API and performing actions.", + "properties": { + "access_token": { + "description": "An OAuth token to be used for authorization.", + "type": "string" + }, + "token_type": { + "description": "The OAuth token type. Mastodon uses `Bearer` tokens.", + "type": "string" + }, + "scope": { + "description": "The OAuth scopes granted by this token, space-separated.", + "type": "string" + }, + "created_at": { + "description": "When the token was generated.", + "type": "number" + } + }, + "required": [ + "access_token", + "token_type", + "scope", + "created_at" + ] + }, + "Translation": { + "type": "object", + "description": "Represents the result of machine translating some status content", + "properties": { + "content": { + "description": "HTML-encoded translated content of the status.", + "type": "string" + }, + "spoiler_text": { + "description": "The translated spoiler warning of the status.", + "type": "string" + }, + "poll": { + "description": "The translated poll of the status.", + "$ref": "#/components/schemas/Translation::Poll" + }, + "media_attachments": { + "description": "The translated media descriptions of the status.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Translation::Attachment" + } + }, + "detected_source_language": { + "description": "The language of the source text, as auto-detected by the machine translation provider.", + "type": "string" + }, + "provider": { + "description": "The service that provided the machine translation.", + "type": "string" + } + }, + "required": [ + "content", + "spoiler_text", + "media_attachments", + "detected_source_language", + "provider" + ] + }, + "V1::Filter": { + "type": "object", + "description": "Represents a user-defined filter for determining which statuses should not be shown to the user. Contains a single keyword or phrase.", + "properties": { + "id": { + "description": "The ID of the filter in the database.", + "type": "string" + }, + "phrase": { + "description": "The text to be filtered.", + "type": "string" + }, + "context": { + "description": "The contexts in which the filter should be applied.", + "type": "array", + "items": { + "type": "string" + } + }, + "expires_at": { + "description": "When the filter should no longer be applied.", + "$ref": "#/components/schemas/Datetime" + }, + "irreversible": { + "description": "Should matching entities in home and notifications be dropped by the server? See [implementation guidelines for filters]({{< relref \"api/guidelines#filters\" >}}).", + "type": "boolean" + }, + "whole_word": { + "description": "Should the filter consider word boundaries? See [implementation guidelines for filters]({{< relref \"api/guidelines#filters\" >}}).", + "type": "boolean" + } + }, + "required": [ + "id", + "phrase", + "context", + "expires_at", + "irreversible", + "whole_word" + ] + }, + "V1::Instance": { + "type": "object", + "description": "Represents the software instance of Mastodon running on this domain.", + "properties": { + "uri": { + "description": "The WebFinger domain name of the instance (not a URI/URL).", + "type": "string" + }, + "title": { + "description": "The title of the website.", + "type": "string" + }, + "short_description": { + "description": "A short, plain-text description defined by the admin.", + "type": "string" + }, + "description": { + "description": "An HTML-permitted description of the Mastodon site.", + "type": "string" + }, + "email": { + "description": "An email that may be contacted for any inquiries.", + "type": "string" + }, + "version": { + "description": "The version of Mastodon installed on the instance.", + "type": "string" + }, + "urls": { + "description": "URLs of interest for clients apps.", + "type": "object" + }, + "urls[streaming_api]": { + "description": "The Websockets URL for connecting to the streaming API.", + "type": "string", + "format": "uri" + }, + "stats": { + "description": "Statistics about how much information the instance contains.", + "type": "object" + }, + "stats[user_count]": { + "description": "Total users on this instance.", + "type": "integer" + }, + "stats[status_count]": { + "description": "Total statuses on this instance.", + "type": "integer" + }, + "stats[domain_count]": { + "description": "Total domains discovered by this instance.", + "type": "integer" + }, + "thumbnail": { + "description": "Banner image for the website.", + "type": "string", + "format": "uri" + }, + "languages": { + "description": "Primary languages of the website and its staff.", + "type": "array", + "items": { + "type": "string" + } + }, + "registrations": { + "description": "Whether registrations are enabled.", + "type": "boolean" + }, + "approval_required": { + "description": "Whether registrations require moderator approval.", + "type": "boolean" + }, + "invites_enabled": { + "description": "Whether invites are enabled.", + "type": "boolean" + }, + "configuration": { + "description": "Configured values and limits for this website.", + "type": "object" + }, + "configuration[accounts]": { + "description": "Limits related to accounts.", + "type": "object" + }, + "configuration[accounts][max_featured_tags]": { + "description": "The maximum number of featured tags allowed for each account.", + "type": "integer" + }, + "configuration[statuses]": { + "description": "Limits related to authoring statuses.", + "type": "object" + }, + "configuration[statuses][max_characters]": { + "description": "The maximum number of allowed characters per status.", + "type": "integer" + }, + "configuration[statuses][max_media_attachments]": { + "description": "The maximum number of media attachments that can be added to a status.", + "type": "integer" + }, + "configuration[statuses][characters_reserved_per_url]": { + "description": "Each URL in a status will be assumed to be exactly this many characters.", + "type": "integer" + }, + "configuration[media_attachments]": { + "description": "Hints for which attachments will be accepted.", + "type": "object" + }, + "configuration[media_attachments][supported_mime_types]": { + "description": "Contains MIME types that can be uploaded.", + "type": "array", + "items": { + "type": "string" + } + }, + "configuration[media_attachments][image_size_limit]": { + "description": "The maximum size of any uploaded image, in bytes.", + "type": "integer" + }, + "configuration[media_attachments][image_matrix_limit]": { + "description": "The maximum number of pixels (width times height) for image uploads.", + "type": "integer" + }, + "configuration[media_attachments][video_size_limit]": { + "description": "The maximum size of any uploaded video, in bytes.", + "type": "integer" + }, + "configuration[media_attachments][video_frame_rate_limit]": { + "description": "The maximum frame rate for any uploaded video.", + "type": "integer" + }, + "configuration[media_attachments][video_matrix_limit]": { + "description": "The maximum number of pixels (width times height) for video uploads.", + "type": "integer" + }, + "configuration[polls]": { + "description": "Limits related to polls.", + "type": "object" + }, + "configuration[polls][max_options]": { + "description": "Each poll is allowed to have up to this many options.", + "type": "integer" + }, + "configuration[polls][max_characters_per_option]": { + "description": "Each poll option is allowed to have this many characters.", + "type": "integer" + }, + "configuration[polls][min_expiration]": { + "description": "The shortest allowed poll duration, in seconds.", + "type": "integer" + }, + "configuration[polls][max_expiration]": { + "description": "The longest allowed poll duration, in seconds.", + "type": "integer" + }, + "contact_account": { + "description": "A user that can be contacted, as an alternative to `email`.", + "$ref": "#/components/schemas/Account" + }, + "rules": { + "description": "An itemized list of rules for this website.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Rule" + } + } + }, + "required": [ + "uri", + "title", + "short_description", + "description", + "email", + "version", + "urls", + "urls[streaming_api]", + "stats", + "stats[user_count]", + "stats[status_count]", + "stats[domain_count]", + "thumbnail", + "languages", + "registrations", + "approval_required", + "invites_enabled", + "configuration", + "configuration[accounts]", + "configuration[accounts][max_featured_tags]", + "configuration[statuses]", + "configuration[statuses][max_characters]", + "configuration[statuses][max_media_attachments]", + "configuration[statuses][characters_reserved_per_url]", + "configuration[media_attachments]", + "configuration[media_attachments][supported_mime_types]", + "configuration[media_attachments][image_size_limit]", + "configuration[media_attachments][image_matrix_limit]", + "configuration[media_attachments][video_size_limit]", + "configuration[media_attachments][video_frame_rate_limit]", + "configuration[media_attachments][video_matrix_limit]", + "configuration[polls]", + "configuration[polls][max_options]", + "configuration[polls][max_characters_per_option]", + "configuration[polls][min_expiration]", + "configuration[polls][max_expiration]", + "contact_account", + "rules" + ] + }, + "V1::NotificationPolicy": { + "type": "object", + "description": "Represents the notification filtering policy of the user.", + "properties": { + "filter_not_following": { + "description": "Whether to filter notifications from accounts the user is not following.", + "type": "boolean" + }, + "filter_not_followers": { + "description": "Whether to filter notifications from accounts that are not following the user.", + "type": "boolean" + }, + "filter_new_accounts": { + "description": "Whether to filter notifications from accounts created in the past 30 days.", + "type": "boolean" + }, + "filter_private_mentions": { + "description": "Whether to filter notifications from private mentions. Replies to private mentions initiated by the user, as well as accounts the user follows, are never filtered.", + "type": "boolean" + }, + "summary": { + "description": "Summary of the filtered notifications", + "type": "object" + }, + "summary[pending_requests_count]": { + "description": "Number of different accounts from which the user has non-dismissed filtered notifications. Capped at 100.", + "type": "integer" + }, + "summary[pending_notifications_count]": { + "description": "Number of total non-dismissed filtered notifications. May be inaccurate.", + "type": "integer" + } + }, + "required": [ + "filter_not_following", + "filter_not_followers", + "filter_new_accounts", + "filter_private_mentions", + "summary", + "summary[pending_requests_count]", + "summary[pending_notifications_count]" + ] + }, + "WebPushSubscription": { + "type": "object", + "description": "Represents a subscription to the push streaming server.", + "properties": { + "id": { + "description": "The ID of the Web Push subscription in the database.", + "type": "string" + }, + "endpoint": { + "description": "Where push alerts will be sent to.", + "type": "string", + "format": "uri" + }, + "standard": { + "description": "If the push messages follow the standardized specifications (RFC8030+RFC8291+RFC8292). Else they follow a legacy version of the specifications (4th draft of RFC8291 and 1st draft of RFC8292).", + "type": "boolean" + }, + "server_key": { + "description": "The streaming server's VAPID key.", + "type": "string" + }, + "alerts": { + "description": "Which alerts should be delivered to the `endpoint`.", + "type": "object" + }, + "alerts[mention]": { + "description": "Receive a push notification when someone else has mentioned you in a status?", + "type": "boolean" + }, + "alerts[status]": { + "description": "Receive a push notification when a subscribed account posts a status?", + "type": "boolean" + }, + "alerts[reblog]": { + "description": "Receive a push notification when a status you created has been boosted by someone else?", + "type": "boolean" + }, + "alerts[follow]": { + "description": "Receive a push notification when someone has followed you?", + "type": "boolean" + }, + "alerts[follow_request]": { + "description": "Receive a push notification when someone has requested to followed you?", + "type": "boolean" + }, + "alerts[favourite]": { + "description": "Receive a push notification when a status you created has been favourited by someone else?", + "type": "boolean" + }, + "alerts[poll]": { + "description": "Receive a push notification when a poll you voted in or created has ended?", + "type": "boolean" + }, + "alerts[update]": { + "description": "Receive a push notification when a status you interacted with has been edited?", + "type": "boolean" + }, + "alerts[admin.sign_up]": { + "description": "Receive a push notification when a new user has signed up?", + "type": "boolean" + }, + "alerts[admin.report]": { + "description": "Receive a push notification when a new report has been filed?", + "type": "boolean" + } + }, + "required": [ + "id", + "endpoint", + "standard", + "server_key", + "alerts", + "alerts[mention]", + "alerts[status]", + "alerts[reblog]", + "alerts[follow]", + "alerts[follow_request]", + "alerts[favourite]", + "alerts[poll]", + "alerts[update]", + "alerts[admin.sign_up]", + "alerts[admin.report]" + ] + } + }, + "securitySchemes": { + "OAuth2": { + "type": "oauth2", + "description": "OAuth 2.0 authentication" + }, + "BearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "Bearer token authentication" + } + } + } +} \ No newline at end of file diff --git a/src/__tests__/main.test.ts b/src/__tests__/main.test.ts new file mode 100644 index 0000000..d14a123 --- /dev/null +++ b/src/__tests__/main.test.ts @@ -0,0 +1,34 @@ +import { main } from '../main'; +import * as fs from 'fs'; +import * as path from 'path'; + +describe('main', () => { + const schemaPath = path.join(__dirname, '..', '..', 'dist', 'schema.json'); + + beforeEach(() => { + // Clean up the schema file if it exists + if (fs.existsSync(schemaPath)) { + fs.unlinkSync(schemaPath); + } + }); + + it('should generate and write schema.json to dist directory', () => { + // Run the main function + main(); + + // Check that the file was created + expect(fs.existsSync(schemaPath)).toBe(true); + + // Check that the file contains valid JSON + const content = fs.readFileSync(schemaPath, 'utf-8'); + const schema = JSON.parse(content); + + // Verify basic structure + expect(schema.openapi).toBe('3.0.3'); + expect(schema.info).toBeDefined(); + expect(schema.info.title).toBe('Mastodon API'); + expect(schema.paths).toBeDefined(); + expect(schema.components).toBeDefined(); + expect(schema.components.schemas).toBeDefined(); + }); +}); diff --git a/src/main.ts b/src/main.ts index 4a0af41..52761a7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,8 @@ import { EntityParser } from './parsers/EntityParser'; import { MethodParser } from './parsers/MethodParser'; import { OpenAPIGenerator } from './generators/OpenAPIGenerator'; +import * as fs from 'fs'; +import * as path from 'path'; function main() { console.log('Parsing Mastodon entity files...'); @@ -29,7 +31,19 @@ function main() { const schema = generator.generateSchema(entities, methodFiles); console.log('OpenAPI schema generated successfully'); - console.log(generator.toJSON()); + + // Write schema to file + const distDir = path.join(__dirname, '..', 'dist'); + const schemaPath = path.join(distDir, 'schema.json'); + + // Ensure dist directory exists + if (!fs.existsSync(distDir)) { + fs.mkdirSync(distDir, { recursive: true }); + } + + // Write schema to file + fs.writeFileSync(schemaPath, generator.toJSON()); + console.log(`Schema written to ${schemaPath}`); } if (require.main === module) {