{
  "swagger": "2.0",
  "info": {
    "title": "Nakama API v2",
    "version": "2.0",
    "contact": {
      "name": "The Nakama Authors \u0026 Contributors",
      "url": "https://github.com/heroiclabs/nakama",
      "email": "hello@heroiclabs.com"
    }
  },
  "host": "127.0.0.1:7350",
  "schemes": [
    "http"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/healthcheck": {
      "get": {
        "summary": "A healthcheck which load balancers can use to check the service.",
        "operationId": "Healthcheck",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account": {
      "get": {
        "summary": "Fetch the current user's account.",
        "operationId": "GetAccount",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiAccount"
            }
          }
        },
        "tags": [
          "Nakama"
        ]
      },
      "put": {
        "summary": "Update fields in the current user's account.",
        "operationId": "UpdateAccount",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiUpdateAccountRequest"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/authenticate/custom": {
      "post": {
        "summary": "Authenticate a user with a custom id against the server.",
        "operationId": "AuthenticateCustom",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The custom account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountCustom"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/authenticate/device": {
      "post": {
        "summary": "Authenticate a user with a device id against the server.",
        "operationId": "AuthenticateDevice",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The device account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountDevice"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/authenticate/email": {
      "post": {
        "summary": "Authenticate a user with an email+password against the server.",
        "operationId": "AuthenticateEmail",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The email account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountEmail"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/authenticate/facebook": {
      "post": {
        "summary": "Authenticate a user with a Facebook OAuth token against the server.",
        "operationId": "AuthenticateFacebook",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Facebook account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountFacebook"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "sync",
            "description": "Import Facebook friends for the user.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/authenticate/gamecenter": {
      "post": {
        "summary": "Authenticate a user with Apple's GameCenter against the server.",
        "operationId": "AuthenticateGameCenter",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Game Center account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountGameCenter"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/authenticate/google": {
      "post": {
        "summary": "Authenticate a user with Google against the server.",
        "operationId": "AuthenticateGoogle",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Google account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountGoogle"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/authenticate/steam": {
      "post": {
        "summary": "Authenticate a user with Steam against the server.",
        "operationId": "AuthenticateSteam",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Steam account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountSteam"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/link/custom": {
      "post": {
        "summary": "Add a custom ID to the social profiles on the current user's account.",
        "operationId": "LinkCustom",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountCustom"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/link/device": {
      "post": {
        "summary": "Add a device ID to the social profiles on the current user's account.",
        "operationId": "LinkDevice",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountDevice"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/link/email": {
      "post": {
        "summary": "Add an email+password to the social profiles on the current user's account.",
        "operationId": "LinkEmail",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountEmail"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/link/facebook": {
      "post": {
        "summary": "Add Facebook to the social profiles on the current user's account.",
        "operationId": "LinkFacebook",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Facebook account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountFacebook"
            }
          },
          {
            "name": "sync",
            "description": "Import Facebook friends for the user.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/link/gamecenter": {
      "post": {
        "summary": "Add Apple's GameCenter to the social profiles on the current user's account.",
        "operationId": "LinkGameCenter",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountGameCenter"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/link/google": {
      "post": {
        "summary": "Add Google to the social profiles on the current user's account.",
        "operationId": "LinkGoogle",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountGoogle"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/link/steam": {
      "post": {
        "summary": "Add Steam to the social profiles on the current user's account.",
        "operationId": "LinkSteam",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountSteam"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/custom": {
      "post": {
        "summary": "Remove the custom ID from the social profiles on the current user's account.",
        "operationId": "UnlinkCustom",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountCustom"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/device": {
      "post": {
        "summary": "Remove the device ID from the social profiles on the current user's account.",
        "operationId": "UnlinkDevice",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountDevice"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/email": {
      "post": {
        "summary": "Remove the email+password from the social profiles on the current user's account.",
        "operationId": "UnlinkEmail",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountEmail"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/facebook": {
      "post": {
        "summary": "Remove Facebook from the social profiles on the current user's account.",
        "operationId": "UnlinkFacebook",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountFacebook"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/gamecenter": {
      "post": {
        "summary": "Remove Apple's GameCenter from the social profiles on the current user's account.",
        "operationId": "UnlinkGameCenter",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountGameCenter"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/google": {
      "post": {
        "summary": "Remove Google from the social profiles on the current user's account.",
        "operationId": "UnlinkGoogle",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountGoogle"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/steam": {
      "post": {
        "summary": "Remove Steam from the social profiles on the current user's account.",
        "operationId": "UnlinkSteam",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountSteam"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/channel/{channel_id}": {
      "get": {
        "summary": "List a channel's message history.",
        "operationId": "ListChannelMessages",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiChannelMessageList"
            }
          }
        },
        "parameters": [
          {
            "name": "channel_id",
            "description": "The channel ID to list from.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "limit",
            "description": "Max number of records to return. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "forward",
            "description": "True if listing should be older messages to newer, false if reverse.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "cursor",
            "description": "A pagination cursor, if any.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/friend": {
      "get": {
        "summary": "List all friends for the current user.",
        "operationId": "ListFriends",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiFriends"
            }
          }
        },
        "tags": [
          "Nakama"
        ]
      },
      "delete": {
        "summary": "Delete one or more users by ID or username.",
        "operationId": "DeleteFriends",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "ids",
            "description": "The account id of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "usernames",
            "description": "The account username of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "post": {
        "summary": "Add friends by ID or username to a user's account.",
        "operationId": "AddFriends",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "ids",
            "description": "The account id of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "usernames",
            "description": "The account username of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/friend/block": {
      "post": {
        "summary": "Block one or more users by ID or username.",
        "operationId": "BlockFriends",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "ids",
            "description": "The account id of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "usernames",
            "description": "The account username of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/friend/facebook": {
      "post": {
        "summary": "Import Facebook friends and add them to a user's account.",
        "operationId": "ImportFacebookFriends",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Facebook account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountFacebook"
            }
          },
          {
            "name": "reset",
            "description": "Reset the current user's friends list.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group": {
      "get": {
        "summary": "List groups based on given filters.",
        "operationId": "ListGroups",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiGroupList"
            }
          }
        },
        "parameters": [
          {
            "name": "name",
            "description": "List groups that contain this value in their names.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "cursor",
            "description": "Optional pagination cursor.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "limit",
            "description": "Max number of groups to return. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "post": {
        "summary": "Create a new group with the current user as the owner.",
        "operationId": "CreateGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiGroup"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiCreateGroupRequest"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group/{group_id}": {
      "delete": {
        "summary": "Delete a group by ID.",
        "operationId": "DeleteGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The id of a group.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "put": {
        "summary": "Update fields in a given group.",
        "operationId": "UpdateGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The ID of the group to update.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiUpdateGroupRequest"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group/{group_id}/add": {
      "post": {
        "summary": "Add users to a group.",
        "operationId": "AddGroupUsers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The group to add users to.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "user_ids",
            "description": "The users to add.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group/{group_id}/join": {
      "post": {
        "summary": "Immediately join an open group, or request to join a closed one.",
        "operationId": "JoinGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The group ID to join. The group must already exist.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group/{group_id}/kick": {
      "post": {
        "summary": "Kick a set of users from a group.",
        "operationId": "KickGroupUsers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The group ID to kick from.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "user_ids",
            "description": "The users to kick.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group/{group_id}/leave": {
      "post": {
        "summary": "Leave a group the user is a member of.",
        "operationId": "LeaveGroup",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The group ID to leave.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group/{group_id}/promote": {
      "post": {
        "summary": "Promote a set of users in a group to the next role up.",
        "operationId": "PromoteGroupUsers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The group ID to promote in.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "user_ids",
            "description": "The users to promote.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/group/{group_id}/user": {
      "get": {
        "summary": "List all users that are part of a group.",
        "operationId": "ListGroupUsers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiGroupUserList"
            }
          }
        },
        "parameters": [
          {
            "name": "group_id",
            "description": "The group ID to list from.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/leaderboard/{leaderboard_id}": {
      "get": {
        "summary": "List leaderboard records.",
        "operationId": "ListLeaderboardRecords",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiLeaderboardRecordList"
            }
          }
        },
        "parameters": [
          {
            "name": "leaderboard_id",
            "description": "The ID of the leaderboard to list for.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "owner_ids",
            "description": "One or more owners to retrieve records for.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "description": "Max number of records to return. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "cursor",
            "description": "A next or previous page cursor.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from. Optional. 0 means from current time.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "delete": {
        "summary": "Delete a leaderboard record.",
        "operationId": "DeleteLeaderboardRecord",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "leaderboard_id",
            "description": "The leaderboard ID to delete from.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "post": {
        "summary": "Write a record to a leaderboard.",
        "operationId": "WriteLeaderboardRecord",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiLeaderboardRecord"
            }
          }
        },
        "parameters": [
          {
            "name": "leaderboard_id",
            "description": "The ID of the leaderboard to write to.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "description": "Record input.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WriteLeaderboardRecordRequestLeaderboardRecordWrite"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/leaderboard/{leaderboard_id}/owner/{owner_id}": {
      "get": {
        "summary": "List leaderboard records that belong to a user.",
        "operationId": "ListLeaderboardRecordsAroundOwner",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiLeaderboardRecordList"
            }
          }
        },
        "parameters": [
          {
            "name": "leaderboard_id",
            "description": "The ID of the tournament to list for.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "owner_id",
            "description": "The owner to retrieve records around.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "limit",
            "description": "Max number of records to return. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/match": {
      "get": {
        "summary": "Fetch list of running matches.",
        "operationId": "ListMatches",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiMatchList"
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "description": "Limit the number of returned matches.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "authoritative",
            "description": "Authoritative or relayed matches.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "label",
            "description": "Label filter.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "min_size",
            "description": "Minimum user count.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "max_size",
            "description": "Maximum user count.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "query",
            "description": "Arbitrary label query.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/notification": {
      "get": {
        "summary": "Fetch list of notifications.",
        "operationId": "ListNotifications",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiNotificationList"
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "description": "The number of notifications to get. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "cacheable_cursor",
            "description": "A cursor to page through notifications. May be cached by clients to get from point in time forwards.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "delete": {
        "summary": "Delete one or more notifications for the current user.",
        "operationId": "DeleteNotifications",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "ids",
            "description": "The id of notifications.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/rpc/{id}": {
      "get": {
        "summary": "Execute a Lua function on the server.",
        "operationId": "RpcFunc2",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiRpc"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "description": "The identifier of the function.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "payload",
            "description": "The payload of the function which must be a JSON object.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "http_key",
            "description": "The authentication key used when executed as a non-client HTTP request.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BearerJwt": [],
            "HttpKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Execute a Lua function on the server.",
        "operationId": "RpcFunc",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiRpc"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "description": "The identifier of the function.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "description": "The payload of the function which must be a JSON object.",
            "in": "body",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BearerJwt": [],
            "HttpKeyAuth": []
          }
        ]
      }
    },
    "/v2/storage": {
      "post": {
        "summary": "Get storage objects.",
        "operationId": "ReadStorageObjects",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiStorageObjects"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiReadStorageObjectsRequest"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "put": {
        "summary": "Write objects into the storage engine.",
        "operationId": "WriteStorageObjects",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiStorageObjectAcks"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiWriteStorageObjectsRequest"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/storage/delete": {
      "put": {
        "summary": "Delete one or more objects by ID or username.",
        "operationId": "DeleteStorageObjects",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiDeleteStorageObjectsRequest"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/storage/{collection}": {
      "get": {
        "summary": "List publicly readable storage objects in a given collection.",
        "operationId": "ListStorageObjects",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiStorageObjectList"
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "description": "The collection which stores the object.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "user_id",
            "description": "ID of the user.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "limit",
            "description": "The number of storage objects to list. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "cursor",
            "description": "The cursor to page through results from.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/storage/{collection}/{user_id}": {
      "get": {
        "summary": "List publicly readable storage objects in a given collection.",
        "operationId": "ListStorageObjects2",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiStorageObjectList"
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "description": "The collection which stores the object.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "user_id",
            "description": "ID of the user.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "limit",
            "description": "The number of storage objects to list. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "cursor",
            "description": "The cursor to page through results from.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/tournament": {
      "get": {
        "summary": "List current or upcoming tournaments.",
        "operationId": "ListTournaments",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiTournamentList"
            }
          }
        },
        "parameters": [
          {
            "name": "category_start",
            "description": "The start of the categories to include. Defaults to 0.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "category_end",
            "description": "The end of the categories to include. Defaults to 128.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "start_time",
            "description": "The start time for tournaments. Defaults to epoch.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "end_time",
            "description": "The end time for tournaments. Defaults to +1 year from current Unix time.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "limit",
            "description": "Max number of records to return. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "cursor",
            "description": "A next page cursor for listings (optional).",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/tournament/{tournament_id}": {
      "get": {
        "summary": "List tournament records.",
        "operationId": "ListTournamentRecords",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiTournamentRecordList"
            }
          }
        },
        "parameters": [
          {
            "name": "tournament_id",
            "description": "The ID of the tournament to list for.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "owner_ids",
            "description": "One or more owners to retrieve records for.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "description": "Max number of records to return. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "cursor",
            "description": "A next or previous page cursor.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      },
      "put": {
        "summary": "Write a record to a tournament.",
        "operationId": "WriteTournamentRecord",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiLeaderboardRecord"
            }
          }
        },
        "parameters": [
          {
            "name": "tournament_id",
            "description": "The tournament ID to write the record for.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "description": "Record input.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/WriteTournamentRecordRequestTournamentRecordWrite"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/tournament/{tournament_id}/join": {
      "post": {
        "summary": "Attempt to join an open and running tournament.",
        "operationId": "JoinTournament",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "tournament_id",
            "description": "The ID of the tournament to join. The tournament must already exist.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/tournament/{tournament_id}/owner/{owner_id}": {
      "get": {
        "summary": "List tournament records for a given owner.",
        "operationId": "ListTournamentRecordsAroundOwner",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiTournamentRecordList"
            }
          }
        },
        "parameters": [
          {
            "name": "tournament_id",
            "description": "The ID of the tournament to list for.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "owner_id",
            "description": "The owner to retrieve records around.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "limit",
            "description": "Max number of records to return. Between 1 and 100.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/user": {
      "get": {
        "summary": "Fetch zero or more users by ID and/or username.",
        "operationId": "GetUsers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiUsers"
            }
          }
        },
        "parameters": [
          {
            "name": "ids",
            "description": "The account id of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "usernames",
            "description": "The account username of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "name": "facebook_ids",
            "description": "The Facebook ID of a user.",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/user/{user_id}/group": {
      "get": {
        "summary": "List groups the current user belongs to.",
        "operationId": "ListUserGroups",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiUserGroupList"
            }
          }
        },
        "parameters": [
          {
            "name": "user_id",
            "description": "ID of the user.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    }
  },
  "definitions": {
    "GroupUserListGroupUser": {
      "type": "object",
      "properties": {
        "user": {
          "$ref": "#/definitions/apiUser",
          "description": "User."
        },
        "state": {
          "type": "integer",
          "format": "int32",
          "description": "Their relationship to the group."
        }
      },
      "description": "A single user-role pair."
    },
    "UserGroupListUserGroup": {
      "type": "object",
      "properties": {
        "group": {
          "$ref": "#/definitions/apiGroup",
          "description": "Group."
        },
        "state": {
          "type": "integer",
          "format": "int32",
          "description": "The user's relationship to the group."
        }
      },
      "description": "A single group-role pair."
    },
    "WriteLeaderboardRecordRequestLeaderboardRecordWrite": {
      "type": "object",
      "properties": {
        "score": {
          "type": "string",
          "format": "int64",
          "description": "The score value to submit."
        },
        "subscore": {
          "type": "string",
          "format": "int64",
          "description": "An optional secondary value."
        },
        "metadata": {
          "type": "string",
          "description": "Optional record metadata."
        }
      },
      "description": "Record values to write."
    },
    "WriteTournamentRecordRequestTournamentRecordWrite": {
      "type": "object",
      "properties": {
        "score": {
          "type": "string",
          "format": "int64",
          "description": "The score value to submit."
        },
        "subscore": {
          "type": "string",
          "format": "int64",
          "description": "An optional secondary value."
        },
        "metadata": {
          "type": "string",
          "description": "A JSON object of additional properties (optional)."
        }
      },
      "description": "Record values to write."
    },
    "apiAccount": {
      "type": "object",
      "properties": {
        "user": {
          "$ref": "#/definitions/apiUser",
          "description": "The user object."
        },
        "wallet": {
          "type": "string",
          "description": "The user's wallet data."
        },
        "email": {
          "type": "string",
          "description": "The email address of the user."
        },
        "devices": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiAccountDevice"
          },
          "description": "The devices which belong to the user's account."
        },
        "custom_id": {
          "type": "string",
          "description": "The custom id in the user's account."
        },
        "verify_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the user's email was verified."
        }
      },
      "description": "A user with additional account details. Always the current user."
    },
    "apiAccountCustom": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "A custom identifier."
        }
      },
      "description": "Send a custom ID to the server. Used with authenticate/link/unlink."
    },
    "apiAccountDevice": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "A device identifier. Should be obtained by a platform-specific device API."
        }
      },
      "description": "Send a device to the server. Used with authenticate/link/unlink and user."
    },
    "apiAccountEmail": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "description": "A valid RFC-5322 email address."
        },
        "password": {
          "type": "string",
          "description": "A password for the user account."
        }
      },
      "description": "Send an email with password to the server. Used with authenticate/link/unlink."
    },
    "apiAccountFacebook": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "The OAuth token received from Facebook to access their profile API."
        }
      },
      "description": "Send a Facebook token to the server. Used with authenticate/link/unlink."
    },
    "apiAccountGameCenter": {
      "type": "object",
      "properties": {
        "player_id": {
          "type": "string",
          "description": "Player ID (generated by GameCenter)."
        },
        "bundle_id": {
          "type": "string",
          "description": "Bundle ID (generated by GameCenter)."
        },
        "timestamp_seconds": {
          "type": "string",
          "format": "int64",
          "description": "Time since UNIX epoch when the signature was created."
        },
        "salt": {
          "type": "string",
          "description": "A random \"NSString\" used to compute the hash and keep it randomized."
        },
        "signature": {
          "type": "string",
          "description": "The verification signature data generated."
        },
        "public_key_url": {
          "type": "string",
          "description": "The URL for the public encryption key."
        }
      },
      "description": "Send Apple's Game Center account credentials to the server. Used with authenticate/link/unlink."
    },
    "apiAccountGoogle": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "The OAuth token received from Google to access their profile API."
        }
      },
      "description": "Send a Google token to the server. Used with authenticate/link/unlink."
    },
    "apiAccountSteam": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "The account token received from Steam to access their profile API."
        }
      },
      "description": "Send a Steam token to the server. Used with authenticate/link/unlink."
    },
    "apiChannelMessage": {
      "type": "object",
      "properties": {
        "channel_id": {
          "type": "string",
          "description": "The channel this message belongs to."
        },
        "message_id": {
          "type": "string",
          "description": "The unique ID of this message."
        },
        "code": {
          "type": "integer",
          "format": "int32",
          "description": "The code representing a message type or category."
        },
        "sender_id": {
          "type": "string",
          "description": "Message sender, usually a user ID."
        },
        "username": {
          "type": "string",
          "description": "The username of the message sender, if any."
        },
        "content": {
          "type": "string",
          "description": "The content payload."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the message was created."
        },
        "update_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the message was last updated."
        },
        "persistent": {
          "type": "boolean",
          "format": "boolean",
          "description": "True if the message was persisted to the channel's history, false otherwise."
        }
      },
      "description": "A message sent on a channel."
    },
    "apiChannelMessageList": {
      "type": "object",
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiChannelMessage"
          },
          "description": "A list of messages."
        },
        "next_cursor": {
          "type": "string",
          "description": "The cursor to send when retireving the next page, if any."
        },
        "prev_cursor": {
          "type": "string",
          "description": "The cursor to send when retrieving the previous page, if any."
        }
      },
      "description": "A list of channel messages, usually a result of a list operation."
    },
    "apiCreateGroupRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "A unique name for the group."
        },
        "description": {
          "type": "string",
          "description": "A description for the group."
        },
        "lang_tag": {
          "type": "string",
          "description": "The language expected to be a tag which follows the BCP-47 spec."
        },
        "avatar_url": {
          "type": "string",
          "description": "A URL for an avatar image."
        },
        "open": {
          "type": "boolean",
          "format": "boolean",
          "description": "Mark a group as open or not where only admins can accept members."
        }
      },
      "description": "Create a group with the current user as owner."
    },
    "apiDeleteStorageObjectId": {
      "type": "object",
      "properties": {
        "collection": {
          "type": "string",
          "description": "The collection which stores the object."
        },
        "key": {
          "type": "string",
          "description": "The key of the object within the collection."
        },
        "version": {
          "type": "string",
          "description": "The version hash of the object."
        }
      },
      "description": "Storage objects to delete."
    },
    "apiDeleteStorageObjectsRequest": {
      "type": "object",
      "properties": {
        "object_ids": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiDeleteStorageObjectId"
          },
          "description": "Batch of storage objects."
        }
      },
      "description": "Batch delete storage objects."
    },
    "apiFriend": {
      "type": "object",
      "properties": {
        "user": {
          "$ref": "#/definitions/apiUser",
          "description": "The user object."
        },
        "state": {
          "type": "integer",
          "format": "int32",
          "description": "The friend status."
        }
      },
      "description": "A friend of a user."
    },
    "apiFriends": {
      "type": "object",
      "properties": {
        "friends": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiFriend"
          },
          "description": "The Friend objects."
        }
      },
      "description": "A collection of zero or more friends of the user."
    },
    "apiGroup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The id of a group."
        },
        "creator_id": {
          "type": "string",
          "description": "The id of the user who created the group."
        },
        "name": {
          "type": "string",
          "description": "The unique name of the group."
        },
        "description": {
          "type": "string",
          "description": "A description for the group."
        },
        "lang_tag": {
          "type": "string",
          "description": "The language expected to be a tag which follows the BCP-47 spec."
        },
        "metadata": {
          "type": "string",
          "description": "Additional information stored as a JSON object."
        },
        "avatar_url": {
          "type": "string",
          "description": "A URL for an avatar image."
        },
        "open": {
          "type": "boolean",
          "format": "boolean",
          "description": "Anyone can join open groups, otherwise only admins can accept members."
        },
        "edge_count": {
          "type": "integer",
          "format": "int32",
          "description": "The current count of all members in the group."
        },
        "max_count": {
          "type": "integer",
          "format": "int32",
          "description": "The maximum number of members allowed."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the group was created."
        },
        "update_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the group was last updated."
        }
      },
      "description": "A group in the server."
    },
    "apiGroupList": {
      "type": "object",
      "properties": {
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiGroup"
          },
          "description": "One or more groups."
        },
        "cursor": {
          "type": "string",
          "description": "A cursor used to get the next page."
        }
      },
      "description": "One or more groups returned from a listing operation."
    },
    "apiGroupUserList": {
      "type": "object",
      "properties": {
        "group_users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GroupUserListGroupUser"
          },
          "description": "User-role pairs for a group."
        }
      },
      "description": "A list of users belonging to a group, along with their role."
    },
    "apiLeaderboardRecord": {
      "type": "object",
      "properties": {
        "leaderboard_id": {
          "type": "string",
          "description": "The ID of the leaderboard this score belongs to."
        },
        "owner_id": {
          "type": "string",
          "description": "The ID of the score owner, usually a user or group."
        },
        "username": {
          "type": "string",
          "description": "The username of the score owner, if the owner is a user."
        },
        "score": {
          "type": "string",
          "format": "int64",
          "description": "The score value."
        },
        "subscore": {
          "type": "string",
          "format": "int64",
          "description": "An optional subscore value."
        },
        "num_score": {
          "type": "integer",
          "format": "int32",
          "description": "The number of submissions to this score record."
        },
        "metadata": {
          "type": "string",
          "description": "Metadata."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the leaderboard record was created."
        },
        "update_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the leaderboard record was updated."
        },
        "expiry_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the leaderboard record expires."
        },
        "rank": {
          "type": "string",
          "format": "int64",
          "description": "The rank of this record."
        },
        "max_num_score": {
          "type": "integer",
          "format": "int64",
          "description": "The maximum number of score updates allowed by the owner."
        }
      },
      "description": "Represents a complete leaderboard record with all scores and associated metadata."
    },
    "apiLeaderboardRecordList": {
      "type": "object",
      "properties": {
        "records": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiLeaderboardRecord"
          },
          "description": "A list of leaderboard records."
        },
        "owner_records": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiLeaderboardRecord"
          },
          "description": "A batched set of leaderobard records belonging to specified owners."
        },
        "next_cursor": {
          "type": "string",
          "description": "The cursor to send when retireving the next page, if any."
        },
        "prev_cursor": {
          "type": "string",
          "description": "The cursor to send when retrieving the previous page, if any."
        }
      },
      "description": "A set of leaderboard records, may be part of a leaderboard records page or a batch of individual records."
    },
    "apiMatch": {
      "type": "object",
      "properties": {
        "match_id": {
          "type": "string",
          "description": "The ID of the match, can be used to join."
        },
        "authoritative": {
          "type": "boolean",
          "format": "boolean",
          "description": "True if it's an server-managed authoritative match, false otherwise."
        },
        "label": {
          "type": "string",
          "description": "Match label, if any."
        },
        "size": {
          "type": "integer",
          "format": "int32",
          "description": "Current number of users in the match."
        }
      },
      "description": "Represents a realtime match."
    },
    "apiMatchList": {
      "type": "object",
      "properties": {
        "matches": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiMatch"
          },
          "description": "A number of matches corresponding to a list operation."
        }
      },
      "description": "A list of realtime matches."
    },
    "apiNotification": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of the Notification."
        },
        "subject": {
          "type": "string",
          "description": "Subject of the notification."
        },
        "content": {
          "type": "string",
          "description": "Content of the notification in JSON."
        },
        "code": {
          "type": "integer",
          "format": "int32",
          "description": "Category code for this notification."
        },
        "sender_id": {
          "type": "string",
          "description": "ID of the sender, if a user. Otherwise 'null'."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the notification was created."
        },
        "persistent": {
          "type": "boolean",
          "format": "boolean",
          "description": "True if this notification was persisted to the database."
        }
      },
      "description": "A notification in the server."
    },
    "apiNotificationList": {
      "type": "object",
      "properties": {
        "notifications": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiNotification"
          },
          "description": "Collection of notifications."
        },
        "cacheable_cursor": {
          "type": "string",
          "description": "Use this cursor to paginate notifications. Cache this to catch up to new notifications."
        }
      },
      "description": "A collection of zero or more notifications."
    },
    "apiReadStorageObjectId": {
      "type": "object",
      "properties": {
        "collection": {
          "type": "string",
          "description": "The collection which stores the object."
        },
        "key": {
          "type": "string",
          "description": "The key of the object within the collection."
        },
        "user_id": {
          "type": "string",
          "description": "The user owner of the object."
        }
      },
      "description": "Storage objects to get."
    },
    "apiReadStorageObjectsRequest": {
      "type": "object",
      "properties": {
        "object_ids": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiReadStorageObjectId"
          },
          "description": "Batch of storage objects."
        }
      },
      "description": "Batch get storage objects."
    },
    "apiRpc": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the function."
        },
        "payload": {
          "type": "string",
          "description": "The payload of the function which must be a JSON object."
        },
        "http_key": {
          "type": "string",
          "description": "The authentication key used when executed as a non-client HTTP request."
        }
      },
      "description": "Execute an Lua function on the server."
    },
    "apiSession": {
      "type": "object",
      "properties": {
        "created": {
          "type": "boolean",
          "format": "boolean",
          "description": "True if the corresponding account was just created, false otherwise."
        },
        "token": {
          "type": "string",
          "description": "Authentication credentials."
        },
        "udp_token": {
          "type": "string",
          "description": "rUDP specific authentication credentials."
        }
      },
      "description": "A user's session used to authenticate messages."
    },
    "apiStorageObject": {
      "type": "object",
      "properties": {
        "collection": {
          "type": "string",
          "description": "The collection which stores the object."
        },
        "key": {
          "type": "string",
          "description": "The key of the object within the collection."
        },
        "user_id": {
          "type": "string",
          "description": "The user owner of the object."
        },
        "value": {
          "type": "string",
          "description": "The value of the object."
        },
        "version": {
          "type": "string",
          "description": "The version hash of the object."
        },
        "permission_read": {
          "type": "integer",
          "format": "int32",
          "description": "The read access permissions for the object."
        },
        "permission_write": {
          "type": "integer",
          "format": "int32",
          "description": "The write access permissions for the object."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the object was created."
        },
        "update_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the object was last updated."
        }
      },
      "description": "An object within the storage engine."
    },
    "apiStorageObjectAck": {
      "type": "object",
      "properties": {
        "collection": {
          "type": "string",
          "description": "The collection which stores the object."
        },
        "key": {
          "type": "string",
          "description": "The key of the object within the collection."
        },
        "version": {
          "type": "string",
          "description": "The version hash of the object."
        },
        "user_id": {
          "type": "string",
          "description": "The owner of the object."
        }
      },
      "description": "A storage acknowledgement."
    },
    "apiStorageObjectAcks": {
      "type": "object",
      "properties": {
        "acks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiStorageObjectAck"
          },
          "description": "Batch of storage write acknowledgements."
        }
      },
      "description": "Batch of acknowledgements for the storage object write."
    },
    "apiStorageObjectList": {
      "type": "object",
      "properties": {
        "objects": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiStorageObject"
          },
          "description": "The list of storage objects."
        },
        "cursor": {
          "type": "string",
          "description": "The cursor associated with the query a page of results."
        }
      },
      "description": "List of storage objects."
    },
    "apiStorageObjects": {
      "type": "object",
      "properties": {
        "objects": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiStorageObject"
          },
          "description": "The batch of storage objects."
        }
      },
      "description": "Batch of storage objects."
    },
    "apiTournament": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID of the tournament."
        },
        "title": {
          "type": "string",
          "description": "The title for the tournament."
        },
        "description": {
          "type": "string",
          "description": "The description of the tournament. May be blank."
        },
        "category": {
          "type": "integer",
          "format": "int64",
          "description": "The category of the tournament. e.g. \"vip\" could be category 1."
        },
        "sort_order": {
          "type": "integer",
          "format": "int64",
          "description": "ASC or DESC sort mode of scores in the tournament."
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "description": "The current number of players in the tournament."
        },
        "max_size": {
          "type": "integer",
          "format": "int64",
          "description": "The maximum number of players for the tournament."
        },
        "max_num_score": {
          "type": "integer",
          "format": "int64",
          "description": "The maximum score updates allowed per player for the current tournament."
        },
        "can_enter": {
          "type": "boolean",
          "format": "boolean",
          "description": "True if the tournament is active and can enter. A computed value."
        },
        "end_active": {
          "type": "integer",
          "format": "int64",
          "description": "The UNIX time when the tournament stops being active until next reset. A computed value."
        },
        "next_reset": {
          "type": "integer",
          "format": "int64",
          "description": "The UNIX time when the tournament is next playable. A computed value."
        },
        "metadata": {
          "type": "string",
          "description": "Additional information stored as a JSON object."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the tournament was created."
        },
        "start_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the tournament will start."
        },
        "end_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the tournament will be stopped."
        },
        "duration": {
          "type": "integer",
          "format": "int64",
          "description": "Duration of the tournament in seconds."
        },
        "start_active": {
          "type": "integer",
          "format": "int64",
          "description": "The UNIX time when the tournament start being active. A computed value."
        }
      },
      "description": "A tournament on the server."
    },
    "apiTournamentList": {
      "type": "object",
      "properties": {
        "tournaments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiTournament"
          },
          "description": "The list of tournaments returned."
        },
        "cursor": {
          "type": "string",
          "description": "A pagination cursor (optional)."
        }
      },
      "description": "A list of tournaments."
    },
    "apiTournamentRecordList": {
      "type": "object",
      "properties": {
        "records": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiLeaderboardRecord"
          },
          "description": "A list of tournament records."
        },
        "owner_records": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiLeaderboardRecord"
          },
          "description": "A batched set of tournament records belonging to specified owners."
        },
        "next_cursor": {
          "type": "string",
          "description": "The cursor to send when retireving the next page (optional)."
        },
        "prev_cursor": {
          "type": "string",
          "description": "The cursor to send when retrieving the previous page (optional)."
        }
      },
      "description": "A set of tournament records which may be part of a tournament records page or a batch of individual records."
    },
    "apiUpdateAccountRequest": {
      "type": "object",
      "properties": {
        "username": {
          "type": "string",
          "description": "The username of the user's account."
        },
        "display_name": {
          "type": "string",
          "description": "The display name of the user."
        },
        "avatar_url": {
          "type": "string",
          "description": "A URL for an avatar image."
        },
        "lang_tag": {
          "type": "string",
          "description": "The language expected to be a tag which follows the BCP-47 spec."
        },
        "location": {
          "type": "string",
          "description": "The location set by the user."
        },
        "timezone": {
          "type": "string",
          "description": "The timezone set by the user."
        }
      },
      "description": "Update a user's account details."
    },
    "apiUpdateGroupRequest": {
      "type": "object",
      "properties": {
        "group_id": {
          "type": "string",
          "description": "The ID of the group to update."
        },
        "name": {
          "type": "string",
          "description": "Name."
        },
        "description": {
          "type": "string",
          "description": "Description string."
        },
        "lang_tag": {
          "type": "string",
          "description": "Lang tag."
        },
        "avatar_url": {
          "type": "string",
          "description": "Avatar URL."
        },
        "open": {
          "type": "boolean",
          "format": "boolean",
          "description": "Open is true if anyone should be allowed to join, or false if joins must be approved by a group admin."
        }
      },
      "description": "Update fields in a given group."
    },
    "apiUser": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The id of the user's account."
        },
        "username": {
          "type": "string",
          "description": "The username of the user's account."
        },
        "display_name": {
          "type": "string",
          "description": "The display name of the user."
        },
        "avatar_url": {
          "type": "string",
          "description": "A URL for an avatar image."
        },
        "lang_tag": {
          "type": "string",
          "description": "The language expected to be a tag which follows the BCP-47 spec."
        },
        "location": {
          "type": "string",
          "description": "The location set by the user."
        },
        "timezone": {
          "type": "string",
          "description": "The timezone set by the user."
        },
        "metadata": {
          "type": "string",
          "description": "Additional information stored as a JSON object."
        },
        "facebook_id": {
          "type": "string",
          "description": "The Facebook id in the user's account."
        },
        "google_id": {
          "type": "string",
          "description": "The Google id in the user's account."
        },
        "gamecenter_id": {
          "type": "string",
          "description": "The Apple Game Center in of the user's account."
        },
        "steam_id": {
          "type": "string",
          "description": "The Steam id in the user's account."
        },
        "online": {
          "type": "boolean",
          "format": "boolean",
          "description": "Indicates whether the user is currently online."
        },
        "edge_count": {
          "type": "integer",
          "format": "int32",
          "description": "Number of related edges to this user."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the user was created."
        },
        "update_time": {
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the user was last updated."
        }
      },
      "description": "A user in the server."
    },
    "apiUserGroupList": {
      "type": "object",
      "properties": {
        "user_groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserGroupListUserGroup"
          },
          "description": "Group-role pairs for a user."
        }
      },
      "description": "A list of groups belonging to a user, along with the user's role in each group."
    },
    "apiUsers": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiUser"
          },
          "description": "The User objects."
        }
      },
      "description": "A collection of zero or more users."
    },
    "apiWriteStorageObject": {
      "type": "object",
      "properties": {
        "collection": {
          "type": "string",
          "description": "The collection to store the object."
        },
        "key": {
          "type": "string",
          "description": "The key for the object within the collection."
        },
        "value": {
          "type": "string",
          "description": "The value of the object."
        },
        "version": {
          "type": "string",
          "description": "The version hash of the object to check. Possible values are: [\"\", \"*\", \"#hash#\"]."
        },
        "permission_read": {
          "type": "integer",
          "format": "int32",
          "description": "The read access permissions for the object."
        },
        "permission_write": {
          "type": "integer",
          "format": "int32",
          "description": "The write access permissions for the object."
        }
      },
      "description": "The object to store."
    },
    "apiWriteStorageObjectsRequest": {
      "type": "object",
      "properties": {
        "objects": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/apiWriteStorageObject"
          },
          "description": "The objects to store on the server."
        }
      },
      "description": "Write objects to the storage engine."
    }
  },
  "securityDefinitions": {
    "BasicAuth": {
      "type": "basic"
    },
    "BearerJwt": {
      "type": ""
    },
    "HttpKeyAuth": {
      "type": "apiKey",
      "name": "http_key",
      "in": "header"
    }
  },
  "security": [
    {
      "BearerJwt": []
    }
  ],
  "externalDocs": {
    "description": "Nakama server documentation",
    "url": "https://heroiclabs.com/docs"
  }
}
