2022-03-01 02:53:07 +08:00
{
"swagger" : "2.0" ,
"info" : {
2022-03-05 00:50:45 +08:00
"description" : "These are the set of `internal` endpoints dedicated to the Monkeytype web client. Authentication for these endpoints requires a user account." ,
2022-03-01 02:53:07 +08:00
"version" : "1.0.0" ,
"title" : "Monkeytype" ,
2022-03-05 00:50:45 +08:00
"termsOfService" : "https://monkeytype.com/terms-of-service" ,
2022-03-01 02:53:07 +08:00
"contact" : {
"name" : "Developer" ,
"email" : "jack@monkeytype.com"
}
} ,
"host" : "api.monkeytype.com" ,
"schemes" : [ "https" ] ,
"consumes" : [ "application/json" ] ,
"produces" : [ "application/json" ] ,
2022-03-01 04:17:37 +08:00
"tags" : [
2022-03-04 22:43:17 +08:00
{
"name" : "index" ,
2022-03-05 00:50:45 +08:00
"description" : "Server status information"
2022-03-04 22:43:17 +08:00
} ,
2022-03-01 04:17:37 +08:00
{
"name" : "users" ,
2022-03-05 00:50:45 +08:00
"description" : "User data and related operations"
2022-03-04 22:19:54 +08:00
} ,
{
"name" : "psas" ,
2022-03-05 00:50:45 +08:00
"description" : "Public service announcements"
2022-03-04 22:19:54 +08:00
} ,
{
"name" : "presets" ,
2022-03-05 00:50:45 +08:00
"description" : "Preset data and related operations"
2022-03-04 22:19:54 +08:00
} ,
{
"name" : "configs" ,
2022-03-05 00:50:45 +08:00
"description" : "User configuration data and related operations"
2022-03-04 22:19:54 +08:00
} ,
{
2022-03-04 22:43:17 +08:00
"name" : "ape-keys" ,
2022-03-05 00:50:45 +08:00
"description" : "ApeKey data and related operations"
2022-03-04 22:43:17 +08:00
} ,
{
"name" : "leaderboards" ,
2022-03-05 00:50:45 +08:00
"description" : "Leaderboard data"
2022-03-04 22:43:17 +08:00
} ,
{
"name" : "results" ,
2022-03-05 00:50:45 +08:00
"description" : "Result data and related operations"
2022-03-04 22:43:17 +08:00
} ,
{
"name" : "quotes" ,
2022-03-05 00:50:45 +08:00
"description" : "Quote data and related operations"
2022-03-01 04:17:37 +08:00
}
] ,
2022-03-01 02:53:07 +08:00
"paths" : {
2022-03-04 22:19:54 +08:00
"/" : {
"get" : {
"tags" : [ "index" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets the server's status data" ,
2022-03-04 22:19:54 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
2022-03-01 02:53:07 +08:00
"/users" : {
"get" : {
2022-03-01 04:17:37 +08:00
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Returns a user's data" ,
2022-03-01 04:17:37 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"delete" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Deletes a user's account" ,
2022-03-01 04:17:37 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/name" : {
"patch" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Updates a user's name" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"name" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/signup" : {
"post" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Creates a new user" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"email" : {
"type" : "string"
} ,
"name" : {
"type" : "string"
} ,
"uid" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/checkName/{name}" : {
"get" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Checks to see if a username is available" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"name" : "name" ,
"in" : "path" ,
"description" : "" ,
"required" : true ,
"type" : "string"
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/leaderboardMemory" : {
"patch" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Updates a user's cached leaderboard state" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"mode" : {
"type" : "string"
} ,
"mode2" : {
"type" : "string"
} ,
"language" : {
"type" : "string"
} ,
"rank" : {
"type" : "number"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/discord/link" : {
"post" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Links a user's account with a discord account" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"tokenType" : {
"type" : "string"
} ,
"accessToken" : {
"type" : "string"
} ,
"uid" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/discord/unlink" : {
"post" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Unlinks a user's account with a discord account" ,
2022-03-01 04:17:37 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/email" : {
"patch" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Updates a user's email" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"newEmail" : {
"type" : "string"
} ,
"previousEmail" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/personalBests" : {
"delete" : {
"tags" : [ "users" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets a user's personal bests" ,
2022-03-01 04:17:37 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/tags" : {
"get" : {
2022-03-05 00:50:45 +08:00
"tags" : [ "users" ] ,
"summary" : "Gets a user's tags" ,
2022-03-01 04:17:37 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"post" : {
2022-03-05 00:50:45 +08:00
"tags" : [ "users" ] ,
"summary" : "Creates a new tag" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"tagName" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"patch" : {
2022-03-05 00:50:45 +08:00
"tags" : [ "users" ] ,
"summary" : "Updates an existing tag" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"tagId" : {
"type" : "string"
} ,
"newName" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/tags/{tagId}" : {
"delete" : {
2022-03-05 00:50:45 +08:00
"tags" : [ "users" ] ,
"summary" : "Deletes a tag" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "path" ,
"name" : "tagId" ,
"required" : true ,
"type" : "string"
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/users/tags/{tagId}/personalBest" : {
"delete" : {
2022-03-05 00:50:45 +08:00
"tags" : [ "users" ] ,
"summary" : "Removes personal bests associated with a tag" ,
2022-03-01 04:17:37 +08:00
"parameters" : [
{
"in" : "path" ,
"name" : "tagId" ,
"required" : true ,
"type" : "string"
}
] ,
2022-03-01 02:53:07 +08:00
"responses" : {
2022-03-01 04:17:37 +08:00
"default" : {
"description" : "" ,
2022-03-01 02:53:07 +08:00
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
2022-03-04 22:19:54 +08:00
} ,
"/psas" : {
"get" : {
"tags" : [ "psas" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets the latest public service announcements" ,
2022-03-04 22:19:54 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/presets" : {
"get" : {
"tags" : [ "presets" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets saved preset configurations" ,
2022-03-04 22:19:54 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"post" : {
"tags" : [ "presets" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Creates a preset configuration" ,
2022-03-04 22:19:54 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"name" : {
"type" : "string"
} ,
"config" : {
"type" : "object"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"patch" : {
"tags" : [ "presets" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Updates an existing preset configuration" ,
2022-03-04 22:19:54 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"_id" : {
"type" : "string"
} ,
"name" : {
"type" : "string"
} ,
"config" : {
"type" : "object"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/presets/{presetId}" : {
"delete" : {
"tags" : [ "presets" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Deletes a preset configuration" ,
2022-03-04 22:19:54 +08:00
"parameters" : [
{
"in" : "path" ,
"name" : "presetId" ,
"required" : true ,
"type" : "string"
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/configs" : {
"get" : {
"tags" : [ "configs" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets the user's current configuration" ,
2022-03-04 22:19:54 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"patch" : {
"tags" : [ "configs" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Updates a user's configuration" ,
2022-03-04 22:19:54 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"config" : {
"type" : "object"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
2022-03-04 22:43:17 +08:00
} ,
"/ape-keys" : {
"get" : {
"tags" : [ "ape-keys" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets ApeKeys created by a user" ,
2022-03-04 22:43:17 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"post" : {
"tags" : [ "ape-keys" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Creates an ApeKey" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"name" : {
"type" : "string"
} ,
"enabled" : {
"type" : "boolean"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/ape-keys/{apeKeyId}" : {
"patch" : {
"tags" : [ "ape-keys" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Updates an ApeKey" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "path" ,
"name" : "apeKeyId" ,
"required" : true ,
"type" : "string"
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"delete" : {
"tags" : [ "ape-keys" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Deletes an ApeKey" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "path" ,
"name" : "apeKeyId" ,
"required" : true ,
"type" : "string"
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/leaderboards" : {
"get" : {
"tags" : [ "leaderboards" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets a leaderboard" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "query" ,
"name" : "language" ,
"type" : "string"
} ,
{
"in" : "query" ,
"name" : "mode" ,
"type" : "string"
} ,
{
"in" : "query" ,
"name" : "mode2" ,
"type" : "string"
} ,
{
"in" : "query" ,
"name" : "skip" ,
"type" : "number"
} ,
{
"in" : "query" ,
"name" : "limit" ,
"type" : "number"
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/leaderboards/rank" : {
"get" : {
"tags" : [ "leaderboards" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets a user's rank from a leaderboard" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "query" ,
"name" : "language" ,
"type" : "string"
} ,
{
"in" : "query" ,
"name" : "mode" ,
"type" : "string"
} ,
{
"in" : "query" ,
"name" : "mode2" ,
"type" : "string"
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/results" : {
"get" : {
"tags" : [ "results" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets a history of a user's results" ,
2022-03-04 22:43:17 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"post" : {
"tags" : [ "results" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Save a user's result" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"result" : {
"type" : "object"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"delete" : {
"tags" : [ "results" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Deletes all results" ,
2022-03-04 22:43:17 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/results/tags" : {
"patch" : {
"tags" : [ "results" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Labels a result with the specified tags" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"tagIds" : {
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
"resultId" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/quotes" : {
"get" : {
"tags" : [ "quotes" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets a list of quote submissions" ,
2022-03-04 22:43:17 +08:00
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"post" : {
"tags" : [ "quotes" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Creates a quote submission" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"text" : {
"type" : "string"
} ,
"source" : {
"type" : "string"
} ,
"language" : {
"type" : "string"
} ,
"captcha" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/quotes/approve" : {
"post" : {
"tags" : [ "quotes" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Approves a quote submission" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"quoteId" : {
"type" : "string"
} ,
"editText" : {
"type" : "string"
} ,
"editSource" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/quotes/reject" : {
"post" : {
"tags" : [ "quotes" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Rejects a quote submission" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"quoteId" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/quotes/rating" : {
"get" : {
"tags" : [ "quotes" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Gets a rating for a quote" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"quoteId" : {
"type" : "string"
} ,
"language" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
} ,
"post" : {
"tags" : [ "quotes" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Adds a rating for a quote" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"quoteId" : {
"type" : "string"
} ,
"rating" : {
"type" : "string"
} ,
"language" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
} ,
"/quotes/report" : {
"post" : {
"tags" : [ "quotes" ] ,
2022-03-05 00:50:45 +08:00
"summary" : "Reports a quote" ,
2022-03-04 22:43:17 +08:00
"parameters" : [
{
"in" : "body" ,
"name" : "body" ,
"required" : true ,
"schema" : {
"type" : "object" ,
"properties" : {
"quoteId" : {
"type" : "string"
} ,
"quoteLanguage" : {
"type" : "string"
} ,
"reason" : {
"type" : "string"
} ,
"comment" : {
"type" : "string"
} ,
"captcha" : {
"type" : "string"
}
}
}
}
] ,
"responses" : {
"default" : {
"description" : "" ,
"schema" : {
"$ref" : "#/definitions/Response"
}
}
}
}
2022-03-01 02:53:07 +08:00
}
} ,
"definitions" : {
"Response" : {
"type" : "object" ,
2022-03-05 00:50:45 +08:00
"required" : [ "message" , "data" ] ,
2022-03-01 02:53:07 +08:00
"properties" : {
"message" : {
"type" : "string"
} ,
"data" : {
"type" : "object"
}
}
}
}
}