mirror of
https://github.com/stoatchat/javascript-client-api.git
synced 2026-07-21 12:35:26 -04:00
676cf920c9
Route: Added `Edit Role`. Structure: Moved `Colour` into its own type. Fix: Missing bodies on two auth routes. Fix: First entry to edits should be optional. Library: Ignore temp file. Library: Add guidelines.
16194 lines
554 KiB
JSON
16194 lines
554 KiB
JSON
{
|
|
"__comment": "THIS FILE WAS AUTO-GENERATED USING https://gitlab.insrt.uk/revolt/api. DO NOT EDIT.",
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"title": "Revolt API",
|
|
"version": "0.5.1-alpha.8",
|
|
"description": "User-first privacy focused chat platform built with modern web technologies.\n\n# Authentication\n\nCurrently all relevant requests are authenticated by the use of two headers which identify a session.\n\n<SecurityDefinitions />",
|
|
"termsOfService": "https://revolt.chat/terms",
|
|
"contact": {
|
|
"name": "API Support",
|
|
"email": "contact@revolt.chat",
|
|
"url": "https://revolt.chat"
|
|
},
|
|
"x-logo": {
|
|
"url": "https://revolt.chat/header.png",
|
|
"altText": "Revolt Header"
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Core",
|
|
"description": "Use in your applications to determine information about the Revolt node."
|
|
},
|
|
{
|
|
"name": "Onboarding",
|
|
"description": "After signing up to Revolt, users must pick a unique username."
|
|
},
|
|
{
|
|
"name": "Auth",
|
|
"description": "Authenticate with Revolt"
|
|
},
|
|
{
|
|
"name": "User Information",
|
|
"description": "Query and fetch users on Revolt"
|
|
},
|
|
{
|
|
"name": "Direct Messaging",
|
|
"description": "Direct message other users on Revolt"
|
|
},
|
|
{
|
|
"name": "Relationships",
|
|
"description": "Manage your friendships and block list on the platform"
|
|
},
|
|
{
|
|
"name": "Channel Information",
|
|
"description": "Query and fetch channels on Revolt"
|
|
},
|
|
{
|
|
"name": "Channel Invites",
|
|
"description": "Create and manage invites for channels"
|
|
},
|
|
{
|
|
"name": "Channel Permissions",
|
|
"description": "Manage permissions for channels"
|
|
},
|
|
{
|
|
"name": "Messaging",
|
|
"description": "Send and manipulate messages"
|
|
},
|
|
{
|
|
"name": "Groups",
|
|
"description": "Create, invite users and manipulate groups"
|
|
},
|
|
{
|
|
"name": "Voice",
|
|
"description": "Join and talk with other users"
|
|
},
|
|
{
|
|
"name": "Server Information",
|
|
"description": "Query and fetch servers on Revolt"
|
|
},
|
|
{
|
|
"name": "Server Members",
|
|
"description": "Find and edit server members"
|
|
},
|
|
{
|
|
"name": "Server Permissions",
|
|
"description": "Manage permissions for servers"
|
|
},
|
|
{
|
|
"name": "Invites",
|
|
"description": "View, join and delete invites"
|
|
},
|
|
{
|
|
"name": "Sync",
|
|
"description": "Upload and retrieve any JSON data between clients"
|
|
},
|
|
{
|
|
"name": "Web Push",
|
|
"description": "Subscribe to and receive Revolt push notifications while offline"
|
|
}
|
|
],
|
|
"x-tagGroups": [
|
|
{
|
|
"name": "Chat Platform",
|
|
"tags": [
|
|
"Core",
|
|
"Onboarding"
|
|
]
|
|
},
|
|
{
|
|
"name": "Auth",
|
|
"tags": [
|
|
"Auth"
|
|
]
|
|
},
|
|
{
|
|
"name": "Users",
|
|
"tags": [
|
|
"User Information",
|
|
"Direct Messaging",
|
|
"Relationships"
|
|
]
|
|
},
|
|
{
|
|
"name": "Channels",
|
|
"tags": [
|
|
"Channel Information",
|
|
"Channel Invites",
|
|
"Channel Permissions",
|
|
"Messaging",
|
|
"Groups",
|
|
"Voice"
|
|
]
|
|
},
|
|
{
|
|
"name": "Servers",
|
|
"tags": [
|
|
"Server Information",
|
|
"Server Members",
|
|
"Server Permissions"
|
|
]
|
|
},
|
|
{
|
|
"name": "Miscellaneous",
|
|
"tags": [
|
|
"Invites",
|
|
"Sync",
|
|
"Web Push"
|
|
]
|
|
}
|
|
],
|
|
"paths": {
|
|
"/": {
|
|
"get": {
|
|
"summary": "Query Node",
|
|
"description": "This returns information about which features are enabled on the remote node.",
|
|
"tags": [
|
|
"Core"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Server node information.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/RevoltConfiguration"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/onboard/hello": {
|
|
"get": {
|
|
"summary": "Check Onboarding Status",
|
|
"description": "This will tell you whether the current account requires onboarding or whether you can continue to send requests as usual. You may skip calling this if you're restoring an existing session.",
|
|
"tags": [
|
|
"Onboarding"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Onboarding information.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/OnboardingInformation"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/onboard/complete": {
|
|
"post": {
|
|
"summary": "Complete Onboarding",
|
|
"description": "This sets a new username, completes onboarding and allows a user to start using Revolt.",
|
|
"tags": [
|
|
"Onboarding"
|
|
],
|
|
"requestBody": {
|
|
"description": "Data about wanted user information.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"description": "An alphanumeric username which is used to identify the user on the platform.",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9-_]+$",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"username"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully set username"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/create": {
|
|
"post": {
|
|
"summary": "Create Account",
|
|
"description": "Create a new account.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"description": "Create Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"description": "Valid email address",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "Password",
|
|
"minLength": 8,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"invite": {
|
|
"description": "Invite Code",
|
|
"type": "string"
|
|
},
|
|
"captcha": {
|
|
"description": "Captcha verification code",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"email",
|
|
"password"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Created account.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"user_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"user_id"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/resend": {
|
|
"post": {
|
|
"summary": "Resend Verification",
|
|
"description": "Resend account creation verification email.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"description": "Resend Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"description": "Email",
|
|
"type": "string"
|
|
},
|
|
"captcha": {
|
|
"description": "Captcha verification token",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"email"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Resent verification."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/login": {
|
|
"post": {
|
|
"summary": "Login",
|
|
"description": "Create a new session.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"description": "Login Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"description": "Valid email address",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "Password",
|
|
"minLength": 8,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"device_name": {
|
|
"description": "Device Name",
|
|
"minLength": 0,
|
|
"maxLength": 72,
|
|
"type": "string"
|
|
},
|
|
"captcha": {
|
|
"description": "Captcha verification code",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"email",
|
|
"password"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Logged in.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Session ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"session_token": {
|
|
"description": "Session Token",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"session_token",
|
|
"user_id"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/send_reset": {
|
|
"post": {
|
|
"summary": "Send Password Reset",
|
|
"description": "Send password reset email.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"description": "Reset Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"description": "Email",
|
|
"type": "string"
|
|
},
|
|
"captcha": {
|
|
"description": "Captcha verification token",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"email"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Sent password reset."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/reset": {
|
|
"post": {
|
|
"summary": "Password Reset",
|
|
"description": "Confirm password reset.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"description": "Reset Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"password": {
|
|
"description": "Password",
|
|
"minLength": 8,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"token": {
|
|
"description": "Password reset token",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"password",
|
|
"token"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Password was reset."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/user": {
|
|
"get": {
|
|
"summary": "Fetch Account",
|
|
"description": "Fetch account information.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Account Information",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Account"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/check": {
|
|
"get": {
|
|
"summary": "Check Auth",
|
|
"description": "Check if we are authenticated.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "User is authenticated."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/change/password": {
|
|
"post": {
|
|
"summary": "Change Password",
|
|
"description": "Change account password.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"description": "Change Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"password": {
|
|
"description": "Password",
|
|
"minLength": 8,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"new_password": {
|
|
"description": "Password",
|
|
"minLength": 8,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"new_password",
|
|
"password"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Password changed."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/change/email": {
|
|
"post": {
|
|
"summary": "Change Email",
|
|
"description": "Change account email.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"requestBody": {
|
|
"description": "Change Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"password": {
|
|
"description": "Password",
|
|
"minLength": 8,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"new_email": {
|
|
"description": "Valid email",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"new_email",
|
|
"password"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Email changed."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/sessions/:session": {
|
|
"delete": {
|
|
"summary": "Delete Session",
|
|
"description": "Delete existing session.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "session",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Session ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted session."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/sessions": {
|
|
"get": {
|
|
"summary": "Fetch Sessions",
|
|
"description": "Fetch all sessions.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Sessions",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Session ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"friendly_name": {
|
|
"description": "Session device name",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"friendly_name",
|
|
"id"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/auth/logout": {
|
|
"get": {
|
|
"summary": "Logout",
|
|
"description": "Delete current session.",
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Logged out."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/:user": {
|
|
"get": {
|
|
"summary": "Fetch User",
|
|
"description": "Retrieve a user's information.",
|
|
"tags": [
|
|
"User Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "User information.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/@me": {
|
|
"patch": {
|
|
"summary": "Edit User",
|
|
"description": "Edit your user object.",
|
|
"tags": [
|
|
"User Information"
|
|
],
|
|
"requestBody": {
|
|
"description": "Requested changes to user object.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"description": "User status",
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"description": "Custom status text",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"presence": {
|
|
"$ref": "#/definitions/Presence"
|
|
}
|
|
}
|
|
},
|
|
"profile": {
|
|
"description": "User profile data",
|
|
"type": "object",
|
|
"properties": {
|
|
"content": {
|
|
"description": "Text to set as user profile description",
|
|
"maxLength": 2000,
|
|
"type": "string"
|
|
},
|
|
"background": {
|
|
"description": "Autumn file ID, [learn more](https://example.com/TODO).",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"avatar": {
|
|
"description": "Autumn file ID, [learn more](https://example.com/TODO).",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"remove": {
|
|
"description": "Field to remove from user object",
|
|
"enum": [
|
|
"Avatar",
|
|
"ProfileBackground",
|
|
"ProfileContent",
|
|
"StatusText"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"definitions": {
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Succesfully changed user object."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/@me/username": {
|
|
"patch": {
|
|
"summary": "Change Username",
|
|
"description": "Change your username.",
|
|
"tags": [
|
|
"User Information"
|
|
],
|
|
"requestBody": {
|
|
"description": "Requested change to username.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"username": {
|
|
"description": "New username",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9_.]+$",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "Current account password",
|
|
"minLength": 8,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"password",
|
|
"username"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Succesfully changed user object."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/:user/profile": {
|
|
"get": {
|
|
"summary": "Fetch User Profile",
|
|
"description": "Retrieve a user's profile data.",
|
|
"tags": [
|
|
"User Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "User profile.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Profile"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/:user/default_avatar": {
|
|
"get": {
|
|
"summary": "Fetch Default Avatar",
|
|
"description": "This returns a default avatar based on the given id.",
|
|
"tags": [
|
|
"User Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default avatar in PNG format",
|
|
"content": {
|
|
"image/png": {
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/:user/mutual": {
|
|
"get": {
|
|
"summary": "Fetch Mutual Friends",
|
|
"description": "Retrieve a list of mutual friends with another user.",
|
|
"tags": [
|
|
"User Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Mutual friends.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"users": {
|
|
"description": "Array of user IDs who both you and the other user are friends with.",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"users"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/dms": {
|
|
"get": {
|
|
"summary": "Fetch Direct Message Channels",
|
|
"description": "This fetches your direct messages, including any DM and group DM conversations.",
|
|
"tags": [
|
|
"Direct Messaging"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Your DM conversations.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"description": "Channel objects.",
|
|
"type": "array",
|
|
"items": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"DirectMessage"
|
|
]
|
|
},
|
|
"active": {
|
|
"description": "Whether this DM is active",
|
|
"type": "boolean"
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this DM",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"active",
|
|
"channel_type",
|
|
"last_message",
|
|
"recipients"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Group"
|
|
]
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this group",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"name": {
|
|
"description": "Group name",
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"description": "User ID of group owner",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Group description",
|
|
"type": "string"
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
},
|
|
"icon": {
|
|
"description": "Group icon",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"permissions": {
|
|
"description": "Permissions given to group members",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel_type",
|
|
"last_message",
|
|
"name",
|
|
"owner",
|
|
"recipients"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/:user/dm": {
|
|
"get": {
|
|
"summary": "Open Direct Message",
|
|
"description": "Open a DM with another user.",
|
|
"tags": [
|
|
"Direct Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "DM channel with user.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/DirectMessageChannel"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/relationships": {
|
|
"get": {
|
|
"summary": "Fetch Relationships",
|
|
"description": "Fetch all of your relationships with other users.",
|
|
"tags": [
|
|
"Relationships"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Array of relationships.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"definitions": {
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/:user/relationship": {
|
|
"get": {
|
|
"summary": "Fetch Relationship",
|
|
"description": "Fetch your relationship with another other user.",
|
|
"tags": [
|
|
"Relationships"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Your relationship with the user.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/RelationshipOnly"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/:username/friend": {
|
|
"put": {
|
|
"summary": "Send Friend Request / Accept Request",
|
|
"description": "Send a friend request to another user or accept another user's friend request.",
|
|
"tags": [
|
|
"Relationships"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Username",
|
|
"schema": {
|
|
"$ref": "#/definitions/Username"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Sent friend request / added user as friend.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/RelationshipOnly"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Deny Friend Request / Remove Friend",
|
|
"description": "Denies another user's friend request or removes an existing friend.",
|
|
"tags": [
|
|
"Relationships"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Username",
|
|
"schema": {
|
|
"$ref": "#/definitions/Username"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted friend request / removed user from friends.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/RelationshipOnly"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/users/:user/block": {
|
|
"put": {
|
|
"summary": "Block User",
|
|
"description": "Block another user.",
|
|
"tags": [
|
|
"Relationships"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Blocked user.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/RelationshipOnly"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Unblock User",
|
|
"description": "Unblock another user.",
|
|
"tags": [
|
|
"Relationships"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "user",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "User ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Unblocked user.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/RelationshipOnly"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel": {
|
|
"get": {
|
|
"summary": "Fetch Channel",
|
|
"description": "Retrieve a channel.",
|
|
"tags": [
|
|
"Channel Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Retrieved channel.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Channel"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"patch": {
|
|
"summary": "Edit Channel",
|
|
"description": "Edit a channel object.",
|
|
"tags": [
|
|
"Channel Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Requested changes to channel object.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Channel name",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"minLength": 0,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"description": "Autumn file ID, [learn more](https://example.com/TODO).",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"remove": {
|
|
"description": "Field to remove from channel object",
|
|
"enum": [
|
|
"Description",
|
|
"Icon"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Succesfully changed channel object."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Close Channel",
|
|
"description": "Deletes a server channel, leaves a group or closes a DM.",
|
|
"tags": [
|
|
"Channel Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted Channel"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/invites": {
|
|
"post": {
|
|
"summary": "Create Invite",
|
|
"description": "Creates an invite to this channel.\n\nChannel must be a `TextChannel`.",
|
|
"tags": [
|
|
"Channel Invites"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Invite",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"description": "Invite Code",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"code"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/permissions/:role": {
|
|
"put": {
|
|
"summary": "Set Role Permission",
|
|
"description": "Sets permissions for the specified role in this channel.\n\nChannel must be a `TextChannel` or `VoiceChannel`.",
|
|
"tags": [
|
|
"Channel Permissions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "role",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Role ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Channel Permissions",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"permissions": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"permissions"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully updated permissions."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/permissions/default": {
|
|
"put": {
|
|
"summary": "Set Default Permission",
|
|
"description": "Sets permissions for the default role in this channel.\n\nChannel must be a `Group`, `TextChannel` or `VoiceChannel`.",
|
|
"tags": [
|
|
"Channel Permissions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Channel Permissions",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"permissions": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"permissions"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully updated permissions."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/messages": {
|
|
"post": {
|
|
"summary": "Send Message",
|
|
"description": "Sends a message to the given channel.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Message to be sent.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"content": {
|
|
"description": "Message content to send.",
|
|
"minLength": 0,
|
|
"maxLength": 2000,
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"attachments": {
|
|
"description": "Attachments to include in message.",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replies": {
|
|
"description": "Messages to reply to.",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Message Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"mention": {
|
|
"description": "Whether this reply should mention the message's author.",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"mention"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"nonce"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Sent message.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Message"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"get": {
|
|
"summary": "Fetch Messages",
|
|
"description": "Fetches multiple messages.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Fetch Options",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"limit": {
|
|
"description": "Maximum number of messages to fetch.\n\nFor fetching nearby messages, this is `(limit + 1)`.",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"type": "number"
|
|
},
|
|
"before": {
|
|
"description": "Message id before which messages should be fetched.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"after": {
|
|
"description": "Message id after which messages should be fetched.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"sort": {
|
|
"description": "Message sort direction",
|
|
"enum": [
|
|
"Latest",
|
|
"Oldest"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"nearby": {
|
|
"description": "Message id to fetch around, this will ignore 'before', 'after' and 'sort' options.\nLimits in each direction will be half of the specified limit.\nIt also fetches the specified message ID.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"include_users": {
|
|
"description": "Whether to include user (and member, if server channel) objects.",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"sort"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Message array or object with requested data.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"description": "Message content, can be an object *only* if sent by the system user.",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"text"
|
|
]
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_added"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_remove"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_joined"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_left"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_kicked"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_banned"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_renamed"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"name",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_description_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_icon_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"attachments": {
|
|
"description": "Message attachments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"edited": {
|
|
"description": "Unix timestamp of when message was last edited",
|
|
"type": "object",
|
|
"properties": {
|
|
"$date": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"$date"
|
|
]
|
|
},
|
|
"embeds": {
|
|
"description": "Message link embeds",
|
|
"type": "array",
|
|
"items": {
|
|
"description": "Message embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Website"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"special": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"video": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"site_name": {
|
|
"type": "string"
|
|
},
|
|
"icon_url": {
|
|
"type": "string"
|
|
},
|
|
"color": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"mentions": {
|
|
"description": "Array of user IDs mentioned in message",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replies": {
|
|
"description": "Array of message IDs replied to",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"channel",
|
|
"content"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"messages": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"description": "Message content, can be an object *only* if sent by the system user.",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"text"
|
|
]
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_added"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_remove"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_joined"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_left"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_kicked"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_banned"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_renamed"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"name",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_description_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_icon_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"attachments": {
|
|
"description": "Message attachments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"edited": {
|
|
"description": "Unix timestamp of when message was last edited",
|
|
"type": "object",
|
|
"properties": {
|
|
"$date": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"$date"
|
|
]
|
|
},
|
|
"embeds": {
|
|
"description": "Message link embeds",
|
|
"type": "array",
|
|
"items": {
|
|
"description": "Message embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Website"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"special": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"video": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"site_name": {
|
|
"type": "string"
|
|
},
|
|
"icon_url": {
|
|
"type": "string"
|
|
},
|
|
"color": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"mentions": {
|
|
"description": "Array of user IDs mentioned in message",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replies": {
|
|
"description": "Array of message IDs replied to",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"channel",
|
|
"content"
|
|
]
|
|
}
|
|
},
|
|
"users": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
},
|
|
"members": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"server",
|
|
"user"
|
|
]
|
|
},
|
|
"nickname": {
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"messages",
|
|
"users"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"description": "Username",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9_.]+$",
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"description": "User avatar",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"relations": {
|
|
"description": "Relationships with other known users\nOnly present if fetching self",
|
|
"type": "array",
|
|
"items": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"badges": {
|
|
"description": "Bitfield of user's badges",
|
|
"type": "number"
|
|
},
|
|
"status": {
|
|
"description": "User status",
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"description": "Custom status text",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"presence": {
|
|
"$ref": "#/definitions/Presence"
|
|
}
|
|
}
|
|
},
|
|
"relationship": {
|
|
"description": "Relationship to user",
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"online": {
|
|
"description": "Whether the user is online",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"username"
|
|
]
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/messages/:message": {
|
|
"get": {
|
|
"summary": "Fetch Message",
|
|
"description": "Retrieves a message by ID.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Message ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Message",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Message"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"patch": {
|
|
"summary": "Edit Message",
|
|
"description": "Edits a message that you've previously sent.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Message ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Message edit data.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"content": {
|
|
"description": "Message content",
|
|
"minLength": 1,
|
|
"maxLength": 2000,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Message was changed."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Delete Message",
|
|
"description": "Delete a message you've sent or one you have permission to delete.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Message ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Message was deleted."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/messages/stale": {
|
|
"post": {
|
|
"summary": "Poll Message Changes",
|
|
"description": "This route returns any changed message objects and tells you if any have been deleted.\n\nDon't actually poll this route, instead use this to update your local database.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Poll Options",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"ids": {
|
|
"description": "Array of message IDs.",
|
|
"maxItems": 150,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"ids"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Polled Information",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"changed": {
|
|
"description": "Changed message objects.",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"description": "Message content, can be an object *only* if sent by the system user.",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"text"
|
|
]
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_added"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_remove"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_joined"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_left"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_kicked"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_banned"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_renamed"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"name",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_description_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_icon_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"attachments": {
|
|
"description": "Message attachments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"edited": {
|
|
"description": "Unix timestamp of when message was last edited",
|
|
"type": "object",
|
|
"properties": {
|
|
"$date": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"$date"
|
|
]
|
|
},
|
|
"embeds": {
|
|
"description": "Message link embeds",
|
|
"type": "array",
|
|
"items": {
|
|
"description": "Message embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Website"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"special": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"video": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"site_name": {
|
|
"type": "string"
|
|
},
|
|
"icon_url": {
|
|
"type": "string"
|
|
},
|
|
"color": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"mentions": {
|
|
"description": "Array of user IDs mentioned in message",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replies": {
|
|
"description": "Array of message IDs replied to",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"channel",
|
|
"content"
|
|
]
|
|
}
|
|
},
|
|
"deleted": {
|
|
"description": "Array of deleted message IDs.",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"changed",
|
|
"deleted"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/messages/search": {
|
|
"post": {
|
|
"summary": "Search for Messages",
|
|
"description": "This route searches for messages within the given parameters.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Search Options",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"query": {
|
|
"description": "Full-text search query.\n\nSee [MongoDB documentation](https://docs.mongodb.com/manual/text-search/#-text-operator) for more information.",
|
|
"minLength": 1,
|
|
"maxLength": 64,
|
|
"type": "string"
|
|
},
|
|
"limit": {
|
|
"description": "Maximum number of messages to fetch.",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"type": "number"
|
|
},
|
|
"before": {
|
|
"description": "Message id before which messages should be fetched.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"after": {
|
|
"description": "Message id after which messages should be fetched.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"sort": {
|
|
"description": "Message sort direction",
|
|
"enum": [
|
|
"Latest",
|
|
"Oldest",
|
|
"Relevance"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"include_users": {
|
|
"description": "Whether to include user (and member, if server channel) objects.",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"query",
|
|
"sort"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Message array or object with requested data.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"description": "Message content, can be an object *only* if sent by the system user.",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"text"
|
|
]
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_added"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_remove"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_joined"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_left"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_kicked"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_banned"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_renamed"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"name",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_description_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_icon_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"attachments": {
|
|
"description": "Message attachments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"edited": {
|
|
"description": "Unix timestamp of when message was last edited",
|
|
"type": "object",
|
|
"properties": {
|
|
"$date": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"$date"
|
|
]
|
|
},
|
|
"embeds": {
|
|
"description": "Message link embeds",
|
|
"type": "array",
|
|
"items": {
|
|
"description": "Message embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Website"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"special": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"video": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"site_name": {
|
|
"type": "string"
|
|
},
|
|
"icon_url": {
|
|
"type": "string"
|
|
},
|
|
"color": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"mentions": {
|
|
"description": "Array of user IDs mentioned in message",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replies": {
|
|
"description": "Array of message IDs replied to",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"channel",
|
|
"content"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"messages": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"description": "Message content, can be an object *only* if sent by the system user.",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"text"
|
|
]
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_added"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_remove"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_joined"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_left"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_kicked"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_banned"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_renamed"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"name",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_description_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_icon_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"attachments": {
|
|
"description": "Message attachments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"edited": {
|
|
"description": "Unix timestamp of when message was last edited",
|
|
"type": "object",
|
|
"properties": {
|
|
"$date": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"$date"
|
|
]
|
|
},
|
|
"embeds": {
|
|
"description": "Message link embeds",
|
|
"type": "array",
|
|
"items": {
|
|
"description": "Message embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Website"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"special": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"video": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"site_name": {
|
|
"type": "string"
|
|
},
|
|
"icon_url": {
|
|
"type": "string"
|
|
},
|
|
"color": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"mentions": {
|
|
"description": "Array of user IDs mentioned in message",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replies": {
|
|
"description": "Array of message IDs replied to",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"channel",
|
|
"content"
|
|
]
|
|
}
|
|
},
|
|
"users": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
},
|
|
"members": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"server",
|
|
"user"
|
|
]
|
|
},
|
|
"nickname": {
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"messages",
|
|
"users"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"description": "Username",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9_.]+$",
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"description": "User avatar",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"relations": {
|
|
"description": "Relationships with other known users\nOnly present if fetching self",
|
|
"type": "array",
|
|
"items": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"badges": {
|
|
"description": "Bitfield of user's badges",
|
|
"type": "number"
|
|
},
|
|
"status": {
|
|
"description": "User status",
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"description": "Custom status text",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"presence": {
|
|
"$ref": "#/definitions/Presence"
|
|
}
|
|
}
|
|
},
|
|
"relationship": {
|
|
"description": "Relationship to user",
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"online": {
|
|
"description": "Whether the user is online",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"username"
|
|
]
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/ack/:message": {
|
|
"put": {
|
|
"summary": "Acknowledge Message",
|
|
"description": "Lets the server and all other clients know that we've seen this message id in this channel.",
|
|
"tags": [
|
|
"Messaging"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Message ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Acknowledged message."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/create": {
|
|
"post": {
|
|
"summary": "Create Group",
|
|
"description": "Create a new group with friends.",
|
|
"tags": [
|
|
"Groups"
|
|
],
|
|
"requestBody": {
|
|
"description": "Group Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Group name",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Group description",
|
|
"minLength": 0,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"users": {
|
|
"description": "Array of user IDs to add to the group.\n\nMust be friends with them.",
|
|
"maxItems": 49,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"nonce"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Group",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/GroupChannel"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/members": {
|
|
"get": {
|
|
"summary": "Fetch Group Members",
|
|
"description": "Retrieves users who are part of this group.",
|
|
"tags": [
|
|
"Groups"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Message ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Members",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/User"
|
|
},
|
|
"definitions": {
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"description": "Username",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9_.]+$",
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"description": "User avatar",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"relations": {
|
|
"description": "Relationships with other known users\nOnly present if fetching self",
|
|
"type": "array",
|
|
"items": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"badges": {
|
|
"description": "Bitfield of user's badges",
|
|
"type": "number"
|
|
},
|
|
"status": {
|
|
"description": "User status",
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"description": "Custom status text",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"presence": {
|
|
"$ref": "#/definitions/Presence"
|
|
}
|
|
}
|
|
},
|
|
"relationship": {
|
|
"description": "Relationship to user",
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"online": {
|
|
"description": "Whether the user is online",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"username"
|
|
]
|
|
},
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"put": {
|
|
"summary": "Add Group Member",
|
|
"description": "Adds another user to the group.",
|
|
"tags": [
|
|
"Groups"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Message ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "User was added to the group."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Remove Group Member",
|
|
"description": "Removes a user from the group.",
|
|
"tags": [
|
|
"Groups"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "message",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Message ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "User was removed from the group."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/channels/:channel/join_call": {
|
|
"post": {
|
|
"summary": "Join Call",
|
|
"description": "Asks the voice server for a token to join the call.",
|
|
"tags": [
|
|
"Voice"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Join Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"token": {
|
|
"description": "Voso Token",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"token"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server": {
|
|
"get": {
|
|
"summary": "Fetch Server",
|
|
"description": "Retrieve a server.",
|
|
"tags": [
|
|
"Server Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Retrieved server.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Server"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"patch": {
|
|
"summary": "Edit Server",
|
|
"description": "Edit a server object.",
|
|
"tags": [
|
|
"Server Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Requested changes to server object.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Server name",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Server description",
|
|
"minLength": 0,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"description": "Autumn file ID, [learn more](https://example.com/TODO).",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"banner": {
|
|
"description": "Autumn file ID, [learn more](https://example.com/TODO).",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"categories": {
|
|
"description": "Server categories",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"channels",
|
|
"id",
|
|
"title"
|
|
]
|
|
}
|
|
},
|
|
"system_messages": {
|
|
"description": "System message channels",
|
|
"type": "object",
|
|
"properties": {
|
|
"user_joined": {
|
|
"description": "Channel ID where user join events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_left": {
|
|
"description": "Channel ID where user leave events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_kicked": {
|
|
"description": "Channel ID where user kick events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_banned": {
|
|
"description": "Channel ID where user ban events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"remove": {
|
|
"description": "Field to remove from channel object",
|
|
"enum": [
|
|
"Banner",
|
|
"Description",
|
|
"Icon"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Succesfully changed channel object."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Delete / Leave Server",
|
|
"description": "Deletes a server if owner otherwise leaves.",
|
|
"tags": [
|
|
"Server Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted Server"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/create": {
|
|
"post": {
|
|
"summary": "Create Server",
|
|
"description": "Create a new server.",
|
|
"tags": [
|
|
"Server Information"
|
|
],
|
|
"requestBody": {
|
|
"description": "Server Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Group name",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Group description",
|
|
"minLength": 0,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"nonce"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Server",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Server"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/channels": {
|
|
"post": {
|
|
"summary": "Create Channel",
|
|
"description": "Create a new Text or Voice channel.",
|
|
"tags": [
|
|
"Server Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Channel Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"description": "Channel type",
|
|
"enum": [
|
|
"Text",
|
|
"Voice"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"minLength": 0,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"nonce",
|
|
"type"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/invites": {
|
|
"get": {
|
|
"summary": "Fetch Invites",
|
|
"description": "Fetch all server invites.",
|
|
"tags": [
|
|
"Server Information"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/members/:member": {
|
|
"get": {
|
|
"summary": "Fetch Member",
|
|
"description": "Retrieve a member.",
|
|
"tags": [
|
|
"Server Members"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "member",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Member ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Retrieved member.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/Member"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"patch": {
|
|
"summary": "Edit Member",
|
|
"description": "Edit a member object.",
|
|
"tags": [
|
|
"Server Members"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Requested changes to server object.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"nickname": {
|
|
"description": "Member nickname",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"description": "Autumn file ID, [learn more](https://example.com/TODO).",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"roles": {
|
|
"description": "Array of role IDs",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"remove": {
|
|
"description": "Field to remove from channel object",
|
|
"enum": [
|
|
"Avatar",
|
|
"Nickname"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"nickname"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Succesfully changed member object."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Kick Member",
|
|
"description": "Removes a member from the server.",
|
|
"tags": [
|
|
"Server Members"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Removed Member"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/members": {
|
|
"get": {
|
|
"summary": "Fetch Members",
|
|
"description": "Fetch all server members.",
|
|
"tags": [
|
|
"Server Members"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Server Members",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"members": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"server",
|
|
"user"
|
|
]
|
|
},
|
|
"nickname": {
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
},
|
|
"users": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"members",
|
|
"users"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"description": "Username",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9_.]+$",
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"description": "User avatar",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"relations": {
|
|
"description": "Relationships with other known users\nOnly present if fetching self",
|
|
"type": "array",
|
|
"items": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"badges": {
|
|
"description": "Bitfield of user's badges",
|
|
"type": "number"
|
|
},
|
|
"status": {
|
|
"description": "User status",
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"description": "Custom status text",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"presence": {
|
|
"$ref": "#/definitions/Presence"
|
|
}
|
|
}
|
|
},
|
|
"relationship": {
|
|
"description": "Relationship to user",
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"online": {
|
|
"description": "Whether the user is online",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"username"
|
|
]
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/servers/:server/bans/:member": {
|
|
"put": {
|
|
"summary": "Ban User",
|
|
"description": "Ban a user by their ID.",
|
|
"tags": [
|
|
"Server Members"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "member",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Member ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Ban Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"reason": {
|
|
"description": "Ban reason",
|
|
"minLength": 1,
|
|
"maxLength": 1024,
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Banned user."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Unban User",
|
|
"description": "Removes a user's ban.",
|
|
"tags": [
|
|
"Server Members"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "member",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Member ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Unbanned user."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/bans": {
|
|
"get": {
|
|
"summary": "Fetch Bans",
|
|
"description": "Fetch all bans on server.",
|
|
"tags": [
|
|
"Server Members"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Bans",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"server",
|
|
"user"
|
|
]
|
|
},
|
|
"reason": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/permissions/:role": {
|
|
"put": {
|
|
"summary": "Set Role Permission",
|
|
"description": "Sets permissions for the specified role in this server.",
|
|
"tags": [
|
|
"Server Permissions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "role",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Role ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Server Permissions",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"permissions": {
|
|
"description": "Permission values",
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Server permission",
|
|
"type": "number"
|
|
},
|
|
"channel": {
|
|
"description": "Channel permission",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel",
|
|
"server"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"permissions"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully updated permissions."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/permissions/default": {
|
|
"put": {
|
|
"summary": "Set Default Permission",
|
|
"description": "Sets permissions for the default role in this server.",
|
|
"tags": [
|
|
"Server Permissions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Server Permissions",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"permissions": {
|
|
"description": "Permission values",
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Server permission",
|
|
"type": "number"
|
|
},
|
|
"channel": {
|
|
"description": "Channel permission",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel",
|
|
"server"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"permissions"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully updated permissions."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/roles": {
|
|
"post": {
|
|
"summary": "Create Role",
|
|
"description": "Creates a new server role.",
|
|
"tags": [
|
|
"Server Permissions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "server",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Server ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Role Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Role name",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "New Role",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Role ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"description": "Tuple consisting of server and channel permissions in that order",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"permissions"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/servers/:server/roles/:role": {
|
|
"patch": {
|
|
"summary": "Edit Role",
|
|
"description": "Edit a role object.",
|
|
"tags": [
|
|
"Server Permissions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "role",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Role ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Requested changes to role object.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Role name",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"description": "Tuple consisting of server and channel permissions in that order",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"colour": {
|
|
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
},
|
|
"remove": {
|
|
"description": "Field to remove from role object",
|
|
"type": "string",
|
|
"enum": [
|
|
"Colour"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"name"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Succesfully changed role object."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Delete Role",
|
|
"description": "Deletes a server role by ID.",
|
|
"tags": [
|
|
"Server Permissions"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "channel",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Channel ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
},
|
|
{
|
|
"name": "role",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Role ID",
|
|
"schema": {
|
|
"$ref": "#/definitions/Id"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully deleted role."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/invites/:invite": {
|
|
"get": {
|
|
"summary": "Fetch Invite",
|
|
"description": "Fetch an invite by its ID.",
|
|
"tags": [
|
|
"Invites"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "invite",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Invite Code",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Invite",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/RetrievedInvite"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"post": {
|
|
"summary": "Join Invite",
|
|
"description": "Join an invite by its ID.",
|
|
"tags": [
|
|
"Invites"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "invite",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Invite Code",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Invite",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Server"
|
|
]
|
|
},
|
|
"channel": {
|
|
"anyOf": [
|
|
{
|
|
"allOf": [
|
|
{
|
|
"description": "Saved Messages channel has only one participant, the user who created it.",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"SavedMessages"
|
|
]
|
|
},
|
|
"user": {
|
|
"description": "User Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel_type",
|
|
"user"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"DirectMessage"
|
|
]
|
|
},
|
|
"active": {
|
|
"description": "Whether this DM is active",
|
|
"type": "boolean"
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this DM",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"active",
|
|
"channel_type",
|
|
"last_message",
|
|
"recipients"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Group"
|
|
]
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this group",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"name": {
|
|
"description": "Group name",
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"description": "User ID of group owner",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Group description",
|
|
"type": "string"
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
},
|
|
"icon": {
|
|
"description": "Group icon",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"permissions": {
|
|
"description": "Permissions given to group members",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel_type",
|
|
"last_message",
|
|
"name",
|
|
"owner",
|
|
"recipients"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "Server Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"default_permissions": {
|
|
"description": "Permissions given to all users",
|
|
"type": "number"
|
|
},
|
|
"role_permissions": {
|
|
"description": "Permissions given to roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"description",
|
|
"name",
|
|
"server"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"TextChannel"
|
|
]
|
|
},
|
|
"last_message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel_type",
|
|
"last_message"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "Server Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"default_permissions": {
|
|
"description": "Permissions given to all users",
|
|
"type": "number"
|
|
},
|
|
"role_permissions": {
|
|
"description": "Permissions given to roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"description",
|
|
"name",
|
|
"server"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"VoiceChannel"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"channel_type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"server": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Server ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"description": "User ID of server owner",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Server name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Server description",
|
|
"type": "string"
|
|
},
|
|
"channels": {
|
|
"description": "Array of server channel IDs",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"categories": {
|
|
"description": "Array of server categories",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"channels",
|
|
"id",
|
|
"title"
|
|
]
|
|
}
|
|
},
|
|
"system_messages": {
|
|
"description": "System message channels\n\nEach type of system message will be sent into the respective channel ID.",
|
|
"type": "object",
|
|
"properties": {
|
|
"user_joined": {
|
|
"description": "Channel ID where user join events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_left": {
|
|
"description": "Channel ID where user leave events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_kicked": {
|
|
"description": "Channel ID where user kick events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_banned": {
|
|
"description": "Channel ID where user ban events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"roles": {
|
|
"description": "Server roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"description": "Tuple consisting of server and channel permissions in that order",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"colour": {
|
|
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"permissions"
|
|
]
|
|
}
|
|
},
|
|
"default_permissions": {
|
|
"description": "Default permissions for all members",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"icon": {
|
|
"description": "Server icon",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"banner": {
|
|
"description": "Server banner",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channels",
|
|
"default_permissions",
|
|
"name",
|
|
"owner"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"channel",
|
|
"server",
|
|
"type"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"summary": "Delete Invite",
|
|
"description": "Delete an invite by its ID.",
|
|
"tags": [
|
|
"Invites"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "invite",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Invite Code",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted invite."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/sync/settings/fetch": {
|
|
"post": {
|
|
"summary": "Fetch Settings",
|
|
"description": "Fetch settings from server filtered by keys.\n\nThis will return an object with the requested keys, each value is a tuple of `(timestamp, value)`, the value is the previously uploaded data.",
|
|
"tags": [
|
|
"Sync"
|
|
],
|
|
"requestBody": {
|
|
"description": "Options",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"keys": {
|
|
"description": "Keys to fetch",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"keys"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Settings Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/sync/settings/set": {
|
|
"post": {
|
|
"summary": "Set Settings",
|
|
"description": "Upload data to save to settings.",
|
|
"tags": [
|
|
"Sync"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "timestamp",
|
|
"in": "query",
|
|
"description": "Timestamp of settings change. Useful to prevent a feedback loop.",
|
|
"schema": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Settings Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully synced data."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/sync/unreads": {
|
|
"post": {
|
|
"summary": "Fetch Unreads",
|
|
"description": "Fetch information about unread state on channels.",
|
|
"tags": [
|
|
"Sync"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Unreads Data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/ChannelUnread"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/push/subscribe": {
|
|
"post": {
|
|
"summary": "Subscribe",
|
|
"description": "Create a new Web Push subscription.\n\nIf an existing subscription exists on this session, it will be removed.",
|
|
"tags": [
|
|
"Web Push"
|
|
],
|
|
"requestBody": {
|
|
"description": "Web Push Subscription",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/definitions/WebPushSubscription"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Subscribed successfully."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/push/unsubscribe": {
|
|
"post": {
|
|
"summary": "Unsubscribe",
|
|
"description": "Remove the Web Push subscription associated with the current session.",
|
|
"tags": [
|
|
"Web Push"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Unsubscribed successfully."
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"User ID": [],
|
|
"Session Token": []
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"Account": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"description": "User Email",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"email",
|
|
"id"
|
|
]
|
|
},
|
|
"Session": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Session ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"session_token": {
|
|
"maxLength": 64,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"session_token",
|
|
"user_id"
|
|
]
|
|
},
|
|
"AttachmentId": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"AttachmentMetadata": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Attachment": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SizeOptions": {
|
|
"description": "File serving parameters",
|
|
"type": "object",
|
|
"properties": {
|
|
"width": {
|
|
"description": "Width of resized image",
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"description": "Height of resized image",
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"description": "Width and height of resized image",
|
|
"type": "number"
|
|
},
|
|
"max_side": {
|
|
"description": "Maximum resized image side length",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"LastMessage": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SavedMessagesChannel": {
|
|
"description": "Saved Messages channel has only one participant, the user who created it.",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"SavedMessages"
|
|
]
|
|
},
|
|
"user": {
|
|
"description": "User Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel_type",
|
|
"user"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"DirectMessageChannel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"DirectMessage"
|
|
]
|
|
},
|
|
"active": {
|
|
"description": "Whether this DM is active",
|
|
"type": "boolean"
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this DM",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"active",
|
|
"channel_type",
|
|
"last_message",
|
|
"recipients"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"GroupChannel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Group"
|
|
]
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this group",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"name": {
|
|
"description": "Group name",
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"description": "User ID of group owner",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Group description",
|
|
"type": "string"
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
},
|
|
"icon": {
|
|
"description": "Group icon",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"permissions": {
|
|
"description": "Permissions given to group members",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel_type",
|
|
"last_message",
|
|
"name",
|
|
"owner",
|
|
"recipients"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ServerChannel": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "Server Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"default_permissions": {
|
|
"description": "Permissions given to all users",
|
|
"type": "number"
|
|
},
|
|
"role_permissions": {
|
|
"description": "Permissions given to roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"description",
|
|
"name",
|
|
"server"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"TextChannel": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "Server Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"default_permissions": {
|
|
"description": "Permissions given to all users",
|
|
"type": "number"
|
|
},
|
|
"role_permissions": {
|
|
"description": "Permissions given to roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"description",
|
|
"name",
|
|
"server"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"TextChannel"
|
|
]
|
|
},
|
|
"last_message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel_type",
|
|
"last_message"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"VoiceChannel": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "Server Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"default_permissions": {
|
|
"description": "Permissions given to all users",
|
|
"type": "number"
|
|
},
|
|
"role_permissions": {
|
|
"description": "Permissions given to roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"description",
|
|
"name",
|
|
"server"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"VoiceChannel"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"channel_type"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Channel": {
|
|
"anyOf": [
|
|
{
|
|
"allOf": [
|
|
{
|
|
"description": "Saved Messages channel has only one participant, the user who created it.",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"SavedMessages"
|
|
]
|
|
},
|
|
"user": {
|
|
"description": "User Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel_type",
|
|
"user"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"DirectMessage"
|
|
]
|
|
},
|
|
"active": {
|
|
"description": "Whether this DM is active",
|
|
"type": "boolean"
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this DM",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"active",
|
|
"channel_type",
|
|
"last_message",
|
|
"recipients"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Group"
|
|
]
|
|
},
|
|
"recipients": {
|
|
"description": "List of user IDs who are participating in this group",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"name": {
|
|
"description": "Group name",
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"description": "User ID of group owner",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Group description",
|
|
"type": "string"
|
|
},
|
|
"last_message": {
|
|
"description": "Last message sent in channel",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"short": {
|
|
"description": "Short content of message",
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"short"
|
|
]
|
|
},
|
|
"icon": {
|
|
"description": "Group icon",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"permissions": {
|
|
"description": "Permissions given to group members",
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel_type",
|
|
"last_message",
|
|
"name",
|
|
"owner",
|
|
"recipients"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "Server Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"default_permissions": {
|
|
"description": "Permissions given to all users",
|
|
"type": "number"
|
|
},
|
|
"role_permissions": {
|
|
"description": "Permissions given to roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"description",
|
|
"name",
|
|
"server"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"TextChannel"
|
|
]
|
|
},
|
|
"last_message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel_type",
|
|
"last_message"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "Server Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Channel name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Channel description",
|
|
"type": "string"
|
|
},
|
|
"icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"default_permissions": {
|
|
"description": "Permissions given to all users",
|
|
"type": "number"
|
|
},
|
|
"role_permissions": {
|
|
"description": "Permissions given to roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"description",
|
|
"name",
|
|
"server"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"channel_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"VoiceChannel"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"channel_type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"nonce": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Message": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Message Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "Channel Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"description": "Author Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"description": "Message content, can be an object *only* if sent by the system user.",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"text"
|
|
]
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_added"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_remove"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_joined"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_left"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_kicked"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_banned"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_renamed"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"name",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_description_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_icon_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"attachments": {
|
|
"description": "Message attachments",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"edited": {
|
|
"description": "Unix timestamp of when message was last edited",
|
|
"type": "object",
|
|
"properties": {
|
|
"$date": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"$date"
|
|
]
|
|
},
|
|
"embeds": {
|
|
"description": "Message link embeds",
|
|
"type": "array",
|
|
"items": {
|
|
"description": "Message embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Website"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"special": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"video": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"site_name": {
|
|
"type": "string"
|
|
},
|
|
"icon_url": {
|
|
"type": "string"
|
|
},
|
|
"color": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"mentions": {
|
|
"description": "Array of user IDs mentioned in message",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replies": {
|
|
"description": "Array of message IDs replied to",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"author",
|
|
"channel",
|
|
"content"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SystemMessage": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"text"
|
|
]
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_added"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_remove"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_joined"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_left"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_kicked"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"user_banned"
|
|
]
|
|
},
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_renamed"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"name",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_description_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"channel_icon_changed"
|
|
]
|
|
},
|
|
"by": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"by",
|
|
"type"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"RevoltConfiguration": {
|
|
"type": "object",
|
|
"properties": {
|
|
"revolt": {
|
|
"description": "Revolt API version string",
|
|
"type": "string"
|
|
},
|
|
"features": {
|
|
"description": "Available features exposed by the API",
|
|
"type": "object",
|
|
"properties": {
|
|
"registration": {
|
|
"description": "Whether users can register",
|
|
"type": "boolean"
|
|
},
|
|
"captcha": {
|
|
"description": "hCaptcha options",
|
|
"type": "object",
|
|
"properties": {
|
|
"enabled": {
|
|
"description": "Whether hCaptcha is enabled",
|
|
"type": "boolean"
|
|
},
|
|
"key": {
|
|
"description": "hCaptcha site key",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"enabled",
|
|
"key"
|
|
]
|
|
},
|
|
"email": {
|
|
"description": "Whether email verification is enabled",
|
|
"type": "boolean"
|
|
},
|
|
"invite_only": {
|
|
"description": "Whether an invite code is required to register",
|
|
"type": "string"
|
|
},
|
|
"autumn": {
|
|
"description": "Autumn (file server) options",
|
|
"type": "object",
|
|
"properties": {
|
|
"enabled": {
|
|
"description": "Whether file uploads are enabled",
|
|
"type": "boolean"
|
|
},
|
|
"url": {
|
|
"description": "Autumn API URL",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"enabled",
|
|
"url"
|
|
]
|
|
},
|
|
"january": {
|
|
"description": "January (proxy server) options",
|
|
"type": "object",
|
|
"properties": {
|
|
"enabled": {
|
|
"description": "Whether link embeds are enabled",
|
|
"type": "boolean"
|
|
},
|
|
"url": {
|
|
"description": "January API URL",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"enabled",
|
|
"url"
|
|
]
|
|
},
|
|
"voso": {
|
|
"description": "Legacy voice server options",
|
|
"type": "object",
|
|
"properties": {
|
|
"enabled": {
|
|
"description": "Whether voice is available (using voso)",
|
|
"type": "boolean"
|
|
},
|
|
"url": {
|
|
"description": "Voso API URL",
|
|
"type": "string"
|
|
},
|
|
"ws": {
|
|
"description": "Voso WebSocket URL",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"enabled",
|
|
"url",
|
|
"ws"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"autumn",
|
|
"captcha",
|
|
"email",
|
|
"invite_only",
|
|
"january",
|
|
"registration",
|
|
"voso"
|
|
]
|
|
},
|
|
"ws": {
|
|
"description": "WebSocket URL",
|
|
"type": "string"
|
|
},
|
|
"app": {
|
|
"description": "URL to web app associated with this instance",
|
|
"type": "string"
|
|
},
|
|
"vapid": {
|
|
"description": "Web Push VAPID key",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"app",
|
|
"features",
|
|
"revolt",
|
|
"vapid",
|
|
"ws"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"OnboardingInformation": {
|
|
"type": "object",
|
|
"properties": {
|
|
"onboarding": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"onboarding"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ServerInvite": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Server"
|
|
]
|
|
},
|
|
"_id": {
|
|
"description": "Invite Code",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "ID of the server this invite is for.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"creator": {
|
|
"description": "ID of the user who created this invite.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "ID of the channel this invite is for.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel",
|
|
"creator",
|
|
"server",
|
|
"type"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Invite": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Server"
|
|
]
|
|
},
|
|
"_id": {
|
|
"description": "Invite Code",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"description": "ID of the server this invite is for.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"creator": {
|
|
"description": "ID of the user who created this invite.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel": {
|
|
"description": "ID of the channel this invite is for.",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channel",
|
|
"creator",
|
|
"server",
|
|
"type"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"RetrievedInvite": {
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Server"
|
|
]
|
|
},
|
|
"server_id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"server_name": {
|
|
"type": "string"
|
|
},
|
|
"server_icon": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"server_banner": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"channel_id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"channel_name": {
|
|
"type": "string"
|
|
},
|
|
"channel_description": {
|
|
"type": "string"
|
|
},
|
|
"user_name": {
|
|
"type": "string"
|
|
},
|
|
"user_avatar": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"channel_id",
|
|
"channel_name",
|
|
"server_id",
|
|
"server_name",
|
|
"type",
|
|
"user_name"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"EmbedImage": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"EmbedVideo": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"EmbedSpecial": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Embed": {
|
|
"description": "Message embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Website"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"special": {
|
|
"description": "A special 3rd party embed",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"None"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"YouTube"
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Twitch"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Channel",
|
|
"Clip",
|
|
"Video"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Spotify"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Soundcloud"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Bandcamp"
|
|
]
|
|
},
|
|
"content_type": {
|
|
"enum": [
|
|
"Album",
|
|
"Track"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"content_type",
|
|
"id",
|
|
"type"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"video": {
|
|
"description": "An embedded video",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"url",
|
|
"width"
|
|
]
|
|
},
|
|
"site_name": {
|
|
"type": "string"
|
|
},
|
|
"icon_url": {
|
|
"type": "string"
|
|
},
|
|
"color": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"description": "An embedded image",
|
|
"type": "object",
|
|
"properties": {
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
},
|
|
"size": {
|
|
"enum": [
|
|
"Large",
|
|
"Preview"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"size",
|
|
"url",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"MemberCompositeKey": {
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"server",
|
|
"user"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Member": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"server",
|
|
"user"
|
|
]
|
|
},
|
|
"nickname": {
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Ban": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "object",
|
|
"properties": {
|
|
"server": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"server",
|
|
"user"
|
|
]
|
|
},
|
|
"reason": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"PermissionTuple": {
|
|
"description": "Tuple consisting of server and channel permissions in that order",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2,
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Colour": {
|
|
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Role": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"description": "Tuple consisting of server and channel permissions in that order",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"colour": {
|
|
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"permissions"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Category": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"channels",
|
|
"id",
|
|
"title"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SystemMessageChannels": {
|
|
"type": "object",
|
|
"properties": {
|
|
"user_joined": {
|
|
"description": "Channel ID where user join events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_left": {
|
|
"description": "Channel ID where user leave events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_kicked": {
|
|
"description": "Channel ID where user kick events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_banned": {
|
|
"description": "Channel ID where user ban events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Server": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Server ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"description": "User ID of server owner",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Server name",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"description": "Server description",
|
|
"type": "string"
|
|
},
|
|
"channels": {
|
|
"description": "Array of server channel IDs",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"categories": {
|
|
"description": "Array of server categories",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"channels": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"channels",
|
|
"id",
|
|
"title"
|
|
]
|
|
}
|
|
},
|
|
"system_messages": {
|
|
"description": "System message channels\n\nEach type of system message will be sent into the respective channel ID.",
|
|
"type": "object",
|
|
"properties": {
|
|
"user_joined": {
|
|
"description": "Channel ID where user join events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_left": {
|
|
"description": "Channel ID where user leave events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_kicked": {
|
|
"description": "Channel ID where user kick events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user_banned": {
|
|
"description": "Channel ID where user ban events should be sent",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"roles": {
|
|
"description": "Server roles",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"permissions": {
|
|
"description": "Tuple consisting of server and channel permissions in that order",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"colour": {
|
|
"description": "Valid HTML colour\n\nWarning: This is untrusted input, do not simply insert this anywhere.\n\n**Example usage:**\n```js\ndocument.body.style.color = role.colour;\n```",
|
|
"minLength": 1,
|
|
"maxLength": 32,
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"permissions"
|
|
]
|
|
}
|
|
},
|
|
"default_permissions": {
|
|
"description": "Default permissions for all members",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "number"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"icon": {
|
|
"description": "Server icon",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"banner": {
|
|
"description": "Server banner",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"channels",
|
|
"default_permissions",
|
|
"name",
|
|
"owner"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"UserSettings": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"type": "number"
|
|
},
|
|
{
|
|
"type": "string"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ChannelCompositeKey": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel",
|
|
"user"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ChannelUnread": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"type": "object",
|
|
"properties": {
|
|
"channel": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"channel",
|
|
"user"
|
|
]
|
|
},
|
|
"last_id": {
|
|
"type": "string"
|
|
},
|
|
"mentions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"last_id"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"WebPushSubscription": {
|
|
"type": "object",
|
|
"properties": {
|
|
"endpoint": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"x-patternProperties": {
|
|
"^[0-9]+$": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"p256dh": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"x-patternProperties": {
|
|
"^[0-9]+$": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"auth": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"x-patternProperties": {
|
|
"^[0-9]+$": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"auth",
|
|
"endpoint",
|
|
"p256dh"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Username": {
|
|
"description": "Username",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9_.]+$",
|
|
"type": "string",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"RelationshipOnly": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Relationship": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Status": {
|
|
"description": "User status",
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"description": "Custom status text",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"presence": {
|
|
"$ref": "#/definitions/Presence"
|
|
}
|
|
},
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Badges": {
|
|
"enum": [
|
|
1,
|
|
16,
|
|
2,
|
|
256,
|
|
4,
|
|
8
|
|
],
|
|
"type": "number",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "User ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"description": "Username",
|
|
"minLength": 2,
|
|
"maxLength": 32,
|
|
"pattern": "^[a-zA-Z0-9_.]+$",
|
|
"type": "string"
|
|
},
|
|
"avatar": {
|
|
"description": "User avatar",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
},
|
|
"relations": {
|
|
"description": "Relationships with other known users\nOnly present if fetching self",
|
|
"type": "array",
|
|
"items": {
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"badges": {
|
|
"description": "Bitfield of user's badges",
|
|
"type": "number"
|
|
},
|
|
"status": {
|
|
"description": "User status",
|
|
"type": "object",
|
|
"properties": {
|
|
"text": {
|
|
"description": "Custom status text",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"presence": {
|
|
"$ref": "#/definitions/Presence"
|
|
}
|
|
}
|
|
},
|
|
"relationship": {
|
|
"description": "Relationship to user",
|
|
"allOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"$ref": "#/definitions/RelationshipStatus"
|
|
}
|
|
},
|
|
"required": [
|
|
"status"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Other user's ID",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"online": {
|
|
"description": "Whether the user is online",
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"username"
|
|
],
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Profile": {
|
|
"type": "object",
|
|
"properties": {
|
|
"content": {
|
|
"description": "Profile content",
|
|
"minLength": 0,
|
|
"maxLength": 2000,
|
|
"type": "string"
|
|
},
|
|
"background": {
|
|
"description": "Profile background",
|
|
"type": "object",
|
|
"properties": {
|
|
"_id": {
|
|
"description": "Attachment ID",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string"
|
|
},
|
|
"tag": {
|
|
"$ref": "#/definitions/AttachmentTag"
|
|
},
|
|
"size": {
|
|
"description": "File size (in bytes)",
|
|
"type": "number"
|
|
},
|
|
"filename": {
|
|
"description": "File name",
|
|
"type": "string"
|
|
},
|
|
"metadata": {
|
|
"description": "Metadata",
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"File"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Text"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Audio"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Image"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"Video"
|
|
]
|
|
},
|
|
"width": {
|
|
"type": "number"
|
|
},
|
|
"height": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"required": [
|
|
"height",
|
|
"type",
|
|
"width"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"content_type": {
|
|
"description": "Content type",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"_id",
|
|
"content_type",
|
|
"filename",
|
|
"metadata",
|
|
"size",
|
|
"tag"
|
|
]
|
|
}
|
|
},
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SetSettingsData": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
},
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Id": {
|
|
"description": "Id",
|
|
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
|
|
"type": "string",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Nonce": {
|
|
"description": "Nonce value, prefer to use ULIDs here for better feature support.\n\nUsed to prevent double requests to create objects.",
|
|
"minLength": 1,
|
|
"maxLength": 36,
|
|
"type": "string",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"AutumnId": {
|
|
"description": "Autumn file ID, [learn more](https://example.com/TODO).",
|
|
"minLength": 1,
|
|
"maxLength": 128,
|
|
"type": "string",
|
|
"definitions": {
|
|
"AttachmentTag": {
|
|
"description": "Attachment tag",
|
|
"enum": [
|
|
"attachments",
|
|
"avatars",
|
|
"backgrounds",
|
|
"banners",
|
|
"icons"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"RelationshipStatus": {
|
|
"description": "Your relationship with the user",
|
|
"enum": [
|
|
"Blocked",
|
|
"BlockedOther",
|
|
"Friend",
|
|
"Incoming",
|
|
"None",
|
|
"Outgoing",
|
|
"User"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"Presence": {
|
|
"description": "User presence",
|
|
"enum": [
|
|
"Busy",
|
|
"Idle",
|
|
"Invisible",
|
|
"Online"
|
|
],
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "https://api.revolt.chat",
|
|
"description": "Production instance of the Revolt API"
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"User ID": {
|
|
"type": "apiKey",
|
|
"in": "header",
|
|
"name": "x-user-id",
|
|
"description": "User ID is found when calling `/auth/login`.\n"
|
|
},
|
|
"Session Token": {
|
|
"type": "apiKey",
|
|
"in": "header",
|
|
"name": "x-session-token",
|
|
"description": "Session is created by calling `/auth/login`.\n"
|
|
}
|
|
}
|
|
}
|
|
} |