diff --git a/src/client/interfaces/Type.d.ts b/src/client/interfaces/Type.d.ts index 5445eea5..114c68b6 100644 --- a/src/client/interfaces/Type.d.ts +++ b/src/client/interfaces/Type.d.ts @@ -3,4 +3,5 @@ export interface Type { base: string; template: string | null; imports: string[]; + isNullable: boolean; } diff --git a/src/openApi/v2/parser/getType.ts b/src/openApi/v2/parser/getType.ts index 657f9860..f991be21 100644 --- a/src/openApi/v2/parser/getType.ts +++ b/src/openApi/v2/parser/getType.ts @@ -17,6 +17,7 @@ export function getType(value?: string, template?: string): Type { base: 'any', template: null, imports: [], + isNullable: false, }; const valueClean = stripNamespace(value || ''); diff --git a/src/openApi/v3/interfaces/OpenApiSchema.d.ts b/src/openApi/v3/interfaces/OpenApiSchema.d.ts index 7bbf0665..1e00fb03 100644 --- a/src/openApi/v3/interfaces/OpenApiSchema.d.ts +++ b/src/openApi/v3/interfaces/OpenApiSchema.d.ts @@ -25,7 +25,7 @@ export interface OpenApiSchema extends OpenApiReference, WithEnumExtension { minProperties?: number; required?: string[]; enum?: (string | number)[]; - type?: string; + type?: string | string[]; allOf?: OpenApiSchema[]; oneOf?: OpenApiSchema[]; anyOf?: OpenApiSchema[]; diff --git a/src/openApi/v3/parser/getModel.ts b/src/openApi/v3/parser/getModel.ts index ecd46cd2..29007ae8 100644 --- a/src/openApi/v3/parser/getModel.ts +++ b/src/openApi/v3/parser/getModel.ts @@ -180,6 +180,7 @@ export function getModel(openApi: OpenApi, definition: OpenApiSchema, isDefiniti model.type = definitionType.type; model.base = definitionType.base; model.template = definitionType.template; + model.isNullable = definitionType.isNullable; model.imports.push(...definitionType.imports); model.default = getModelDefault(definition, model); return model; diff --git a/src/openApi/v3/parser/getType.spec.ts b/src/openApi/v3/parser/getType.spec.ts index 0984014e..33b8d9a5 100644 --- a/src/openApi/v3/parser/getType.spec.ts +++ b/src/openApi/v3/parser/getType.spec.ts @@ -7,6 +7,7 @@ describe('getType', () => { expect(type.base).toEqual('number'); expect(type.template).toEqual(null); expect(type.imports).toEqual([]); + expect(type.isNullable).toEqual(false); }); it('should convert string', () => { @@ -15,6 +16,7 @@ describe('getType', () => { expect(type.base).toEqual('string'); expect(type.template).toEqual(null); expect(type.imports).toEqual([]); + expect(type.isNullable).toEqual(false); }); it('should convert string array', () => { @@ -23,6 +25,7 @@ describe('getType', () => { expect(type.base).toEqual('string'); expect(type.template).toEqual(null); expect(type.imports).toEqual([]); + expect(type.isNullable).toEqual(false); }); it('should convert template with primary', () => { @@ -31,6 +34,7 @@ describe('getType', () => { expect(type.base).toEqual('Link'); expect(type.template).toEqual('string'); expect(type.imports).toEqual(['Link']); + expect(type.isNullable).toEqual(false); }); it('should convert template with model', () => { @@ -39,6 +43,7 @@ describe('getType', () => { expect(type.base).toEqual('Link'); expect(type.template).toEqual('Model'); expect(type.imports).toEqual(['Link', 'Model']); + expect(type.isNullable).toEqual(false); }); it('should have double imports', () => { @@ -47,6 +52,7 @@ describe('getType', () => { expect(type.base).toEqual('Link'); expect(type.template).toEqual('Link'); expect(type.imports).toEqual(['Link', 'Link']); + expect(type.isNullable).toEqual(false); }); it('should convert generic', () => { @@ -55,6 +61,7 @@ describe('getType', () => { expect(type.base).toEqual('T'); expect(type.template).toEqual(null); expect(type.imports).toEqual([]); + expect(type.isNullable).toEqual(false); }); it('should support dot', () => { @@ -63,6 +70,7 @@ describe('getType', () => { expect(type.base).toEqual('model_000'); expect(type.template).toEqual(null); expect(type.imports).toEqual(['model_000']); + expect(type.isNullable).toEqual(false); }); it('should support dashes', () => { @@ -71,6 +79,7 @@ describe('getType', () => { expect(type.base).toEqual('some_special_schema'); expect(type.template).toEqual(null); expect(type.imports).toEqual(['some_special_schema']); + expect(type.isNullable).toEqual(false); }); it('should support dollar sign', () => { @@ -79,5 +88,24 @@ describe('getType', () => { expect(type.base).toEqual('$some_special_schema'); expect(type.template).toEqual(null); expect(type.imports).toEqual(['$some_special_schema']); + expect(type.isNullable).toEqual(false); + }); + + it('should support multiple base types', () => { + const type = getType(['string', 'int']); + expect(type.type).toEqual('string | number'); + expect(type.base).toEqual('string | number'); + expect(type.template).toEqual(null); + expect(type.imports).toEqual([]); + expect(type.isNullable).toEqual(false); + }); + + it('should support multiple nullable types', () => { + const type = getType(['string', 'null']); + expect(type.type).toEqual('string'); + expect(type.base).toEqual('string'); + expect(type.template).toEqual(null); + expect(type.imports).toEqual([]); + expect(type.isNullable).toEqual(true); }); }); diff --git a/src/openApi/v3/parser/getType.ts b/src/openApi/v3/parser/getType.ts index de720dde..737d1755 100644 --- a/src/openApi/v3/parser/getType.ts +++ b/src/openApi/v3/parser/getType.ts @@ -5,21 +5,35 @@ import { stripNamespace } from './stripNamespace'; function encode(value: string): string { return value.replace(/^[^a-zA-Z_$]+/g, '').replace(/[^\w$]+/g, '_'); } - /** * Parse any string value into a type object. - * @param value String value like "integer" or "Link[Model]". + * @param values String or String[] value like "integer", "Link[Model]" or ["string", "null"] * @param template Optional template class from parent (needed to process generics) */ -export function getType(value?: string, template?: string): Type { +export function getType(values?: string | string[], template?: string): Type { const result: Type = { type: 'any', base: 'any', template: null, imports: [], + isNullable: false, }; - const valueClean = stripNamespace(value || ''); + // Special case for JSON Schema spec (december 2020, page 17), + // that allows type to be an array of primitive types... + if (Array.isArray(values)) { + const type = values + .filter(value => value !== 'null') + .filter(value => hasMappedType(value)) + .map(value => getMappedType(value)) + .join(' | '); + result.type = type; + result.base = type; + result.isNullable = values.includes('null'); + return result; + } + + const valueClean = stripNamespace(values || ''); if (/\[.*\]$/g.test(valueClean)) { const matches = valueClean.match(/(.*?)\[(.*)\]$/); diff --git a/test/__snapshots__/index.spec.js.snap b/test/__snapshots__/index.spec.js.snap index 0e91ff78..74637bbd 100644 --- a/test/__snapshots__/index.spec.js.snap +++ b/test/__snapshots__/index.spec.js.snap @@ -2094,7 +2094,7 @@ export class ParametersService { parameterPath: string, ): Promise { const result = await __request({ - method: 'GET', + method: 'POST', path: \`/api/v\${OpenAPI.VERSION}/parameters/\${parameterPath}\`, headers: { 'parameterHeader': parameterHeader, @@ -2132,7 +2132,7 @@ export class ParametersService { _default?: string, ): Promise { const result = await __request({ - method: 'GET', + method: 'POST', path: \`/api/v\${OpenAPI.VERSION}/parameters/\${parameterPath1}/\${parameterPath2}/\${parameterPath3}\`, headers: { 'parameter.header': parameterHeader, @@ -3572,7 +3572,7 @@ exports[`v3 should generate: ./test/generated/v3/models/SimpleStringWithPattern. /** * This is a simple string */ -export type SimpleStringWithPattern = string | null;" +export type SimpleStringWithPattern = string;" `; exports[`v3 should generate: ./test/generated/v3/schemas/$ArrayWithArray.ts 1`] = ` @@ -4392,7 +4392,6 @@ exports[`v3 should generate: ./test/generated/v3/schemas/$SimpleStringWithPatter /* eslint-disable */ export const $SimpleStringWithPattern = { type: 'string', - isNullable: true, maxLength: 64, pattern: '^[a-zA-Z0-9_]*$', };" @@ -4791,7 +4790,7 @@ export class ParametersService { requestBody: ModelWithString | null, ): Promise { const result = await __request({ - method: 'GET', + method: 'POST', path: \`/api/v\${OpenAPI.VERSION}/parameters/\${parameterPath}\`, cookies: { 'parameterCookie': parameterCookie, @@ -4835,7 +4834,7 @@ export class ParametersService { _default?: string, ): Promise { const result = await __request({ - method: 'GET', + method: 'POST', path: \`/api/v\${OpenAPI.VERSION}/parameters/\${parameterPath1}/\${parameterPath2}/\${parameterPath3}\`, cookies: { 'PARAMETER-COOKIE': parameterCookie, diff --git a/test/e2e/v3.fetch.spec.js b/test/e2e/v3.fetch.spec.js index 8b436f5d..b706de33 100644 --- a/test/e2e/v3.fetch.spec.js +++ b/test/e2e/v3.fetch.spec.js @@ -57,4 +57,22 @@ describe('v3.fetch', () => { }); expect(result).toBeDefined(); }); + + it('formData', async () => { + const result = await browser.evaluate(async () => { + const { ParametersService } = window.api; + return await ParametersService.callWithParameters( + 'valueHeader', + 'valueQuery', + 'valueForm', + 'valueCookie', + 'valuePath', + { + prop: 'valueBody' + } + ); + }); + expect(result).toBeDefined(); + }); + }); diff --git a/test/e2e/v3.node.spec.js b/test/e2e/v3.node.spec.js index 20b961e0..892b53a4 100644 --- a/test/e2e/v3.node.spec.js +++ b/test/e2e/v3.node.spec.js @@ -48,4 +48,19 @@ describe('v3.node', () => { expect(result).toBeDefined(); }); + it('formData', async () => { + const { ParametersService } = require('./generated/v3/node/index.js'); + const result = await ParametersService.callWithParameters( + 'valueHeader', + 'valueQuery', + 'valueForm', + 'valueCookie', + 'valuePath', + { + prop: 'valueBody' + } + ); + console.log(result) + expect(result).toBeDefined(); + }); }); diff --git a/test/spec/v2.json b/test/spec/v2.json index 92bd7f55..f657221c 100644 --- a/test/spec/v2.json +++ b/test/spec/v2.json @@ -55,7 +55,7 @@ } }, "/api/v{api-version}/parameters/{parameterPath}": { - "get": { + "post": { "tags": [ "Parameters" ], @@ -106,7 +106,7 @@ } }, "/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}": { - "get": { + "post": { "tags": [ "Parameters" ], diff --git a/test/spec/v3.json b/test/spec/v3.json index a14e69cb..db52b28e 100644 --- a/test/spec/v3.json +++ b/test/spec/v3.json @@ -1,1122 +1,116 @@ { - "openapi": "3.0.0", + "openapi": "3.1.0", "info": { - "title": "swagger", - "version": "v1.0" - }, - "servers": [ - { - "url": "http://localhost:3000/base" + "title": "Discourse API Documentation", + "x-logo": { + "url": "https://discourse-meta.s3-us-west-1.amazonaws.com/optimized/3X/9/d/9d543e92b15b06924249654667a81441a55867eb_1_690x184.png" + }, + "version": "latest", + "description": "This page contains the documentation on how to use Discourse through API calls.\n\n> Note: For any endpoints not listed you can follow the\n[reverse engineer the Discourse API](https://meta.discourse.org/t/-/20576)\nguide to figure out how to use an API endpoint.\n\n### Request Content-Type\n\nThe Content-Type for POST and PUT requests can be set to `application/x-www-form-urlencoded`,\n`multipart/form-data`, or `application/json`.\n\n### Endpoint Names and Response Content-Type\n\nMost API endpoints provide the same content as their HTML counterparts. For example\nthe URL `/categories` serves a list of categories, the `/categories.json` API provides the\nsame information in JSON format.\n\nInstead of sending API requests to `/categories.json` you may also send them to `/categories`\nand add an `Accept: application/json` header to the request to get the JSON response.\nSending requests with the `Accept` header is necessary if you want to use URLs\nfor related endpoints returned by the API, such as pagination URLs.\nThese URLs are returned without the `.json` prefix so you need to add the header in\norder to get the correct response format.\n\n### Authentication\n\nSome endpoints do not require any authentication, pretty much anything else will\nrequire you to be authenticated.\n\nTo become authenticated you will need to create an API Key from the admin panel.\n\nOnce you have your API Key you can pass it in along with your API Username\nas an HTTP header like this:\n\n```\ncurl -X GET \"http://127.0.0.1:3000/admin/users/list/active.json\" \\\n-H \"Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19\" \\\n-H \"Api-Username: system\"\n```\n\nand this is how POST requests will look:\n\n```\ncurl -X POST \"http://127.0.0.1:3000/categories\" \\\n-H \"Content-Type: multipart/form-data;\" \\\n-H \"Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19\" \\\n-H \"Api-Username: system\" \\\n-F \"name=89853c20-4409-e91a-a8ea-f6cdff96aaaa\" \\\n-F \"color=49d9e9\" \\\n-F \"text_color=f0fcfd\"\n```\n\n### Boolean values\n\nIf an endpoint accepts a boolean be sure to specify it as a lowercase\n`true` or `false` value unless noted otherwise.\n", + "license": { + "name": "MIT", + "url": "https://docs.discourse.org/LICENSE.txt" } - ], + }, "paths": { - "/api/v{api-version}/simple": { + "/admin/backups.json": { "get": { + "summary": "List backups", "tags": [ - "Simple" - ], - "operationId": "GetCallWithoutParametersAndResponse" - }, - "put": { - "tags": [ - "Simple" - ], - "operationId": "PutCallWithoutParametersAndResponse" - }, - "post": { - "tags": [ - "Simple" - ], - "operationId": "PostCallWithoutParametersAndResponse" - }, - "delete": { - "tags": [ - "Simple" - ], - "operationId": "DeleteCallWithoutParametersAndResponse" - }, - "options": { - "tags": [ - "Simple" - ], - "operationId": "OptionsCallWithoutParametersAndResponse" - }, - "head": { - "tags": [ - "Simple" - ], - "operationId": "HeadCallWithoutParametersAndResponse" - }, - "patch": { - "tags": [ - "Simple" - ], - "operationId": "PatchCallWithoutParametersAndResponse" - } - }, - "/api/v{api-version}/parameters/{parameterPath}": { - "get": { - "tags": [ - "Parameters" - ], - "operationId": "CallWithParameters", - "parameters": [ - { - "description": "This is the parameter that goes into the header", - "name": "parameterHeader", - "in": "header", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the query params", - "name": "parameterQuery", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the form data", - "name": "parameterForm", - "in": "formData", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the cookie", - "name": "parameterCookie", - "in": "cookie", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the path", - "name": "parameterPath", - "in": "path", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "name": "api-version", - "in": "path", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "This is the parameter that goes into the body", - "required": true, - "nullable": true, - "content": { - "application/json": { - "description": "Message for default response", - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - } - }, - "/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}": { - "get": { - "tags": [ - "Parameters" - ], - "operationId": "CallWithWeirdParameterNames", - "parameters": [ - { - "description": "This is the parameter that goes into the path", - "name": "parameter.path.1", - "in": "path", - "required": false, - "nullable": false, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the path", - "name": "parameter-path-2", - "in": "path", - "required": false, - "nullable": false, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the path", - "name": "PARAMETER-PATH-3", - "in": "path", - "required": false, - "nullable": false, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter with a reserved keyword", - "name": "default", - "in": "query", - "required": false, - "nullable": false, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the request header", - "name": "parameter.header", - "in": "header", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the request query params", - "name": "parameter-query", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the request form data", - "name": "parameter_form", - "in": "formData", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "description": "This is the parameter that goes into the cookie", - "name": "PARAMETER-COOKIE", - "in": "cookie", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - }, - { - "name": "api-version", - "in": "path", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "This is the parameter that goes into the body", - "required": true, - "nullable": true, - "content": { - "application/json": { - "description": "Message for default response", - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - } - }, - "/api/v{api-version}/parameters/": { - "get": { - "tags": [ - "Parameters" - ], - "operationId": "GetCallWithOptionalParam", - "parameters": [ - { - "description": "This is an optional parameter", - "name": "parameter", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "This is a required parameter", - "required": true, - "content": { - "application/json": { - "description": "Message for default response", - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - }, - "post": { - "tags": [ - "Parameters" - ], - "operationId": "PostCallWithOptionalParam", - "parameters": [ - { - "description": "This is a required parameter", - "name": "parameter", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "description": "This is an optional parameter", - "required": false, - "content": { - "application/json": { - "description": "Message for default response", - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - } - }, - "/api/v{api-version}/requestBody/": { - "post": { - "tags": [ - "RequestBody" - ], - "requestBody": { - "$ref": "#/components/requestBodies/SimpleRequestBody" - } - } - }, - "/api/v{api-version}/defaults": { - "get": { - "tags": [ - "Defaults" - ], - "operationId": "CallWithDefaultParameters", - "parameters": [ - { - "description": "This is a simple string with default value", - "name": "parameterString", - "in": "query", - "nullable": true, - "schema": { - "type": "string", - "default": "Hello World!" - } - }, - { - "description": "This is a simple number with default value", - "name": "parameterNumber", - "in": "query", - "nullable": true, - "schema": { - "type": "number", - "default": 123 - } - }, - { - "description": "This is a simple boolean with default value", - "name": "parameterBoolean", - "in": "query", - "nullable": true, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "description": "This is a simple enum with default value", - "name": "parameterEnum", - "in": "query", - "schema": { - "enum": [ - "Success", - "Warning", - "Error" - ], - "default": 0 - } - }, - { - "description": "This is a simple model with default value", - "name": "parameterModel", - "in": "query", - "nullable": true, - "schema": { - "$ref": "#/components/schemas/ModelWithString", - "default": { - "prop": "Hello World!" - } - } - } - ] - }, - "post": { - "tags": [ - "Defaults" - ], - "operationId": "CallWithDefaultOptionalParameters", - "parameters": [ - { - "description": "This is a simple string that is optional with default value", - "name": "parameterString", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "Hello World!" - } - }, - { - "description": "This is a simple number that is optional with default value", - "name": "parameterNumber", - "in": "query", - "required": false, - "schema": { - "type": "number", - "default": 123 - } - }, - { - "description": "This is a simple boolean that is optional with default value", - "name": "parameterBoolean", - "in": "query", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "description": "This is a simple enum that is optional with default value", - "name": "parameterEnum", - "in": "query", - "required": false, - "schema": { - "enum": [ - "Success", - "Warning", - "Error" - ], - "default": 0 - } - }, - { - "description": "This is a simple model that is optional with default value", - "name": "parameterModel", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/ModelWithString", - "default": { - "prop": "Hello World!" - } - } - } - ] - }, - "put": { - "tags": [ - "Defaults" - ], - "operationId": "CallToTestOrderOfParams", - "parameters": [ - { - "description": "This is a optional string with default", - "name": "parameterOptionalStringWithDefault", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "Hello World!" - } - }, - { - "description": "This is a optional string with empty default", - "name": "parameterOptionalStringWithEmptyDefault", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "" - } - }, - { - "description": "This is a optional string with no default", - "name": "parameterOptionalStringWithNoDefault", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "This is a string with default", - "name": "parameterStringWithDefault", - "in": "query", - "required": true, - "schema": { - "type": "string", - "default": "Hello World!" - } - }, - { - "description": "This is a string with empty default", - "name": "parameterStringWithEmptyDefault", - "in": "query", - "required": true, - "schema": { - "type": "string", - "default": "" - } - }, - { - "description": "This is a string with no default", - "name": "parameterStringWithNoDefault", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/api/v{api-version}/duplicate": { - "get": { - "tags": [ - "Duplicate" - ], - "operationId": "DuplicateName" - }, - "post": { - "tags": [ - "Duplicate" - ], - "operationId": "DuplicateName" - }, - "put": { - "tags": [ - "Duplicate" - ], - "operationId": "DuplicateName" - }, - "delete": { - "tags": [ - "Duplicate" - ], - "operationId": "DuplicateName" - } - }, - "/api/v{api-version}/no-content": { - "get": { - "tags": [ - "NoContent" - ], - "operationId": "CallWithNoContentResponse", - "responses": { - "204": { - "description": "Success" - } - } - } - }, - "/api/v{api-version}/response": { - "get": { - "tags": [ - "Response" - ], - "operationId": "CallWithResponse", - "responses": { - "default": { - "content": { - "application/json": { - "description": "Message for default response", - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - } - }, - "post": { - "tags": [ - "Response" - ], - "operationId": "CallWithDuplicateResponses", - "responses": { - "default": { - "description": "Message for default response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "201": { - "description": "Message for 201 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "202": { - "description": "Message for 202 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "500": { - "description": "Message for 500 error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "501": { - "description": "Message for 501 error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "502": { - "description": "Message for 502 error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - } - }, - "put": { - "tags": [ - "Response" - ], - "operationId": "CallWithResponses", - "responses": { - "default": { - "description": "Message for default response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "200": { - "description": "Message for 200 response", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "@namespace.string": { - "type": "string", - "readOnly": true - }, - "@namespace.integer": { - "type": "integer", - "readOnly": true - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelWithString" - }, - "readOnly": true - } - } - } - } - } - }, - "201": { - "description": "Message for 201 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelThatExtends" - } - } - } - }, - "202": { - "description": "Message for 202 response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelThatExtendsExtends" - } - } - } - }, - "500": { - "description": "Message for 500 error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "501": { - "description": "Message for 501 error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - }, - "502": { - "description": "Message for 502 error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - } - } - }, - "/api/v{api-version}/collectionFormat": { - "get": { - "tags": [ - "CollectionFormat" - ], - "operationId": "CollectionFormat", - "parameters": [ - { - "description": "This is an array parameter that is send as csv format (comma-separated values)", - "name": "parameterArrayCSV", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "collectionFormat": "csv" - }, - { - "description": "This is an array parameter that is send as ssv format (space-separated values)", - "name": "parameterArraySSV", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "collectionFormat": "ssv" - }, - { - "description": "This is an array parameter that is send as tsv format (tab-separated values)", - "name": "parameterArrayTSV", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "collectionFormat": "tsv" - }, - { - "description": "This is an array parameter that is send as pipes format (pipe-separated values)", - "name": "parameterArrayPipes", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "collectionFormat": "pipes" - }, - { - "description": "This is an array parameter that is send as multi format (multiple parameter instances)", - "name": "parameterArrayMulti", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "collectionFormat": "multi" - } - ] - } - }, - "/api/v{api-version}/types": { - "get": { - "tags": [ - "Types" - ], - "operationId": "Types", - "parameters": [ - { - "description": "This is a number parameter", - "name": "parameterNumber", - "in": "query", - "required": true, - "schema": { - "type": "int", - "default": 123 - } - }, - { - "description": "This is a string parameter", - "name": "parameterString", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "string", - "default": "default" - } - }, - { - "description": "This is a boolean parameter", - "name": "parameterBoolean", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "description": "This is an object parameter", - "name": "parameterObject", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "object", - "default": null - } - }, - { - "description": "This is an array parameter", - "name": "parameterArray", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "description": "This is a dictionary parameter", - "name": "parameterDictionary", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "type": "object", - "items": { - "type": "string" - } - } - }, - { - "description": "This is an enum parameter", - "name": "parameterEnum", - "in": "query", - "required": true, - "nullable": true, - "schema": { - "enum": [ - "Success", - "Warning", - "Error" - ] - } - }, - { - "description": "This is a number parameter", - "name": "id", - "in": "path", - "schema": { - "type": "integer", - "format": "int32" - } - } + "Backups" ], + "operationId": "getBackups", "responses": { "200": { - "description": "Response is a simple number", - "content": { - "application/json": { - "schema": { - "type": "number" - } - } - } - }, - "201": { - "description": "Response is a simple string", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "202": { - "description": "Response is a simple boolean", - "content": { - "application/json": { - "schema": { - "type": "boolean" - } - } - } - }, - "203": { - "description": "Response is a simple object", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - } - } - } - }, - "/api/v{api-version}/upload": { - "post": { - "tags": [ - "Upload" - ], - "operationId": "UploadFile", - "parameters": [ - { - "description": "Supply a file reference for upload", - "name": "file", - "in": "formData", - "required": true, - "schema": { - "type": "File" - } - }, - { - "name": "api-version", - "in": "path", - "required": true, - "nullable": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "boolean" - } - } - } - } - } - } - }, - "/api/v{api-version}/complex": { - "get": { - "tags": [ - "Complex" - ], - "operationId": "ComplexTypes", - "parameters": [ - { - "description": "Parameter containing object", - "name": "parameterObject", - "in": "query", - "required": true, - "schema": { - "type": "object", - "properties": { - "first": { - "type": "object", - "properties": { - "second": { - "type": "object", - "properties": { - "third": { - "type": "string" - } - } - } - } - } - } - } - }, - { - "description": "Parameter containing reference", - "name": "parameterReference", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - ], - "responses": { - "200": { - "description": "Successful response", + "description": "success response", "content": { "application/json": { "schema": { "type": "array", + "minItems": 1, + "uniqueItems": true, "items": { - "$ref": "#/components/schemas/ModelWithString" + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "last_modified": { + "type": "string" + } + }, + "required": [ + "filename", + "size", + "last_modified" + ] } } } } - }, - "400": { - "description": "400 server error" - }, - "500": { - "description": "500 server error" } } - } - }, - "/api/v{api-version}/multipart": { - "get": { + }, + "post": { + "summary": "Create backup", "tags": [ - "multipart" + "Backups" ], - "operationId": "MultipartResponse", + "operationId": "createBackup", + "parameters": [], "responses": { "200": { - "description": "OK", + "description": "success response", "content": { - "multipart/mixed": { + "application/json": { "schema": { - "type": "object", + "additionalProperties": false, "properties": { - "file": { + "success": { "type": "string", - "format": "binary" - }, - "metadata": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - } - } + "example": "OK" } - } + }, + "required": [ + "success" + ] } } } } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "with_uploads": { + "type": "boolean" + } + }, + "required": [ + "with_uploads" + ] + } + } + } } } }, - "/api/v{api-version}/complex/{id}": { + "/admin/backups/{filename}": { "put": { + "summary": "Send download backup email", "tags": [ - "Complex" + "Backups" ], - "operationId": "ComplexParams", + "operationId": "sendDownloadBackupEmail", "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "api-version", + "name": "filename", "in": "path", "required": true, "schema": { @@ -1124,102 +118,2874 @@ } } ], + "responses": { + "200": { + "description": "success response" + } + } + }, + "get": { + "summary": "Download backup", + "tags": [ + "Backups" + ], + "operationId": "downloadBackup", + "parameters": [ + { + "name": "filename", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "token", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success response" + } + } + } + }, + "/admin/badges.json": { + "get": { + "summary": "List badges", + "tags": [ + "Badges" + ], + "operationId": "adminListBadges", + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "badges": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "grant_count": { + "type": "integer" + }, + "allow_title": { + "type": "boolean" + }, + "multiple_grant": { + "type": "boolean" + }, + "icon": { + "type": "string" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "listable": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "badge_grouping_id": { + "type": "integer" + }, + "system": { + "type": "boolean" + }, + "long_description": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "manually_grantable": { + "type": "boolean" + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "trigger": { + "type": [ + "integer", + "null" + ] + }, + "target_posts": { + "type": "boolean" + }, + "auto_revoke": { + "type": "boolean" + }, + "show_posts": { + "type": "boolean" + }, + "i18n_name": { + "type": "string" + }, + "badge_type_id": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "description", + "grant_count", + "allow_title", + "multiple_grant", + "icon", + "image_url", + "listable", + "enabled", + "badge_grouping_id", + "system", + "long_description", + "slug", + "manually_grantable", + "query", + "trigger", + "target_posts", + "auto_revoke", + "show_posts", + "i18n_name", + "badge_type_id" + ] + } + ] + }, + "badge_types": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "sort_order": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "sort_order" + ] + } + ] + }, + "badge_groupings": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "position": { + "type": "integer" + }, + "system": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "description", + "position", + "system" + ] + } + ] + }, + "admin_badges": { + "type": "object", + "additionalProperties": false, + "properties": { + "protected_system_fields": { + "type": "array", + "items": [] + }, + "triggers": { + "type": "object", + "additionalProperties": false, + "properties": { + "user_change": { + "type": "integer" + }, + "none": { + "type": "integer" + }, + "post_revision": { + "type": "integer" + }, + "trust_level_change": { + "type": "integer" + }, + "post_action": { + "type": "integer" + } + }, + "required": [ + "user_change", + "none", + "post_revision", + "trust_level_change", + "post_action" + ] + }, + "badge_ids": { + "type": "array", + "items": [] + }, + "badge_grouping_ids": { + "type": "array", + "items": [] + }, + "badge_type_ids": { + "type": "array", + "items": [] + } + }, + "required": [ + "protected_system_fields", + "triggers", + "badge_ids", + "badge_grouping_ids", + "badge_type_ids" + ] + } + }, + "required": [ + "badges", + "badge_types", + "badge_groupings", + "admin_badges" + ] + } + } + } + } + } + }, + "post": { + "summary": "Create badge", + "tags": [ + "Badges" + ], + "operationId": "createBadge", + "parameters": [], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "badge_types": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "sort_order": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "sort_order" + ] + } + ] + }, + "badge": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "grant_count": { + "type": "integer" + }, + "allow_title": { + "type": "boolean" + }, + "multiple_grant": { + "type": "boolean" + }, + "icon": { + "type": "string" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "listable": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "badge_grouping_id": { + "type": "integer" + }, + "system": { + "type": "boolean" + }, + "long_description": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "manually_grantable": { + "type": "boolean" + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "trigger": { + "type": [ + "string", + "null" + ] + }, + "target_posts": { + "type": "boolean" + }, + "auto_revoke": { + "type": "boolean" + }, + "show_posts": { + "type": "boolean" + }, + "badge_type_id": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "description", + "grant_count", + "allow_title", + "multiple_grant", + "icon", + "image_url", + "listable", + "enabled", + "badge_grouping_id", + "system", + "long_description", + "slug", + "manually_grantable", + "query", + "trigger", + "target_posts", + "auto_revoke", + "show_posts", + "badge_type_id" + ] + } + }, + "required": [ + "badge_types", + "badge" + ] + } + } + } + } + }, "requestBody": { "content": { - "application/json-patch+json": { + "application/json": { "schema": { - "required": [ - "key", - "name", - "parameters", - "type" - ], - "type": "object", + "additionalProperties": false, "properties": { - "key": { - "maxLength": 64, - "pattern": "^[a-zA-Z0-9_]*$", - "type": "string", - "nullable": true, - "readOnly": true - }, "name": { - "maxLength": 255, "type": "string", - "nullable": true + "description": "The name for the new badge." }, - "enabled": { - "type": "boolean", - "default": true - }, - "type": { - "enum": [ - "Monkey", - "Horse", - "Bird" - ], - "type": "string", - "readOnly": true - }, - "listOfModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelWithString" + "badge_type_id": { + "type": "integer", + "description": "The ID for the badge type. 1 for Gold, 2 for Silver,\n3 for Bronze." + } + }, + "required": [ + "name", + "badge_type_id" + ] + } + } + } + } + } + }, + "/admin/badges/{id}.json": { + "put": { + "summary": "Update badge", + "tags": [ + "Badges" + ], + "operationId": "updateBadge", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "badge_types": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "sort_order": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "sort_order" + ] + } + ] }, - "nullable": true + "badge": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "grant_count": { + "type": "integer" + }, + "allow_title": { + "type": "boolean" + }, + "multiple_grant": { + "type": "boolean" + }, + "icon": { + "type": "string" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "listable": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "badge_grouping_id": { + "type": "integer" + }, + "system": { + "type": "boolean" + }, + "long_description": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "manually_grantable": { + "type": "boolean" + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "trigger": { + "type": [ + "string", + "null" + ] + }, + "target_posts": { + "type": "boolean" + }, + "auto_revoke": { + "type": "boolean" + }, + "show_posts": { + "type": "boolean" + }, + "badge_type_id": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "description", + "grant_count", + "allow_title", + "multiple_grant", + "icon", + "image_url", + "listable", + "enabled", + "badge_grouping_id", + "system", + "long_description", + "slug", + "manually_grantable", + "query", + "trigger", + "target_posts", + "auto_revoke", + "show_posts", + "badge_type_id" + ] + } }, - "listOfStrings": { - "type": "array", - "items": { + "required": [ + "badge_types", + "badge" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name for the new badge." + }, + "badge_type_id": { + "type": "integer", + "description": "The ID for the badge type. 1 for Gold, 2 for Silver,\n3 for Bronze." + } + }, + "required": [ + "name", + "badge_type_id" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete badge", + "tags": [ + "Badges" + ], + "operationId": "deleteBadge", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "success response" + } + } + } + }, + "/categories.json": { + "post": { + "summary": "Creates a category", + "tags": [ + "Categories" + ], + "operationId": "createCategory", + "parameters": [], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "category": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "color": { + "type": "string" + }, + "text_color": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "topic_count": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "description_text": { + "type": [ + "string", + "null" + ] + }, + "description_excerpt": { + "type": [ + "string", + "null" + ] + }, + "topic_url": { + "type": [ + "string", + "null" + ] + }, + "read_restricted": { + "type": "boolean" + }, + "permission": { + "type": [ + "integer", + "null" + ] + }, + "notification_level": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "topic_template": { + "type": [ + "string", + "null" + ] + }, + "has_children": { + "type": [ + "string", + "null" + ] + }, + "sort_order": { + "type": [ + "string", + "null" + ] + }, + "sort_ascending": { + "type": [ + "string", + "null" + ] + }, + "show_subcategory_list": { + "type": "boolean" + }, + "num_featured_topics": { + "type": "integer" + }, + "default_view": { + "type": [ + "string", + "null" + ] + }, + "subcategory_list_style": { + "type": "string" + }, + "default_top_period": { + "type": "string" + }, + "default_list_filter": { + "type": "string" + }, + "minimum_required_tags": { + "type": "integer" + }, + "navigate_to_first_post_after_read": { + "type": "boolean" + }, + "custom_fields": { + "type": "object", + "additionalProperties": false, + "properties": {}, + "required": [] + }, + "min_tags_from_required_group": { + "type": "integer" + }, + "allowed_tags": { + "type": "array" + }, + "allowed_tag_groups": { + "type": "array" + }, + "allow_global_tags": { + "type": "boolean" + }, + "required_tag_group_name": { + "type": [ + "string", + "null" + ] + }, + "read_only_banner": { + "type": [ + "string", + "null" + ] + }, + "available_groups": { + "type": "array", + "items": [] + }, + "auto_close_hours": { + "type": [ + "string", + "null" + ] + }, + "auto_close_based_on_last_post": { + "type": "boolean" + }, + "allow_unlimited_owner_edits_on_first_post": { + "type": "boolean" + }, + "default_slow_mode_seconds": { + "type": [ + "string", + "null" + ] + }, + "group_permissions": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "permission_type": { + "type": "integer" + }, + "group_name": { + "type": "string" + } + }, + "required": [ + "permission_type", + "group_name" + ] + } + ] + }, + "email_in": { + "type": [ + "string", + "null" + ] + }, + "email_in_allow_strangers": { + "type": "boolean" + }, + "mailinglist_mirror": { + "type": "boolean" + }, + "all_topics_wiki": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "cannot_delete_reason": { + "type": [ + "string", + "null" + ] + }, + "allow_badges": { + "type": "boolean" + }, + "topic_featured_link_allowed": { + "type": "boolean" + }, + "search_priority": { + "type": "integer" + }, + "uploaded_logo": { + "type": [ + "string", + "null" + ] + }, + "uploaded_background": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "color", + "text_color", + "slug", + "topic_count", + "post_count", + "position", + "description", + "description_text", + "description_excerpt", + "topic_url", + "read_restricted", + "permission", + "notification_level", + "can_edit", + "topic_template", + "has_children", + "sort_order", + "sort_ascending", + "show_subcategory_list", + "num_featured_topics", + "default_view", + "subcategory_list_style", + "default_top_period", + "default_list_filter", + "minimum_required_tags", + "navigate_to_first_post_after_read", + "custom_fields", + "min_tags_from_required_group", + "required_tag_group_name", + "read_only_banner", + "available_groups", + "auto_close_hours", + "auto_close_based_on_last_post", + "allow_unlimited_owner_edits_on_first_post", + "default_slow_mode_seconds", + "group_permissions", + "email_in", + "email_in_allow_strangers", + "mailinglist_mirror", + "all_topics_wiki", + "can_delete", + "cannot_delete_reason", + "allow_badges", + "topic_featured_link_allowed", + "search_priority", + "uploaded_logo", + "uploaded_background" + ] + } + }, + "required": [ + "category" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "color": { + "type": "string", + "example": "49d9e9" + }, + "text_color": { + "type": "string", + "example": "f0fcfd" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "get": { + "summary": "Retrieves a list of categories", + "tags": [ + "Categories" + ], + "operationId": "listCategories", + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "category_list": { + "type": "object", + "additionalProperties": false, + "properties": { + "can_create_category": { + "type": "boolean" + }, + "can_create_topic": { + "type": "boolean" + }, + "categories": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "color": { + "type": "string" + }, + "text_color": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "topic_count": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "description_text": { + "type": "string" + }, + "description_excerpt": { + "type": "string" + }, + "topic_url": { + "type": [ + "string", + "null" + ] + }, + "read_restricted": { + "type": "boolean" + }, + "permission": { + "type": "integer" + }, + "notification_level": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "topic_template": { + "type": [ + "string", + "null" + ] + }, + "has_children": { + "type": "boolean" + }, + "sort_order": { + "type": [ + "string", + "null" + ] + }, + "sort_ascending": { + "type": [ + "string", + "null" + ] + }, + "show_subcategory_list": { + "type": "boolean" + }, + "num_featured_topics": { + "type": "integer" + }, + "default_view": { + "type": [ + "string", + "null" + ] + }, + "subcategory_list_style": { + "type": "string" + }, + "default_top_period": { + "type": "string" + }, + "default_list_filter": { + "type": "string" + }, + "minimum_required_tags": { + "type": "integer" + }, + "navigate_to_first_post_after_read": { + "type": "boolean" + }, + "topics_day": { + "type": "integer" + }, + "topics_week": { + "type": "integer" + }, + "topics_month": { + "type": "integer" + }, + "topics_year": { + "type": "integer" + }, + "topics_all_time": { + "type": "integer" + }, + "is_uncategorized": { + "type": "boolean" + }, + "subcategory_ids": { + "type": "array", + "items": [] + }, + "uploaded_logo": { + "type": [ + "string", + "null" + ] + }, + "uploaded_background": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "color", + "text_color", + "slug", + "topic_count", + "post_count", + "position", + "description", + "description_text", + "description_excerpt", + "topic_url", + "read_restricted", + "permission", + "notification_level", + "can_edit", + "topic_template", + "has_children", + "sort_order", + "sort_ascending", + "show_subcategory_list", + "num_featured_topics", + "default_view", + "subcategory_list_style", + "default_top_period", + "default_list_filter", + "minimum_required_tags", + "navigate_to_first_post_after_read", + "topics_day", + "topics_week", + "topics_month", + "topics_year", + "topics_all_time", + "is_uncategorized", + "subcategory_ids", + "uploaded_logo", + "uploaded_background" + ] + } + ] + } + }, + "required": [ + "can_create_category", + "can_create_topic", + "categories" + ] + } + }, + "required": [ + "category_list" + ] + } + } + } + } + } + } + }, + "/categories/{id}.json": { + "put": { + "summary": "Updates a category", + "tags": [ + "Categories" + ], + "operationId": "updateCategory", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { "type": "string" }, - "nullable": true + "category": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "color": { + "type": "string" + }, + "text_color": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "topic_count": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "description_text": { + "type": [ + "string", + "null" + ] + }, + "description_excerpt": { + "type": [ + "string", + "null" + ] + }, + "topic_url": { + "type": [ + "string", + "null" + ] + }, + "read_restricted": { + "type": "boolean" + }, + "permission": { + "type": [ + "string", + "null" + ] + }, + "notification_level": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "topic_template": { + "type": [ + "string", + "null" + ] + }, + "has_children": { + "type": [ + "string", + "null" + ] + }, + "sort_order": { + "type": [ + "string", + "null" + ] + }, + "sort_ascending": { + "type": [ + "string", + "null" + ] + }, + "show_subcategory_list": { + "type": "boolean" + }, + "num_featured_topics": { + "type": "integer" + }, + "default_view": { + "type": [ + "string", + "null" + ] + }, + "subcategory_list_style": { + "type": "string" + }, + "default_top_period": { + "type": "string" + }, + "default_list_filter": { + "type": "string" + }, + "minimum_required_tags": { + "type": "integer" + }, + "navigate_to_first_post_after_read": { + "type": "boolean" + }, + "custom_fields": { + "type": "object", + "additionalProperties": false, + "properties": {}, + "required": [] + }, + "min_tags_from_required_group": { + "type": "integer" + }, + "allowed_tags": { + "type": "array" + }, + "allowed_tag_groups": { + "type": "array" + }, + "allow_global_tags": { + "type": "boolean" + }, + "required_tag_group_name": { + "type": [ + "string", + "null" + ] + }, + "read_only_banner": { + "type": [ + "string", + "null" + ] + }, + "available_groups": { + "type": "array", + "items": [] + }, + "auto_close_hours": { + "type": [ + "string", + "null" + ] + }, + "auto_close_based_on_last_post": { + "type": "boolean" + }, + "allow_unlimited_owner_edits_on_first_post": { + "type": "boolean" + }, + "default_slow_mode_seconds": { + "type": [ + "string", + "null" + ] + }, + "group_permissions": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "permission_type": { + "type": "integer" + }, + "group_name": { + "type": "string" + } + }, + "required": [ + "permission_type", + "group_name" + ] + } + ] + }, + "email_in": { + "type": [ + "string", + "null" + ] + }, + "email_in_allow_strangers": { + "type": "boolean" + }, + "mailinglist_mirror": { + "type": "boolean" + }, + "all_topics_wiki": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "cannot_delete_reason": { + "type": [ + "string", + "null" + ] + }, + "allow_badges": { + "type": "boolean" + }, + "topic_featured_link_allowed": { + "type": "boolean" + }, + "search_priority": { + "type": "integer" + }, + "uploaded_logo": { + "type": [ + "string", + "null" + ] + }, + "uploaded_background": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "color", + "text_color", + "slug", + "topic_count", + "post_count", + "position", + "description", + "description_text", + "description_excerpt", + "topic_url", + "read_restricted", + "permission", + "notification_level", + "can_edit", + "topic_template", + "has_children", + "sort_order", + "sort_ascending", + "show_subcategory_list", + "num_featured_topics", + "default_view", + "subcategory_list_style", + "default_top_period", + "default_list_filter", + "minimum_required_tags", + "navigate_to_first_post_after_read", + "custom_fields", + "min_tags_from_required_group", + "required_tag_group_name", + "read_only_banner", + "available_groups", + "auto_close_hours", + "auto_close_based_on_last_post", + "allow_unlimited_owner_edits_on_first_post", + "default_slow_mode_seconds", + "group_permissions", + "email_in", + "email_in_allow_strangers", + "mailinglist_mirror", + "all_topics_wiki", + "can_delete", + "cannot_delete_reason", + "allow_badges", + "topic_featured_link_allowed", + "search_priority", + "uploaded_logo", + "uploaded_background" + ] + } }, - "parameters": { - "type": "object", - "oneOf": [ - { - "$ref": "#/components/schemas/ModelWithString" - }, - { - "$ref": "#/components/schemas/ModelWithEnum" - }, - { - "$ref": "#/components/schemas/ModelWithArray" - }, - { - "$ref": "#/components/schemas/ModelWithDictionary" - } - ] + "required": [ + "success", + "category" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" }, - "user": { + "color": { + "type": "string", + "example": "49d9e9" + }, + "text_color": { + "type": "string", + "example": "f0fcfd" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "/c/{slug}/{id}.json": { + "get": { + "summary": "List topics", + "tags": [ + "Categories" + ], + "operationId": "listCategoryTopics", + "parameters": [ + { + "name": "slug", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "integer" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "users": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template" + ] + } + ] + }, + "primary_groups": { + "type": "array", + "items": [] + }, + "topic_list": { + "type": "object", + "additionalProperties": false, + "properties": { + "can_create_topic": { + "type": "boolean" + }, + "per_page": { + "type": "integer" + }, + "top_tags": { + "type": "array" + }, + "topics": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "highest_post_number": { + "type": "integer" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_posted_at": { + "type": "string" + }, + "bumped": { + "type": "boolean" + }, + "bumped_at": { + "type": "string" + }, + "archetype": { + "type": "string" + }, + "unseen": { + "type": "boolean" + }, + "pinned": { + "type": "boolean" + }, + "unpinned": { + "type": [ + "string", + "null" + ] + }, + "excerpt": { + "type": "string" + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "bookmarked": { + "type": [ + "string", + "null" + ] + }, + "liked": { + "type": [ + "string", + "null" + ] + }, + "views": { + "type": "integer" + }, + "like_count": { + "type": "integer" + }, + "has_summary": { + "type": "boolean" + }, + "last_poster_username": { + "type": "string" + }, + "category_id": { + "type": "integer" + }, + "pinned_globally": { + "type": "boolean" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "posters": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "extras": { + "type": "string" + }, + "description": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "extras", + "description", + "user_id", + "primary_group_id" + ] + } + ] + } + }, + "required": [ + "id", + "title", + "fancy_title", + "slug", + "posts_count", + "reply_count", + "highest_post_number", + "image_url", + "created_at", + "last_posted_at", + "bumped", + "bumped_at", + "archetype", + "unseen", + "pinned", + "unpinned", + "excerpt", + "visible", + "closed", + "archived", + "bookmarked", + "liked", + "views", + "like_count", + "has_summary", + "last_poster_username", + "category_id", + "pinned_globally", + "featured_link", + "posters" + ] + } + ] + } + }, + "required": [ + "can_create_topic", + "per_page", + "topics" + ] + } + }, + "required": [ + "topic_list" + ] + } + } + } + } + } + } + }, + "/c/{id}/show.json": { + "get": { + "summary": "Show category", + "tags": [ + "Categories" + ], + "operationId": "getCategory", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "integer" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "category": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "color": { + "type": "string" + }, + "text_color": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "topic_count": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "description_text": { + "type": [ + "string", + "null" + ] + }, + "description_excerpt": { + "type": [ + "string", + "null" + ] + }, + "topic_url": { + "type": [ + "string", + "null" + ] + }, + "read_restricted": { + "type": "boolean" + }, + "permission": { + "type": [ + "integer", + "null" + ] + }, + "notification_level": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "topic_template": { + "type": [ + "string", + "null" + ] + }, + "has_children": { + "type": [ + "string", + "null" + ] + }, + "sort_order": { + "type": [ + "string", + "null" + ] + }, + "sort_ascending": { + "type": [ + "string", + "null" + ] + }, + "show_subcategory_list": { + "type": "boolean" + }, + "num_featured_topics": { + "type": "integer" + }, + "default_view": { + "type": [ + "string", + "null" + ] + }, + "subcategory_list_style": { + "type": "string" + }, + "default_top_period": { + "type": "string" + }, + "default_list_filter": { + "type": "string" + }, + "minimum_required_tags": { + "type": "integer" + }, + "navigate_to_first_post_after_read": { + "type": "boolean" + }, + "custom_fields": { + "type": "object", + "additionalProperties": false, + "properties": {}, + "required": [] + }, + "min_tags_from_required_group": { + "type": "integer" + }, + "allowed_tags": { + "type": "array" + }, + "allowed_tag_groups": { + "type": "array" + }, + "allow_global_tags": { + "type": "boolean" + }, + "required_tag_group_name": { + "type": [ + "string", + "null" + ] + }, + "read_only_banner": { + "type": [ + "string", + "null" + ] + }, + "available_groups": { + "type": "array", + "items": [] + }, + "auto_close_hours": { + "type": [ + "string", + "null" + ] + }, + "auto_close_based_on_last_post": { + "type": "boolean" + }, + "allow_unlimited_owner_edits_on_first_post": { + "type": "boolean" + }, + "default_slow_mode_seconds": { + "type": [ + "string", + "null" + ] + }, + "group_permissions": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "permission_type": { + "type": "integer" + }, + "group_name": { + "type": "string" + } + }, + "required": [ + "permission_type", + "group_name" + ] + } + ] + }, + "email_in": { + "type": [ + "string", + "null" + ] + }, + "email_in_allow_strangers": { + "type": "boolean" + }, + "mailinglist_mirror": { + "type": "boolean" + }, + "all_topics_wiki": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "cannot_delete_reason": { + "type": [ + "string", + "null" + ] + }, + "allow_badges": { + "type": "boolean" + }, + "topic_featured_link_allowed": { + "type": "boolean" + }, + "search_priority": { + "type": "integer" + }, + "uploaded_logo": { + "type": [ + "string", + "null" + ] + }, + "uploaded_background": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "color", + "text_color", + "slug", + "topic_count", + "post_count", + "position", + "description", + "description_text", + "description_excerpt", + "topic_url", + "read_restricted", + "permission", + "notification_level", + "can_edit", + "topic_template", + "has_children", + "sort_order", + "sort_ascending", + "show_subcategory_list", + "num_featured_topics", + "default_view", + "subcategory_list_style", + "default_top_period", + "default_list_filter", + "minimum_required_tags", + "navigate_to_first_post_after_read", + "custom_fields", + "min_tags_from_required_group", + "required_tag_group_name", + "read_only_banner", + "available_groups", + "auto_close_hours", + "auto_close_based_on_last_post", + "allow_unlimited_owner_edits_on_first_post", + "default_slow_mode_seconds", + "group_permissions", + "email_in", + "email_in_allow_strangers", + "mailinglist_mirror", + "all_topics_wiki", + "can_delete", + "cannot_delete_reason", + "allow_badges", + "topic_featured_link_allowed", + "search_priority", + "uploaded_logo", + "uploaded_background" + ] + } + }, + "required": [ + "category" + ] + } + } + } + } + } + } + }, + "/admin/groups.json": { + "post": { + "summary": "Creates a group", + "tags": [ + "Groups" + ], + "operationId": "createGroup", + "parameters": [], + "responses": { + "200": { + "description": "group created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "basic_group": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "automatic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "user_count": { + "type": "integer" + }, + "mentionable_level": { + "type": "integer" + }, + "messageable_level": { + "type": "integer" + }, + "visibility_level": { + "type": "integer" + }, + "automatic_membership_email_domains": { + "type": [ + "string", + "null" + ] + }, + "automatic_membership_retroactive": { + "type": "boolean" + }, + "primary_group": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "grant_trust_level": { + "type": [ + "string", + "null" + ] + }, + "incoming_email": { + "type": [ + "string", + "null" + ] + }, + "has_messages": { + "type": "boolean" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "bio_raw": { + "type": [ + "string", + "null" + ] + }, + "bio_cooked": { + "type": [ + "string", + "null" + ] + }, + "bio_excerpt": { + "type": [ + "string", + "null" + ] + }, + "public_admission": { + "type": "boolean" + }, + "public_exit": { + "type": "boolean" + }, + "allow_membership_requests": { + "type": "boolean" + }, + "full_name": { + "type": [ + "string", + "null" + ] + }, + "default_notification_level": { + "type": "integer" + }, + "membership_request_template": { + "type": [ + "string", + "null" + ] + }, + "membership_visibility_level": { + "type": "integer" + }, + "can_see_members": { + "type": "boolean" + }, + "publish_read_state": { + "type": "boolean" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "basic_group" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "group": { "type": "object", "properties": { - "id": { - "type": "integer", - "format": "int32", - "readOnly": true - }, "name": { - "type": "string", - "nullable": true, - "readOnly": true + "type": "string" } }, - "readOnly": true + "required": [ + "name" + ] + } + }, + "required": [ + "group" + ] + } + } + } + } + } + }, + "/admin/groups/{id}.json": { + "delete": { + "summary": "Delete a group", + "tags": [ + "Groups" + ], + "operationId": "deleteGroup", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "string", + "example": "OK" + } + }, + "required": [ + "success" + ] + } + } + } + } + } + } + }, + "/groups/{id}.json": { + "put": { + "summary": "Update a group", + "tags": [ + "Groups" + ], + "operationId": "updateGroup", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "string", + "example": "OK" + } } } } } } }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "group": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "group" + ] + } + } + } + } + }, + "get": { + "summary": "Get a group", + "tags": [ + "Groups" + ], + "operationId": "getGroup", + "parameters": [ + { + "name": "id", + "in": "path", + "example": "name", + "description": "Use group name instead of id", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "description": "Success", + "description": "success response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ModelWithString" + "additionalProperties": false, + "properties": { + "group": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "automatic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "user_count": { + "type": "integer" + }, + "mentionable_level": { + "type": "integer" + }, + "messageable_level": { + "type": "integer" + }, + "visibility_level": { + "type": "integer" + }, + "primary_group": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "grant_trust_level": { + "type": [ + "string", + "null" + ] + }, + "incoming_email": { + "type": [ + "string", + "null" + ] + }, + "has_messages": { + "type": "boolean" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "bio_raw": { + "type": [ + "string", + "null" + ] + }, + "bio_cooked": { + "type": [ + "string", + "null" + ] + }, + "bio_excerpt": { + "type": [ + "string", + "null" + ] + }, + "public_admission": { + "type": "boolean" + }, + "public_exit": { + "type": "boolean" + }, + "allow_membership_requests": { + "type": "boolean" + }, + "full_name": { + "type": [ + "string", + "null" + ] + }, + "default_notification_level": { + "type": "integer" + }, + "membership_request_template": { + "type": [ + "string", + "null" + ] + }, + "is_group_user": { + "type": "boolean" + }, + "members_visibility_level": { + "type": "integer" + }, + "can_see_members": { + "type": "boolean" + }, + "can_admin_group": { + "type": "boolean" + }, + "publish_read_state": { + "type": "boolean" + }, + "is_group_owner_display": { + "type": "boolean" + }, + "mentionable": { + "type": "boolean" + }, + "messageable": { + "type": "boolean" + }, + "automatic_membership_email_domains": { + "type": [ + "string", + "null" + ] + }, + "smtp_updated_at": { + "type": [ + "string", + "null" + ] + }, + "smtp_updated_by": { + "type": [ + "object", + "null" + ] + }, + "smtp_enabled": { + "type": "boolean" + }, + "smtp_server": { + "type": [ + "string", + "null" + ] + }, + "smtp_port": { + "type": [ + "string", + "null" + ] + }, + "smtp_ssl": { + "type": [ + "string", + "null" + ] + }, + "imap_enabled": { + "type": "boolean" + }, + "imap_updated_at": { + "type": [ + "string", + "null" + ] + }, + "imap_updated_by": { + "type": [ + "object", + "null" + ] + }, + "imap_server": { + "type": [ + "string", + "null" + ] + }, + "imap_port": { + "type": [ + "string", + "null" + ] + }, + "imap_ssl": { + "type": [ + "string", + "null" + ] + }, + "imap_mailbox_name": { + "type": "string" + }, + "imap_mailboxes": { + "type": "array", + "items": [] + }, + "email_username": { + "type": [ + "string", + "null" + ] + }, + "email_password": { + "type": [ + "string", + "null" + ] + }, + "imap_last_error": { + "type": [ + "string", + "null" + ] + }, + "imap_old_emails": { + "type": [ + "string", + "null" + ] + }, + "imap_new_emails": { + "type": [ + "string", + "null" + ] + }, + "message_count": { + "type": "integer" + }, + "allow_unknown_sender_topic_replies": { + "type": "boolean" + }, + "watching_category_ids": { + "type": "array", + "items": [] + }, + "tracking_category_ids": { + "type": "array", + "items": [] + }, + "watching_first_post_category_ids": { + "type": "array", + "items": [] + }, + "regular_category_ids": { + "type": "array", + "items": [] + }, + "muted_category_ids": { + "type": "array", + "items": [] + }, + "watching_tags": { + "type": "array", + "items": [] + }, + "watching_first_post_tags": { + "type": "array", + "items": [] + }, + "tracking_tags": { + "type": "array", + "items": [] + }, + "regular_tags": { + "type": "array", + "items": [] + }, + "muted_tags": { + "type": "array", + "items": [] + } + }, + "required": [ + "id", + "automatic", + "name", + "user_count", + "mentionable_level", + "messageable_level", + "visibility_level", + "primary_group", + "title", + "grant_trust_level", + "incoming_email", + "has_messages", + "flair_url", + "flair_bg_color", + "flair_color", + "bio_raw", + "bio_cooked", + "bio_excerpt", + "public_admission", + "public_exit", + "allow_membership_requests", + "full_name", + "default_notification_level", + "membership_request_template", + "is_group_user", + "members_visibility_level", + "can_see_members", + "can_admin_group", + "publish_read_state", + "is_group_owner_display", + "mentionable", + "messageable", + "automatic_membership_email_domains", + "smtp_server", + "smtp_port", + "smtp_ssl", + "imap_server", + "imap_port", + "imap_ssl", + "imap_mailbox_name", + "imap_mailboxes", + "email_username", + "email_password", + "imap_last_error", + "imap_old_emails", + "imap_new_emails", + "message_count", + "allow_unknown_sender_topic_replies", + "watching_category_ids", + "tracking_category_ids", + "watching_first_post_category_ids", + "regular_category_ids", + "muted_category_ids" + ] + }, + "extras": { + "type": "object", + "additionalProperties": false, + "properties": { + "visible_group_names": { + "type": "array", + "items": [] + } + }, + "required": [ + "visible_group_names" + ] + } + }, + "required": [ + "group", + "extras" + ] } } } @@ -1227,793 +2993,11076 @@ } } }, - "/api/v{api-version}/header": { - "post": { + "/groups/{id}/members.json": { + "get": { + "summary": "List group members", "tags": [ - "Header" + "Groups" + ], + "operationId": "listGroupMembers", + "parameters": [ + { + "name": "id", + "in": "path", + "example": "name", + "description": "Use group name instead of id", + "required": true, + "schema": { + "type": "string" + } + } ], - "operationId": "CallWithResultFromHeader", "responses": { "200": { - "description": "Successful response", - "headers": { - "operation-location": { + "description": "success response", + "content": { + "application/json": { "schema": { - "type": "string" + "additionalProperties": false, + "properties": { + "members": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "last_posted_at": { + "type": "string" + }, + "last_seen_at": { + "type": "string" + }, + "added_at": { + "type": "string" + }, + "timezone": { + "type": "string" + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "title", + "last_posted_at", + "last_seen_at", + "added_at", + "timezone" + ] + } + ] + }, + "owners": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "last_posted_at": { + "type": "string" + }, + "last_seen_at": { + "type": "string" + }, + "added_at": { + "type": "string" + }, + "timezone": { + "type": "string" + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "title", + "last_posted_at", + "last_seen_at", + "added_at", + "timezone" + ] + } + ] + }, + "meta": { + "type": "object", + "additionalProperties": false, + "properties": { + "total": { + "type": "integer" + }, + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "total", + "limit", + "offset" + ] + } + }, + "required": [ + "members", + "owners", + "meta" + ] } } } + } + } + }, + "put": { + "summary": "Add group members", + "tags": [ + "Groups" + ], + "operationId": "addGroupMembers", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "string" + }, + "usernames": { + "type": "array", + "items": [] + }, + "emails": { + "type": "array", + "items": [] + } + }, + "required": [ + "success", + "usernames", + "emails" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "usernames": { + "type": "string", + "description": "comma separated list", + "example": "username1,username2" + } + } + } + } + } + } + }, + "delete": { + "summary": "Remove group members", + "tags": [ + "Groups" + ], + "operationId": "removeGroupMembers", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "string" + }, + "usernames": { + "type": "array", + "items": [] + }, + "skipped_usernames": { + "type": "array", + "items": [] + } + }, + "required": [ + "success", + "usernames", + "skipped_usernames" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "usernames": { + "type": "string", + "description": "comma separated list", + "example": "username1,username2" + } + } + } + } + } + } + } + }, + "/groups.json": { + "get": { + "summary": "List groups", + "tags": [ + "Groups" + ], + "operationId": "listGroups", + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "groups": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "automatic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "user_count": { + "type": "integer" + }, + "mentionable_level": { + "type": "integer" + }, + "messageable_level": { + "type": "integer" + }, + "visibility_level": { + "type": "integer" + }, + "primary_group": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "grant_trust_level": { + "type": [ + "string", + "null" + ] + }, + "incoming_email": { + "type": [ + "string", + "null" + ] + }, + "has_messages": { + "type": "boolean" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "bio_raw": { + "type": [ + "string", + "null" + ] + }, + "bio_cooked": { + "type": [ + "string", + "null" + ] + }, + "bio_excerpt": { + "type": [ + "string", + "null" + ] + }, + "public_admission": { + "type": "boolean" + }, + "public_exit": { + "type": "boolean" + }, + "allow_membership_requests": { + "type": "boolean" + }, + "full_name": { + "type": [ + "string", + "null" + ] + }, + "default_notification_level": { + "type": "integer" + }, + "membership_request_template": { + "type": [ + "string", + "null" + ] + }, + "is_group_user": { + "type": "boolean" + }, + "is_group_owner": { + "type": "boolean" + }, + "members_visibility_level": { + "type": "integer" + }, + "can_see_members": { + "type": "boolean" + }, + "can_admin_group": { + "type": "boolean" + }, + "publish_read_state": { + "type": "boolean" + } + }, + "required": [ + "id", + "automatic", + "name", + "display_name", + "user_count", + "mentionable_level", + "messageable_level", + "visibility_level", + "primary_group", + "title", + "grant_trust_level", + "incoming_email", + "has_messages", + "flair_url", + "flair_bg_color", + "flair_color", + "bio_raw", + "bio_cooked", + "bio_excerpt", + "public_admission", + "public_exit", + "allow_membership_requests", + "full_name", + "default_notification_level", + "membership_request_template", + "members_visibility_level", + "can_see_members", + "can_admin_group", + "publish_read_state" + ] + } + ] + }, + "extras": { + "type": "object", + "additionalProperties": false, + "properties": { + "type_filters": { + "type": "array", + "items": [] + } + }, + "required": [ + "type_filters" + ] + }, + "total_rows_groups": { + "type": "integer" + }, + "load_more_groups": { + "type": "string" + } + }, + "required": [ + "groups", + "extras", + "total_rows_groups", + "load_more_groups" + ] + } + } + } + } + } + } + }, + "/invites.json": { + "post": { + "summary": "Create an invite", + "tags": [ + "Invites" + ], + "operationId": "createInvite", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } }, - "400": { - "description": "400 server error" + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "example": 42 + }, + "link": { + "type": "string", + "example": "http://example.com/invites/9045fd767efe201ca60c6658bcf14158" + }, + "email": { + "type": "string", + "example": "not-a-user-yet@example.com" + }, + "emailed": { + "type": "boolean", + "example": false + }, + "custom_message": { + "type": [ + "string", + "null" + ], + "example": "Hello world!" + }, + "topics": { + "type": "array", + "example": [] + }, + "groups": { + "type": "array", + "example": [] + }, + "created_at": { + "type": "string", + "example": "2021-01-01T12:00:00.000Z" + }, + "updated_at": { + "type": "string", + "example": "2021-01-01T12:00:00.000Z" + }, + "expires_at": { + "type": "string", + "example": "2021-02-01T12:00:00.000Z" + }, + "expired": { + "type": "boolean", + "example": false + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "example": "not-a-user-yet@example.com", + "description": "required for email invites only" + }, + "skip_email": { + "type": "boolean", + "default": false + }, + "custom_message": { + "type": "string", + "description": "optional, for email invites" + }, + "max_redemptions_allowed": { + "type": "integer", + "example": 5, + "default": 1, + "description": "optional, for link invites" + }, + "topic_id": { + "type": "integer" + }, + "group_id": { + "type": "integer", + "description": "optional, either this or `group_names`" + }, + "group_names": { + "type": "string", + "description": "optional, either this or `group_id`" + }, + "expires_at": { + "type": "string", + "default": "controlled by invite_expiry_days site setting" + } + } + } + } + } + } + } + }, + "/notifications.json": { + "get": { + "summary": "Get the notifications that belong to the current user", + "tags": [ + "Notifications" + ], + "operationId": "getNotifications", + "responses": { + "200": { + "description": "notifications", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "notification_type": { + "type": "integer" + }, + "read": { + "type": "boolean" + }, + "created_at": { + "type": "string" + }, + "post_number": { + "type": [ + "string", + "null" + ] + }, + "topic_id": { + "type": [ + "integer", + "null" + ] + }, + "slug": { + "type": [ + "string", + "null" + ] + }, + "data": { + "type": "object", + "properties": { + "badge_id": { + "type": "integer" + }, + "badge_name": { + "type": "string" + }, + "badge_slug": { + "type": "string" + }, + "badge_title": { + "type": "boolean" + }, + "username": { + "type": "string" + } + } + } + } + } + }, + "total_rows_notifications": { + "type": "integer" + }, + "seen_notification_id": { + "type": "integer" + }, + "load_more_notifications": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/notifications/mark-read.json": { + "put": { + "summary": "Mark notifications as read", + "tags": [ + "Notifications" + ], + "operationId": "markNotificationsAsRead", + "parameters": [], + "responses": { + "200": { + "description": "notifications marked read", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "string" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "(optional) Leave off to mark all notifications as\nread" + } + } + } + } + } + } + } + }, + "/posts.json": { + "get": { + "summary": "List latest posts across topics", + "tags": [ + "Posts" + ], + "operationId": "listPosts", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } }, - "500": { - "description": "500 server error" + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "latest posts", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "latest_posts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "username": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "cooked": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "reply_count": { + "type": "integer" + }, + "reply_to_post_number": { + "type": [ + "string", + "null" + ] + }, + "quote_count": { + "type": "integer" + }, + "incoming_link_count": { + "type": "integer" + }, + "reads": { + "type": "integer" + }, + "readers_count": { + "type": "integer" + }, + "score": { + "type": "number" + }, + "yours": { + "type": "boolean" + }, + "topic_id": { + "type": "integer" + }, + "topic_slug": { + "type": "string" + }, + "topic_title": { + "type": "string" + }, + "topic_html_title": { + "type": "string" + }, + "category_id": { + "type": "integer" + }, + "display_username": { + "type": "string" + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_recover": { + "type": "boolean" + }, + "can_wiki": { + "type": "boolean" + }, + "user_title": { + "type": [ + "string", + "null" + ] + }, + "raw": { + "type": "string" + }, + "actions_summary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "can_act": { + "type": "boolean" + } + } + } + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "staff": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_deleted": { + "type": "boolean" + }, + "edit_reason": { + "type": [ + "string", + "null" + ] + }, + "can_view_edit_history": { + "type": "boolean" + }, + "wiki": { + "type": "boolean" + }, + "reviewable_id": { + "type": [ + "string", + "null" + ] + }, + "reviewable_score_count": { + "type": "integer" + }, + "reviewable_score_pending_count": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "summary": "Creates a new topic, a new post, or a private message", + "tags": [ + "Posts", + "Topics", + "Private Messages" + ], + "operationId": "createTopicPostPM", + "parameters": [], + "responses": { + "200": { + "description": "post created", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "username": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "raw": { + "type": "string" + }, + "cooked": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "reply_count": { + "type": "integer" + }, + "reply_to_post_number": { + "type": [ + "string", + "null" + ] + }, + "quote_count": { + "type": "integer" + }, + "incoming_link_count": { + "type": "integer" + }, + "reads": { + "type": "integer" + }, + "readers_count": { + "type": "integer" + }, + "score": { + "type": "integer" + }, + "yours": { + "type": "boolean" + }, + "topic_id": { + "type": "integer" + }, + "topic_slug": { + "type": "string" + }, + "display_username": { + "type": [ + "string", + "null" + ] + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_recover": { + "type": "boolean" + }, + "can_wiki": { + "type": "boolean" + }, + "user_title": { + "type": [ + "string", + "null" + ] + }, + "bookmarked": { + "type": "boolean" + }, + "actions_summary": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "can_act": { + "type": "boolean" + } + }, + "required": [ + "id", + "can_act" + ] + } + ] + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "staff": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "draft_sequence": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_deleted": { + "type": "boolean" + }, + "edit_reason": { + "type": [ + "string", + "null" + ] + }, + "can_view_edit_history": { + "type": "boolean" + }, + "wiki": { + "type": "boolean" + }, + "reviewable_id": { + "type": [ + "string", + "null" + ] + }, + "reviewable_score_count": { + "type": "integer" + }, + "reviewable_score_pending_count": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "username", + "avatar_template", + "created_at", + "cooked", + "post_number", + "post_type", + "updated_at", + "reply_count", + "reply_to_post_number", + "quote_count", + "incoming_link_count", + "reads", + "readers_count", + "score", + "yours", + "topic_id", + "topic_slug", + "display_username", + "primary_group_name", + "flair_name", + "flair_url", + "flair_bg_color", + "flair_color", + "version", + "can_edit", + "can_delete", + "can_recover", + "can_wiki", + "user_title", + "bookmarked", + "actions_summary", + "moderator", + "admin", + "staff", + "user_id", + "draft_sequence", + "hidden", + "trust_level", + "deleted_at", + "user_deleted", + "edit_reason", + "can_view_edit_history", + "wiki", + "reviewable_id", + "reviewable_score_count", + "reviewable_score_pending_count" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "title": { + "type": "string", + "description": "Required if creating a new topic or new private message." + }, + "raw": { + "type": "string" + }, + "topic_id": { + "type": "integer", + "description": "Required if creating a new post." + }, + "category": { + "type": "integer", + "description": "Optional if creating a new topic, and ignored if creating\na new post." + }, + "target_recipients": { + "type": "string", + "description": "Required for private message, comma separated.", + "example": "blake,sam" + }, + "target_usernames": { + "type": "string", + "description": "Deprecated. Use target_recipients instead.", + "deprecated": true + }, + "archetype": { + "type": "string", + "description": "Required for new private message.", + "example": "private_message" + }, + "created_at": { + "type": "string" + } + }, + "required": [ + "raw" + ] + } + } + } + } + } + }, + "/posts/{id}.json": { + "get": { + "summary": "Retrieve a single post", + "tags": [ + "Posts" + ], + "operationId": "getPost", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "latest posts", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "username": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "cooked": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "reply_count": { + "type": "integer" + }, + "reply_to_post_number": { + "type": [ + "string", + "null" + ] + }, + "quote_count": { + "type": "integer" + }, + "incoming_link_count": { + "type": "integer" + }, + "reads": { + "type": "integer" + }, + "readers_count": { + "type": "integer" + }, + "score": { + "type": "integer" + }, + "yours": { + "type": "boolean" + }, + "topic_id": { + "type": "integer" + }, + "topic_slug": { + "type": "string" + }, + "display_username": { + "type": [ + "string", + "null" + ] + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_recover": { + "type": "boolean" + }, + "can_wiki": { + "type": "boolean" + }, + "user_title": { + "type": [ + "string", + "null" + ] + }, + "raw": { + "type": "string" + }, + "actions_summary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "can_act": { + "type": "boolean" + } + } + } + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "staff": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_deleted": { + "type": "boolean" + }, + "edit_reason": { + "type": [ + "string", + "null" + ] + }, + "can_view_edit_history": { + "type": "boolean" + }, + "wiki": { + "type": "boolean" + }, + "reviewable_id": { + "type": [ + "string", + "null" + ] + }, + "reviewable_score_count": { + "type": "integer" + }, + "reviewable_score_pending_count": { + "type": "integer" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Update a single post", + "tags": [ + "Posts" + ], + "operationId": "updatePost", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "post updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "post": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "username": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "cooked": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "reply_count": { + "type": "integer" + }, + "reply_to_post_number": { + "type": [ + "string", + "null" + ] + }, + "quote_count": { + "type": "integer" + }, + "incoming_link_count": { + "type": "integer" + }, + "reads": { + "type": "integer" + }, + "readers_count": { + "type": "integer" + }, + "score": { + "type": "number" + }, + "yours": { + "type": "boolean" + }, + "topic_id": { + "type": "integer" + }, + "topic_slug": { + "type": "string" + }, + "display_username": { + "type": [ + "string", + "null" + ] + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_recover": { + "type": "boolean" + }, + "can_wiki": { + "type": "boolean" + }, + "user_title": { + "type": [ + "string", + "null" + ] + }, + "actions_summary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "can_act": { + "type": "boolean" + } + } + } + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "staff": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "draft_sequence": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_deleted": { + "type": "boolean" + }, + "edit_reason": { + "type": [ + "string", + "null" + ] + }, + "can_view_edit_history": { + "type": "boolean" + }, + "wiki": { + "type": "boolean" + }, + "reviewable_id": { + "type": [ + "string", + "null" + ] + }, + "reviewable_score_count": { + "type": "integer" + }, + "reviewable_score_pending_count": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "post": { + "type": "object", + "properties": { + "raw": { + "type": "string" + }, + "edit_reason": { + "type": "string" + } + }, + "required": [ + "raw" + ] + } + } + } + } + } + } + } + }, + "/posts/{id}/locked.json": { + "put": { + "summary": "Lock a post from being edited", + "tags": [ + "Posts" + ], + "operationId": "lockPost", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "post updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "locked": { + "type": "boolean" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "locked": { + "type": "boolean" + } + }, + "required": [ + "locked" + ] + } + } + } + } + } + }, + "/post_actions.json": { + "post": { + "summary": "Like a post and other actions", + "tags": [ + "Posts" + ], + "operationId": "performPostAction", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "post updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "username": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "cooked": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "reply_count": { + "type": "integer" + }, + "reply_to_post_number": { + "type": [ + "string", + "null" + ] + }, + "quote_count": { + "type": "integer" + }, + "incoming_link_count": { + "type": "integer" + }, + "reads": { + "type": "integer" + }, + "readers_count": { + "type": "integer" + }, + "score": { + "type": "number" + }, + "yours": { + "type": "boolean" + }, + "topic_id": { + "type": "integer" + }, + "topic_slug": { + "type": "string" + }, + "display_username": { + "type": "string" + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_recover": { + "type": "boolean" + }, + "can_wiki": { + "type": "boolean" + }, + "user_title": { + "type": [ + "string", + "null" + ] + }, + "actions_summary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "acted": { + "type": "boolean" + }, + "can_undo": { + "type": "boolean" + } + } + } + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "staff": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_deleted": { + "type": "boolean" + }, + "edit_reason": { + "type": [ + "string", + "null" + ] + }, + "can_view_edit_history": { + "type": "boolean" + }, + "wiki": { + "type": "boolean" + }, + "notice": { + "type": "object" + }, + "reviewable_id": { + "type": [ + "string", + "null" + ] + }, + "reviewable_score_count": { + "type": "integer" + }, + "reviewable_score_pending_count": { + "type": "integer" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "post_action_type_id": { + "type": "integer" + }, + "flag_topic": { + "type": "boolean" + } + }, + "required": [ + "id", + "post_action_type_id" + ] + } + } + } + } + } + }, + "/topics/private-messages/{username}.json": { + "get": { + "summary": "Get a list of private messages for a user", + "tags": [ + "Private Messages" + ], + "operationId": "listUserPrivateMessages", + "parameters": [ + { + "name": "username", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "private messages", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + } + } + }, + "primary_groups": { + "type": "array", + "items": {} + }, + "topic_list": { + "type": "object", + "properties": { + "can_create_topic": { + "type": "boolean" + }, + "draft": { + "type": [ + "string", + "null" + ] + }, + "draft_key": { + "type": "string" + }, + "draft_sequence": { + "type": "integer" + }, + "per_page": { + "type": "integer" + }, + "topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "highest_post_number": { + "type": "integer" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_posted_at": { + "type": "string" + }, + "bumped": { + "type": "boolean" + }, + "bumped_at": { + "type": "string" + }, + "archetype": { + "type": "string" + }, + "unseen": { + "type": "boolean" + }, + "last_read_post_number": { + "type": "integer" + }, + "unread_posts": { + "type": "integer" + }, + "pinned": { + "type": "boolean" + }, + "unpinned": { + "type": [ + "string", + "null" + ] + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "notification_level": { + "type": "integer" + }, + "bookmarked": { + "type": "boolean" + }, + "liked": { + "type": "boolean" + }, + "views": { + "type": "integer" + }, + "like_count": { + "type": "integer" + }, + "has_summary": { + "type": "boolean" + }, + "last_poster_username": { + "type": "string" + }, + "category_id": { + "type": [ + "string", + "null" + ] + }, + "pinned_globally": { + "type": "boolean" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "allowed_user_count": { + "type": "integer" + }, + "posters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "extras": { + "type": "string" + }, + "description": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + } + } + } + }, + "participants": { + "type": "array", + "items": { + "type": "object", + "properties": { + "extras": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "user_id": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/topics/private-messages-sent/{username}.json": { + "get": { + "summary": "Get a list of private messages sent for a user", + "tags": [ + "Private Messages" + ], + "operationId": "getUserSentPrivateMessages", + "parameters": [ + { + "name": "username", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "private messages", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + } + } + } + }, + "primary_groups": { + "type": "array", + "items": {} + }, + "topic_list": { + "type": "object", + "properties": { + "can_create_topic": { + "type": "boolean" + }, + "draft": { + "type": [ + "string", + "null" + ] + }, + "draft_key": { + "type": "string" + }, + "draft_sequence": { + "type": "integer" + }, + "per_page": { + "type": "integer" + }, + "topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "highest_post_number": { + "type": "integer" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_posted_at": { + "type": "string" + }, + "bumped": { + "type": "boolean" + }, + "bumped_at": { + "type": "string" + }, + "archetype": { + "type": "string" + }, + "unseen": { + "type": "boolean" + }, + "last_read_post_number": { + "type": "integer" + }, + "unread_posts": { + "type": "integer" + }, + "pinned": { + "type": "boolean" + }, + "unpinned": { + "type": [ + "string", + "null" + ] + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "notification_level": { + "type": "integer" + }, + "bookmarked": { + "type": "boolean" + }, + "liked": { + "type": "boolean" + }, + "views": { + "type": "integer" + }, + "like_count": { + "type": "integer" + }, + "has_summary": { + "type": "boolean" + }, + "last_poster_username": { + "type": "string" + }, + "category_id": { + "type": [ + "string", + "null" + ] + }, + "pinned_globally": { + "type": "boolean" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "allowed_user_count": { + "type": "integer" + }, + "posters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "extras": { + "type": "string" + }, + "description": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + } + } + } + }, + "participants": { + "type": "array", + "items": {} + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/search.json": { + "get": { + "summary": "Search for a term", + "tags": [ + "Search" + ], + "operationId": "search", + "parameters": [ + { + "name": "q", + "in": "query", + "example": "api @blake #support tags:api after:2021-06-04 in:unseen in:open\norder:latest_topic", + "description": "The query string needs to be url encoded and is made up of the following options:\n- Search term. This is just a string. Usually it would be the first item in the query.\n- `@`: Use the `@` followed by the username to specify posts by this user.\n- `#`: Use the `#` followed by the category slug to search within this category.\n- `tags:`: `api,solved` or for posts that have all the specified tags `api+solved`.\n- `before:`: `yyyy-mm-dd`\n- `after:`: `yyyy-mm-dd`\n- `order:`: `latest`, `likes`, `views`, `latest_topic`\n- `assigned:`: username (without `@`)\n- `in:`: `title`, `likes`, `personal`, `seen`, `unseen`, `posted`, `created`, `watching`, `tracking`, `bookmarks`, `assigned`, `unassigned`, `first`, `pinned`, `wiki`\n- `with:`: `images`\n- `status:`: `open`, `closed`, `public`, `archived`, `noreplies`, `single_user`, `solved`, `unsolved`\n- `min_posts:`: 1\n- `max_posts:`: 10\n- `min_views:`: 1\n- `max_views:`: 10\n\nIf you are using cURL you can use the `-G` and the `--data-urlencode` flags to encode the query:\n\n```\ncurl -i -sS -X GET -G \"http://localhost:4200/search.json\" \\\n--data-urlencode 'q=wordpress @scossar #fun after:2020-01-01'\n```\n", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "example": 1, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "posts": { + "type": "array", + "items": [] + }, + "users": { + "type": "array", + "items": [] + }, + "categories": { + "type": "array", + "items": [] + }, + "tags": { + "type": "array", + "items": [] + }, + "groups": { + "type": "array", + "items": [] + }, + "grouped_search_result": { + "type": "object", + "additionalProperties": false, + "properties": { + "more_posts": { + "type": [ + "string", + "null" + ] + }, + "more_users": { + "type": [ + "string", + "null" + ] + }, + "more_categories": { + "type": [ + "string", + "null" + ] + }, + "term": { + "type": "string" + }, + "search_log_id": { + "type": "integer" + }, + "more_full_page_results": { + "type": [ + "string", + "null" + ] + }, + "can_create_topic": { + "type": "boolean" + }, + "error": { + "type": [ + "string", + "null" + ] + }, + "post_ids": { + "type": "array", + "items": [] + }, + "user_ids": { + "type": "array", + "items": [] + }, + "category_ids": { + "type": "array", + "items": [] + }, + "tag_ids": { + "type": "array", + "items": [] + }, + "group_ids": { + "type": "array", + "items": [] + } + }, + "required": [ + "more_posts", + "more_users", + "more_categories", + "term", + "search_log_id", + "more_full_page_results", + "can_create_topic", + "error", + "post_ids", + "user_ids", + "category_ids", + "tag_ids", + "group_ids" + ] + } + }, + "required": [ + "posts", + "users", + "categories", + "tags", + "groups", + "grouped_search_result" + ] + } + } + } + } + } + } + }, + "/site.json": { + "get": { + "summary": "Get site info", + "tags": [ + "Site", + "Categories" + ], + "operationId": "getSite", + "description": "Can be used to fetch all categories and subcategories", + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "default_archetype": { + "type": "string" + }, + "notification_types": { + "type": "object", + "additionalProperties": false, + "properties": { + "mentioned": { + "type": "integer" + }, + "replied": { + "type": "integer" + }, + "quoted": { + "type": "integer" + }, + "edited": { + "type": "integer" + }, + "liked": { + "type": "integer" + }, + "private_message": { + "type": "integer" + }, + "invited_to_private_message": { + "type": "integer" + }, + "invitee_accepted": { + "type": "integer" + }, + "posted": { + "type": "integer" + }, + "moved_post": { + "type": "integer" + }, + "linked": { + "type": "integer" + }, + "granted_badge": { + "type": "integer" + }, + "invited_to_topic": { + "type": "integer" + }, + "custom": { + "type": "integer" + }, + "group_mentioned": { + "type": "integer" + }, + "group_message_summary": { + "type": "integer" + }, + "watching_first_post": { + "type": "integer" + }, + "topic_reminder": { + "type": "integer" + }, + "liked_consolidated": { + "type": "integer" + }, + "post_approved": { + "type": "integer" + }, + "code_review_commit_approved": { + "type": "integer" + }, + "membership_request_accepted": { + "type": "integer" + }, + "membership_request_consolidated": { + "type": "integer" + }, + "bookmark_reminder": { + "type": "integer" + }, + "reaction": { + "type": "integer" + }, + "votes_released": { + "type": "integer" + }, + "event_reminder": { + "type": "integer" + }, + "event_invitation": { + "type": "integer" + }, + "chat_mention": { + "type": "integer" + }, + "chat_message": { + "type": "integer" + } + }, + "required": [ + "mentioned", + "replied", + "quoted", + "edited", + "liked", + "private_message", + "invited_to_private_message", + "invitee_accepted", + "posted", + "moved_post", + "linked", + "granted_badge", + "invited_to_topic", + "custom", + "group_mentioned", + "group_message_summary", + "watching_first_post", + "topic_reminder", + "liked_consolidated", + "post_approved", + "code_review_commit_approved", + "membership_request_accepted", + "membership_request_consolidated", + "bookmark_reminder", + "reaction", + "votes_released", + "event_reminder", + "event_invitation", + "chat_mention" + ] + }, + "post_types": { + "type": "object", + "additionalProperties": false, + "properties": { + "regular": { + "type": "integer" + }, + "moderator_action": { + "type": "integer" + }, + "small_action": { + "type": "integer" + }, + "whisper": { + "type": "integer" + } + }, + "required": [ + "regular", + "moderator_action", + "small_action", + "whisper" + ] + }, + "trust_levels": { + "type": "object", + "additionalProperties": false, + "properties": { + "newuser": { + "type": "integer" + }, + "basic": { + "type": "integer" + }, + "member": { + "type": "integer" + }, + "regular": { + "type": "integer" + }, + "leader": { + "type": "integer" + } + }, + "required": [ + "newuser", + "basic", + "member", + "regular", + "leader" + ] + }, + "groups": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "name", + "flair_url", + "flair_bg_color", + "flair_color" + ] + } + ] + }, + "filters": { + "type": "array", + "items": [] + }, + "periods": { + "type": "array", + "items": [] + }, + "top_menu_items": { + "type": "array", + "items": [] + }, + "anonymous_top_menu_items": { + "type": "array", + "items": [] + }, + "uncategorized_category_id": { + "type": "integer" + }, + "user_field_max_length": { + "type": "integer" + }, + "post_action_types": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name_key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "short_description": { + "type": "string" + }, + "is_flag": { + "type": "boolean" + }, + "is_custom_flag": { + "type": "boolean" + } + }, + "required": [ + "id", + "name_key", + "name", + "description", + "short_description", + "is_flag", + "is_custom_flag" + ] + } + ] + }, + "topic_flag_types": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name_key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "short_description": { + "type": "string" + }, + "is_flag": { + "type": "boolean" + }, + "is_custom_flag": { + "type": "boolean" + } + }, + "required": [ + "id", + "name_key", + "name", + "description", + "short_description", + "is_flag", + "is_custom_flag" + ] + } + ] + }, + "can_create_tag": { + "type": "boolean" + }, + "can_tag_topics": { + "type": "boolean" + }, + "can_tag_pms": { + "type": "boolean" + }, + "tags_filter_regexp": { + "type": "string" + }, + "top_tags": { + "type": "array", + "items": [] + }, + "wizard_required": { + "type": "boolean" + }, + "topic_featured_link_allowed_category_ids": { + "type": "array", + "items": [] + }, + "user_themes": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "theme_id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "default": { + "type": "boolean" + }, + "color_scheme_id": { + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "theme_id", + "name", + "default", + "color_scheme_id" + ] + } + ] + }, + "user_color_schemes": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "is_dark": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "is_dark" + ] + } + ] + }, + "default_dark_color_scheme": { + "type": [ + "object", + "null" + ] + }, + "censored_regexp": { + "type": [ + "string", + "null" + ] + }, + "custom_emoji_translation": { + "type": "object", + "additionalProperties": false, + "properties": {}, + "required": [] + }, + "watched_words_replace": { + "type": [ + "string", + "null" + ] + }, + "watched_words_link": { + "type": [ + "string", + "null" + ] + }, + "categories": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "color": { + "type": "string" + }, + "text_color": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "topic_count": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "description_text": { + "type": "string" + }, + "description_excerpt": { + "type": "string" + }, + "topic_url": { + "type": "string" + }, + "read_restricted": { + "type": "boolean" + }, + "permission": { + "type": "integer" + }, + "notification_level": { + "type": "integer" + }, + "topic_template": { + "type": [ + "string", + "null" + ] + }, + "has_children": { + "type": "boolean" + }, + "sort_order": { + "type": [ + "string", + "null" + ] + }, + "sort_ascending": { + "type": [ + "string", + "null" + ] + }, + "show_subcategory_list": { + "type": "boolean" + }, + "num_featured_topics": { + "type": "integer" + }, + "default_view": { + "type": [ + "string", + "null" + ] + }, + "subcategory_list_style": { + "type": "string" + }, + "default_top_period": { + "type": "string" + }, + "default_list_filter": { + "type": "string" + }, + "minimum_required_tags": { + "type": "integer" + }, + "navigate_to_first_post_after_read": { + "type": "boolean" + }, + "allowed_tags": { + "type": "array", + "items": [] + }, + "allowed_tag_groups": { + "type": "array", + "items": [] + }, + "allow_global_tags": { + "type": "boolean" + }, + "min_tags_from_required_group": { + "type": "integer" + }, + "required_tag_group_name": { + "type": [ + "string", + "null" + ] + }, + "read_only_banner": { + "type": [ + "string", + "null" + ] + }, + "uploaded_logo": { + "type": [ + "string", + "null" + ] + }, + "uploaded_background": { + "type": [ + "string", + "null" + ] + }, + "can_edit": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "color", + "text_color", + "slug", + "topic_count", + "post_count", + "position", + "description", + "description_text", + "description_excerpt", + "topic_url", + "read_restricted", + "permission", + "notification_level", + "topic_template", + "has_children", + "sort_order", + "sort_ascending", + "show_subcategory_list", + "num_featured_topics", + "default_view", + "subcategory_list_style", + "default_top_period", + "default_list_filter", + "minimum_required_tags", + "navigate_to_first_post_after_read", + "allowed_tags", + "allowed_tag_groups", + "allow_global_tags", + "min_tags_from_required_group", + "required_tag_group_name", + "read_only_banner", + "uploaded_logo", + "uploaded_background", + "can_edit" + ] + } + ] + }, + "archetypes": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "type": "array", + "items": [] + } + }, + "required": [ + "id", + "name", + "options" + ] + } + ] + }, + "user_fields": { + "type": "array", + "items": [] + }, + "auth_providers": { + "type": "array", + "items": [] + } + }, + "required": [ + "default_archetype", + "notification_types", + "post_types", + "trust_levels", + "groups", + "filters", + "periods", + "top_menu_items", + "anonymous_top_menu_items", + "uncategorized_category_id", + "user_field_max_length", + "post_action_types", + "topic_flag_types", + "can_create_tag", + "can_tag_topics", + "can_tag_pms", + "tags_filter_regexp", + "top_tags", + "topic_featured_link_allowed_category_ids", + "user_themes", + "user_color_schemes", + "default_dark_color_scheme", + "censored_regexp", + "custom_emoji_translation", + "watched_words_replace", + "watched_words_link", + "categories", + "archetypes", + "user_fields", + "auth_providers" + ] + } + } + } + } + } + } + }, + "/tag_groups.json": { + "get": { + "summary": "Get a list of tag groups", + "tags": [ + "Tags" + ], + "operationId": "listTagGroups", + "responses": { + "200": { + "description": "tags", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tag_groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tag_names": { + "type": "array", + "items": {} + }, + "parent_tag_name": { + "type": "array", + "items": {} + }, + "one_per_topic": { + "type": "boolean" + }, + "permissions": { + "type": "object", + "properties": { + "staff": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "post": { + "summary": "Creates a tag group", + "tags": [ + "Tags" + ], + "operationId": "createTagGroup", + "parameters": [], + "responses": { + "200": { + "description": "tag group created", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "tag_group": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tag_names": { + "type": "array", + "items": [] + }, + "parent_tag_name": { + "type": "array", + "items": [] + }, + "one_per_topic": { + "type": "boolean" + }, + "permissions": { + "type": "object" + } + }, + "required": [ + "id", + "name", + "tag_names", + "parent_tag_name", + "one_per_topic", + "permissions" + ] + } + }, + "required": [ + "tag_group" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "/tag_groups/{id}.json": { + "get": { + "summary": "Get a single tag group", + "tags": [ + "Tags" + ], + "operationId": "getTagGroup", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "notifications", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tag_group": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tag_names": { + "type": "array", + "items": {} + }, + "parent_tag_name": { + "type": "array", + "items": {} + }, + "one_per_topic": { + "type": "boolean" + }, + "permissions": { + "type": "object", + "properties": { + "everyone": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } + } + }, + "put": { + "summary": "Update tag group", + "tags": [ + "Tags" + ], + "operationId": "updateTagGroup", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "Tag group updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "string" + }, + "tag_group": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "tag_names": { + "type": "array", + "items": {} + }, + "parent_tag_name": { + "type": "array", + "items": {} + }, + "one_per_topic": { + "type": "boolean" + }, + "permissions": { + "type": "object", + "properties": { + "everyone": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + } + } + }, + "/tags.json": { + "get": { + "summary": "Get a list of tags", + "tags": [ + "Tags" + ], + "operationId": "listTags", + "responses": { + "200": { + "description": "notifications", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "count": { + "type": "integer" + }, + "pm_count": { + "type": "integer" + }, + "target_tag": { + "type": [ + "string", + "null" + ] + } + } + } + }, + "extras": { + "type": "object", + "properties": { + "categories": { + "type": "array", + "items": {} + } + } + } + } + } + } + } + } + } + } + }, + "/tag/{name}.json": { + "get": { + "summary": "Get a specific tag", + "tags": [ + "Tags" + ], + "operationId": "getTag", + "parameters": [ + { + "name": "name", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "notifications", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + } + } + } + }, + "primary_groups": { + "type": "array", + "items": {} + }, + "topic_list": { + "type": "object", + "properties": { + "can_create_topic": { + "type": "boolean" + }, + "draft": { + "type": [ + "string", + "null" + ] + }, + "draft_key": { + "type": "string" + }, + "draft_sequence": { + "type": "integer" + }, + "per_page": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "topic_count": { + "type": "integer" + }, + "staff": { + "type": "boolean" + } + } + } + }, + "topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "highest_post_number": { + "type": "integer" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_posted_at": { + "type": "string" + }, + "bumped": { + "type": "boolean" + }, + "bumped_at": { + "type": "string" + }, + "archetype": { + "type": "string" + }, + "unseen": { + "type": "boolean" + }, + "last_read_post_number": { + "type": "integer" + }, + "unread_posts": { + "type": "integer" + }, + "pinned": { + "type": "boolean" + }, + "unpinned": { + "type": [ + "string", + "null" + ] + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "notification_level": { + "type": "integer" + }, + "bookmarked": { + "type": "boolean" + }, + "liked": { + "type": "boolean" + }, + "tags": { + "type": "array", + "items": {} + }, + "views": { + "type": "integer" + }, + "like_count": { + "type": "integer" + }, + "has_summary": { + "type": "boolean" + }, + "last_poster_username": { + "type": "string" + }, + "category_id": { + "type": "integer" + }, + "pinned_globally": { + "type": "boolean" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "posters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "extras": { + "type": "string" + }, + "description": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/t/{id}/posts.json": { + "get": { + "summary": "Get specific posts from a topic", + "tags": [ + "Topics" + ], + "operationId": "getSpecificPostsFromTopic", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "specific posts", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "post_stream": { + "type": "object", + "properties": { + "posts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "username": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "cooked": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "reply_count": { + "type": "integer" + }, + "reply_to_post_number": { + "type": [ + "string", + "null" + ] + }, + "quote_count": { + "type": "integer" + }, + "incoming_link_count": { + "type": "integer" + }, + "reads": { + "type": "integer" + }, + "readers_count": { + "type": "integer" + }, + "score": { + "type": "integer" + }, + "yours": { + "type": "boolean" + }, + "topic_id": { + "type": "integer" + }, + "topic_slug": { + "type": "string" + }, + "display_username": { + "type": [ + "string", + "null" + ] + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_recover": { + "type": "boolean" + }, + "can_wiki": { + "type": "boolean" + }, + "read": { + "type": "boolean" + }, + "user_title": { + "type": [ + "string", + "null" + ] + }, + "actions_summary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "can_act": { + "type": "boolean" + } + } + } + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "staff": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_deleted": { + "type": "boolean" + }, + "edit_reason": { + "type": [ + "string", + "null" + ] + }, + "can_view_edit_history": { + "type": "boolean" + }, + "wiki": { + "type": "boolean" + }, + "reviewable_id": { + "type": "integer" + }, + "reviewable_score_count": { + "type": "integer" + }, + "reviewable_score_pending_count": { + "type": "integer" + } + } + } + } + } + }, + "id": { + "type": "integer" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "post_ids[]": { + "type": "integer" + } + }, + "required": [ + "post_ids[]" + ] + } + } + } + } + } + }, + "/t/{id}.json": { + "get": { + "summary": "Get a single topic", + "tags": [ + "Topics" + ], + "operationId": "getTopic", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "specific posts", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "post_stream": { + "type": "object", + "properties": { + "posts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "username": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "cooked": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_type": { + "type": "integer" + }, + "updated_at": { + "type": "string" + }, + "reply_count": { + "type": "integer" + }, + "reply_to_post_number": { + "type": [ + "string", + "null" + ] + }, + "quote_count": { + "type": "integer" + }, + "incoming_link_count": { + "type": "integer" + }, + "reads": { + "type": "integer" + }, + "readers_count": { + "type": "integer" + }, + "score": { + "type": "number" + }, + "yours": { + "type": "boolean" + }, + "topic_id": { + "type": "integer" + }, + "topic_slug": { + "type": "string" + }, + "display_username": { + "type": "string" + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "integer" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_recover": { + "type": "boolean" + }, + "can_wiki": { + "type": "boolean" + }, + "link_counts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "internal": { + "type": "boolean" + }, + "reflection": { + "type": "boolean" + }, + "clicks": { + "type": "integer" + } + } + } + }, + "read": { + "type": "boolean" + }, + "user_title": { + "type": [ + "string", + "null" + ] + }, + "actions_summary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "can_act": { + "type": "boolean" + } + } + } + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "staff": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_deleted": { + "type": "boolean" + }, + "edit_reason": { + "type": [ + "string", + "null" + ] + }, + "can_view_edit_history": { + "type": "boolean" + }, + "wiki": { + "type": "boolean" + }, + "reviewable_id": { + "type": "integer" + }, + "reviewable_score_count": { + "type": "integer" + }, + "reviewable_score_pending_count": { + "type": "integer" + } + } + } + }, + "stream": { + "type": "array", + "items": {} + } + } + }, + "timeline_lookup": { + "type": "array", + "items": {} + }, + "suggested_topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "highest_post_number": { + "type": "integer" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_posted_at": { + "type": [ + "string", + "null" + ] + }, + "bumped": { + "type": "boolean" + }, + "bumped_at": { + "type": "string" + }, + "archetype": { + "type": "string" + }, + "unseen": { + "type": "boolean" + }, + "last_read_post_number": { + "type": "integer" + }, + "unread_posts": { + "type": "integer" + }, + "pinned": { + "type": "boolean" + }, + "unpinned": { + "type": "boolean" + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "notification_level": { + "type": "integer" + }, + "bookmarked": { + "type": "boolean" + }, + "liked": { + "type": "boolean" + }, + "like_count": { + "type": "integer" + }, + "views": { + "type": "integer" + }, + "category_id": { + "type": "integer" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "posters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "extras": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": "string" + }, + "user": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "views": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "like_count": { + "type": "integer" + }, + "last_posted_at": { + "type": [ + "string", + "null" + ] + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "has_summary": { + "type": "boolean" + }, + "archetype": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "category_id": { + "type": "integer" + }, + "word_count": { + "type": [ + "integer", + "null" + ] + }, + "deleted_at": { + "type": [ + "string", + "null" + ] + }, + "user_id": { + "type": "integer" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "pinned_globally": { + "type": "boolean" + }, + "pinned_at": { + "type": [ + "string", + "null" + ] + }, + "pinned_until": { + "type": [ + "string", + "null" + ] + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "draft": { + "type": [ + "string", + "null" + ] + }, + "draft_key": { + "type": "string" + }, + "draft_sequence": { + "type": "integer" + }, + "unpinned": { + "type": [ + "string", + "null" + ] + }, + "pinned": { + "type": "boolean" + }, + "current_post_number": { + "type": "integer" + }, + "highest_post_number": { + "type": [ + "integer", + "null" + ] + }, + "deleted_by": { + "type": [ + "string", + "null" + ] + }, + "has_deleted": { + "type": "boolean" + }, + "actions_summary": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + }, + "can_act": { + "type": "boolean" + } + } + } + }, + "chunk_size": { + "type": "integer" + }, + "bookmarked": { + "type": "boolean" + }, + "topic_timer": { + "type": [ + "string", + "null" + ] + }, + "message_bus_last_id": { + "type": "integer" + }, + "participant_count": { + "type": "integer" + }, + "show_read_indicator": { + "type": "boolean" + }, + "thumbnails": { + "type": [ + "string", + "null" + ] + }, + "details": { + "type": "object", + "properties": { + "notification_level": { + "type": "integer" + }, + "can_move_posts": { + "type": "boolean" + }, + "can_edit": { + "type": "boolean" + }, + "can_delete": { + "type": "boolean" + }, + "can_remove_allowed_users": { + "type": "boolean" + }, + "can_create_post": { + "type": "boolean" + }, + "can_reply_as_new_topic": { + "type": "boolean" + }, + "can_flag_topic": { + "type": "boolean" + }, + "can_convert_topic": { + "type": "boolean" + }, + "can_review_topic": { + "type": "boolean" + }, + "can_remove_self_id": { + "type": "integer" + }, + "participants": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "post_count": { + "type": "integer" + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + } + } + } + }, + "created_by": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + } + }, + "last_poster": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Remove a topic", + "tags": [ + "Topics" + ], + "operationId": "removeTopic", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "specific posts" + } + } + } + }, + "/t/-/{id}.json": { + "put": { + "summary": "Update a topic", + "tags": [ + "Topics" + ], + "operationId": "updateTopic", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "topic updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "basic_topic": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "topic": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "category_id": { + "type": "integer" + } + } + } + } + } + } + } + } + } + }, + "/t/{id}/invite.json": { + "post": { + "summary": "Invite to topic", + "tags": [ + "Topics", + "Invites" + ], + "operationId": "inviteToTopic", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "topic updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "user": { + "type": "string" + }, + "email": { + "type": "string" + } + } + } + } + } + } + } + }, + "/t/{id}/bookmark.json": { + "put": { + "summary": "Bookmark topic", + "tags": [ + "Topics" + ], + "operationId": "bookmarkTopic", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "topic updated" + } + } + } + }, + "/t/{id}/status.json": { + "put": { + "summary": "Update the status of a topic", + "tags": [ + "Topics" + ], + "operationId": "updateTopicStatus", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "topic updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "string", + "example": "OK" + }, + "topic_status_update": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "closed", + "pinned", + "pinned_globally", + "archived", + "visible" + ] + }, + "enabled": { + "type": "string", + "enum": [ + "true", + "false" + ] + }, + "until": { + "type": "string", + "description": "Only required for `pinned` and `pinned_globally`", + "example": "2030-12-31" + } + }, + "required": [ + "status", + "enabled" + ] + } + } + } + } + } + }, + "/latest.json": { + "get": { + "summary": "Get the latest topics", + "tags": [ + "Topics" + ], + "operationId": "listLatestTopics", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "order", + "in": "query", + "description": "Enum: `default`, `created`, `activity`, `views`, `posts`, `category`,\n`likes`, `op_likes`, `posters`", + "schema": { + "type": "string" + } + }, + { + "name": "ascending", + "in": "query", + "description": "Defaults to `desc`, add `ascending=true` to sort asc", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "topic updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + } + } + } + }, + "primary_groups": { + "type": "array", + "items": {} + }, + "topic_list": { + "type": "object", + "properties": { + "can_create_topic": { + "type": "boolean" + }, + "draft": { + "type": [ + "string", + "null" + ] + }, + "draft_key": { + "type": "string" + }, + "draft_sequence": { + "type": "integer" + }, + "per_page": { + "type": "integer" + }, + "topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "highest_post_number": { + "type": "integer" + }, + "image_url": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "last_posted_at": { + "type": "string" + }, + "bumped": { + "type": "boolean" + }, + "bumped_at": { + "type": "string" + }, + "archetype": { + "type": "string" + }, + "unseen": { + "type": "boolean" + }, + "last_read_post_number": { + "type": "integer" + }, + "unread_posts": { + "type": "integer" + }, + "pinned": { + "type": "boolean" + }, + "unpinned": { + "type": [ + "string", + "null" + ] + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "notification_level": { + "type": "integer" + }, + "bookmarked": { + "type": "boolean" + }, + "liked": { + "type": "boolean" + }, + "views": { + "type": "integer" + }, + "like_count": { + "type": "integer" + }, + "has_summary": { + "type": "boolean" + }, + "last_poster_username": { + "type": "string" + }, + "category_id": { + "type": "integer" + }, + "op_like_count": { + "type": "integer" + }, + "pinned_globally": { + "type": "boolean" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "posters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "extras": { + "type": "string" + }, + "description": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/top.json": { + "get": { + "summary": "Get the top topics filtered by period", + "tags": [ + "Topics" + ], + "operationId": "listTopTopics", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "period", + "in": "query", + "description": "Enum: `all`, `yearly`, `quarterly`, `monthly`, `weekly`, `daily`", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + } + } + }, + "primary_groups": { + "type": "array", + "items": {} + }, + "topic_list": { + "type": "object", + "properties": { + "can_create_topic": { + "type": "boolean" + }, + "draft": { + "type": [ + "string", + "null" + ] + }, + "draft_key": { + "type": "string" + }, + "draft_sequence": { + "type": "integer" + }, + "for_period": { + "type": "string" + }, + "per_page": { + "type": "integer" + }, + "topics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "fancy_title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "posts_count": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "highest_post_number": { + "type": "integer" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_posted_at": { + "type": "string" + }, + "bumped": { + "type": "boolean" + }, + "bumped_at": { + "type": "string" + }, + "archetype": { + "type": "string" + }, + "unseen": { + "type": "boolean" + }, + "last_read_post_number": { + "type": "integer" + }, + "unread_posts": { + "type": "integer" + }, + "pinned": { + "type": "boolean" + }, + "unpinned": { + "type": "boolean" + }, + "visible": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "notification_level": { + "type": "integer" + }, + "bookmarked": { + "type": "boolean" + }, + "liked": { + "type": "boolean" + }, + "views": { + "type": "integer" + }, + "like_count": { + "type": "integer" + }, + "has_summary": { + "type": "boolean" + }, + "last_poster_username": { + "type": "string" + }, + "category_id": { + "type": "integer" + }, + "op_like_count": { + "type": "integer" + }, + "pinned_globally": { + "type": "boolean" + }, + "featured_link": { + "type": [ + "string", + "null" + ] + }, + "posters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "extras": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/t/{id}/notifications.json": { + "post": { + "summary": "Set notification level", + "tags": [ + "Topics" + ], + "operationId": "setNotificationLevel", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "topic updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "string", + "example": "OK" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "notification_level": { + "type": "string", + "enum": [ + "0", + "1", + "2", + "3" + ] + } + }, + "required": [ + "notification_level" + ] + } + } + } + } + } + }, + "/t/{id}/change-timestamp.json": { + "put": { + "summary": "Update topic timestamp", + "tags": [ + "Topics" + ], + "operationId": "updateTopicTimestamp", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "topic updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "string", + "example": "OK" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "example": "1594291380" + } + }, + "required": [ + "timestamp" + ] + } + } + } + } + } + }, + "/t/{id}/timer.json": { + "post": { + "summary": "Create topic timer", + "tags": [ + "Topics" + ], + "operationId": "createTopicTimer", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "topic updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "string", + "example": "OK" + }, + "execute_at": { + "type": "string" + }, + "duration": { + "type": [ + "string", + "null" + ] + }, + "based_on_last_post": { + "type": "boolean" + }, + "closed": { + "type": "boolean" + }, + "category_id": { + "type": [ + "string", + "null" + ] + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "string", + "example": "" + }, + "status_type": { + "type": "string" + }, + "based_on_last_post": { + "type": "boolean" + }, + "category_id": { + "type": "integer" + } + } + } + } + } + } + } + }, + "/uploads.json": { + "post": { + "summary": "Creates an upload", + "tags": [ + "Uploads" + ], + "operationId": "createUpload", + "parameters": [], + "responses": { + "200": { + "description": "file uploaded", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "original_filename": { + "type": "string" + }, + "filesize": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "thumbnail_width": { + "type": "integer" + }, + "thumbnail_height": { + "type": "integer" + }, + "extension": { + "type": "string" + }, + "short_url": { + "type": "string" + }, + "short_path": { + "type": "string" + }, + "retain_hours": { + "type": [ + "string", + "null" + ] + }, + "human_filesize": { + "type": "string" + } + }, + "required": [ + "id", + "url", + "original_filename", + "filesize", + "width", + "height", + "thumbnail_width", + "thumbnail_height", + "extension", + "short_url", + "short_path", + "retain_hours", + "human_filesize" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "avatar", + "profile_background", + "card_background", + "custom_emoji", + "composer" + ] + }, + "user_id": { + "type": "integer", + "description": "required if uploading an avatar" + }, + "synchronous": { + "type": "boolean", + "description": "Use this flag to return an id and url" + }, + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "type" + ] + } + } + } + } + } + }, + "/user-badges/{username}.json": { + "get": { + "summary": "List badges for a user", + "tags": [ + "Badges", + "Users" + ], + "operationId": "listUserBadges", + "parameters": [ + { + "name": "username", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "badges": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "grant_count": { + "type": "integer" + }, + "allow_title": { + "type": "boolean" + }, + "multiple_grant": { + "type": "boolean" + }, + "icon": { + "type": "string" + }, + "image_url": { + "type": [ + "string", + "null" + ] + }, + "listable": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "badge_grouping_id": { + "type": "integer" + }, + "system": { + "type": "boolean" + }, + "slug": { + "type": "string" + }, + "manually_grantable": { + "type": "boolean" + }, + "badge_type_id": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "description", + "grant_count", + "allow_title", + "multiple_grant", + "icon", + "image_url", + "listable", + "enabled", + "badge_grouping_id", + "system", + "slug", + "manually_grantable", + "badge_type_id" + ] + } + ] + }, + "badge_types": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "sort_order": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "sort_order" + ] + } + ] + }, + "granted_bies": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "admin": { + "type": "boolean" + }, + "moderator": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "flair_name", + "admin", + "moderator", + "trust_level" + ] + } + ] + }, + "user_badges": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "granted_at": { + "type": "string" + }, + "grouping_position": { + "type": "integer" + }, + "is_favorite": { + "type": [ + "string", + "null" + ] + }, + "can_favorite": { + "type": "boolean" + }, + "badge_id": { + "type": "integer" + }, + "granted_by_id": { + "type": "integer" + } + }, + "required": [ + "id", + "granted_at", + "grouping_position", + "is_favorite", + "can_favorite", + "badge_id", + "granted_by_id" + ] + } + ] + } + }, + "required": [ + "user_badges" + ] + } + } + } + } + } + } + }, + "/users.json": { + "post": { + "summary": "Creates a user", + "tags": [ + "Users" + ], + "operationId": "createUser", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "user created", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "boolean" + }, + "active": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "user_id": { + "type": "integer" + } + }, + "required": [ + "success", + "active", + "message" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "approved": { + "type": "boolean" + }, + "user_fields[1]": { + "type": "boolean" + } + }, + "required": [ + "name", + "email", + "password", + "username" + ] + } + } + } + } + } + }, + "/u/{username}.json": { + "get": { + "summary": "Get a single user by username", + "tags": [ + "Users" + ], + "operationId": "getUser", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "user response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "user_badges": { + "type": "array", + "items": [] + }, + "user": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "last_posted_at": { + "type": [ + "string", + "null" + ] + }, + "last_seen_at": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "ignored": { + "type": "boolean" + }, + "muted": { + "type": "boolean" + }, + "can_ignore_user": { + "type": "boolean" + }, + "can_mute_user": { + "type": "boolean" + }, + "can_send_private_messages": { + "type": "boolean" + }, + "can_send_private_message_to_user": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "badge_count": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "secondary_emails": { + "type": "array" + }, + "unconfirmed_emails": { + "type": "array" + }, + "associated_accounts": { + "type": "array" + }, + "second_factor_backup_enabled": { + "type": "boolean" + }, + "user_fields": { + "type": "object", + "additionalProperties": false, + "properties": { + "1": { + "type": [ + "string", + "null" + ] + }, + "2": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "1", + "2" + ] + }, + "custom_fields": { + "type": "object", + "additionalProperties": false, + "properties": { + "first_name": { + "type": [ + "string", + "null" + ] + } + }, + "required": [] + }, + "time_read": { + "type": "integer" + }, + "recent_time_read": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_group_id": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "featured_topic": { + "type": [ + "string", + "null" + ] + }, + "staged": { + "type": "boolean" + }, + "can_edit": { + "type": "boolean" + }, + "can_edit_username": { + "type": "boolean" + }, + "can_edit_email": { + "type": "boolean" + }, + "can_edit_name": { + "type": "boolean" + }, + "uploaded_avatar_id": { + "type": [ + "string", + "null" + ] + }, + "has_title_badges": { + "type": "boolean" + }, + "pending_count": { + "type": "integer" + }, + "profile_view_count": { + "type": "integer" + }, + "second_factor_enabled": { + "type": "boolean" + }, + "can_upload_profile_header": { + "type": "boolean" + }, + "can_upload_user_card_background": { + "type": "boolean" + }, + "post_count": { + "type": "integer" + }, + "can_be_deleted": { + "type": "boolean" + }, + "can_delete_all_posts": { + "type": "boolean" + }, + "locale": { + "type": [ + "string", + "null" + ] + }, + "muted_category_ids": { + "type": "array", + "items": [] + }, + "regular_category_ids": { + "type": "array", + "items": [] + }, + "watched_tags": { + "type": "array", + "items": [] + }, + "watching_first_post_tags": { + "type": "array", + "items": [] + }, + "tracked_tags": { + "type": "array", + "items": [] + }, + "muted_tags": { + "type": "array", + "items": [] + }, + "tracked_category_ids": { + "type": "array", + "items": [] + }, + "watched_category_ids": { + "type": "array", + "items": [] + }, + "watched_first_post_category_ids": { + "type": "array", + "items": [] + }, + "system_avatar_upload_id": { + "type": [ + "string", + "null" + ] + }, + "system_avatar_template": { + "type": "string" + }, + "muted_usernames": { + "type": "array", + "items": [] + }, + "ignored_usernames": { + "type": "array", + "items": [] + }, + "allowed_pm_usernames": { + "type": "array", + "items": [] + }, + "mailing_list_posts_per_day": { + "type": "integer" + }, + "can_change_bio": { + "type": "boolean" + }, + "can_change_location": { + "type": "boolean" + }, + "can_change_website": { + "type": "boolean" + }, + "can_change_tracking_preferences": { + "type": "boolean" + }, + "user_api_keys": { + "type": [ + "string", + "null" + ] + }, + "user_auth_tokens": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "client_ip": { + "type": "string" + }, + "location": { + "type": "string" + }, + "browser": { + "type": "string" + }, + "device": { + "type": "string" + }, + "os": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "seen_at": { + "type": "string" + }, + "is_active": { + "type": "boolean" + } + }, + "required": [ + "id", + "client_ip", + "location", + "browser", + "device", + "os", + "icon", + "created_at", + "seen_at", + "is_active" + ] + } + ] + }, + "user_notification_schedule": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "day_0_start_time": { + "type": "integer" + }, + "day_0_end_time": { + "type": "integer" + }, + "day_1_start_time": { + "type": "integer" + }, + "day_1_end_time": { + "type": "integer" + }, + "day_2_start_time": { + "type": "integer" + }, + "day_2_end_time": { + "type": "integer" + }, + "day_3_start_time": { + "type": "integer" + }, + "day_3_end_time": { + "type": "integer" + }, + "day_4_start_time": { + "type": "integer" + }, + "day_4_end_time": { + "type": "integer" + }, + "day_5_start_time": { + "type": "integer" + }, + "day_5_end_time": { + "type": "integer" + }, + "day_6_start_time": { + "type": "integer" + }, + "day_6_end_time": { + "type": "integer" + } + }, + "required": [ + "enabled", + "day_0_start_time", + "day_0_end_time", + "day_1_start_time", + "day_1_end_time", + "day_2_start_time", + "day_2_end_time", + "day_3_start_time", + "day_3_end_time", + "day_4_start_time", + "day_4_end_time", + "day_5_start_time", + "day_5_end_time", + "day_6_start_time", + "day_6_end_time" + ] + }, + "use_logo_small_as_avatar": { + "type": "boolean" + }, + "featured_user_badge_ids": { + "type": "array", + "items": [] + }, + "invited_by": { + "type": [ + "string", + "null" + ] + }, + "groups": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "automatic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "user_count": { + "type": "integer" + }, + "mentionable_level": { + "type": "integer" + }, + "messageable_level": { + "type": "integer" + }, + "visibility_level": { + "type": "integer" + }, + "primary_group": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "grant_trust_level": { + "type": [ + "string", + "null" + ] + }, + "incoming_email": { + "type": [ + "string", + "null" + ] + }, + "has_messages": { + "type": "boolean" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "bio_raw": { + "type": [ + "string", + "null" + ] + }, + "bio_cooked": { + "type": [ + "string", + "null" + ] + }, + "bio_excerpt": { + "type": [ + "string", + "null" + ] + }, + "public_admission": { + "type": "boolean" + }, + "public_exit": { + "type": "boolean" + }, + "allow_membership_requests": { + "type": "boolean" + }, + "full_name": { + "type": [ + "string", + "null" + ] + }, + "default_notification_level": { + "type": "integer" + }, + "membership_request_template": { + "type": [ + "string", + "null" + ] + }, + "members_visibility_level": { + "type": "integer" + }, + "can_see_members": { + "type": "boolean" + }, + "can_admin_group": { + "type": "boolean" + }, + "publish_read_state": { + "type": "boolean" + } + }, + "required": [ + "id", + "automatic", + "name", + "display_name", + "user_count", + "mentionable_level", + "messageable_level", + "visibility_level", + "primary_group", + "title", + "grant_trust_level", + "incoming_email", + "has_messages", + "flair_url", + "flair_bg_color", + "flair_color", + "bio_raw", + "bio_cooked", + "bio_excerpt", + "public_admission", + "public_exit", + "allow_membership_requests", + "full_name", + "default_notification_level", + "membership_request_template", + "members_visibility_level", + "can_see_members", + "can_admin_group", + "publish_read_state" + ] + } + ] + }, + "group_users": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "group_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "notification_level": { + "type": "integer" + }, + "owner": { + "type": "boolean" + } + }, + "required": [ + "group_id", + "user_id", + "notification_level" + ] + } + ] + }, + "user_option": { + "type": "object", + "additionalProperties": false, + "properties": { + "user_id": { + "type": "integer" + }, + "mailing_list_mode": { + "type": "boolean" + }, + "mailing_list_mode_frequency": { + "type": "integer" + }, + "email_digests": { + "type": "boolean" + }, + "email_level": { + "type": "integer" + }, + "email_messages_level": { + "type": "integer" + }, + "external_links_in_new_tab": { + "type": "boolean" + }, + "color_scheme_id": { + "type": [ + "string", + "null" + ] + }, + "dark_scheme_id": { + "type": [ + "string", + "null" + ] + }, + "dynamic_favicon": { + "type": "boolean" + }, + "enable_quoting": { + "type": "boolean" + }, + "enable_defer": { + "type": "boolean" + }, + "digest_after_minutes": { + "type": "integer" + }, + "automatically_unpin_topics": { + "type": "boolean" + }, + "auto_track_topics_after_msecs": { + "type": "integer" + }, + "notification_level_when_replying": { + "type": "integer" + }, + "new_topic_duration_minutes": { + "type": "integer" + }, + "email_previous_replies": { + "type": "integer" + }, + "email_in_reply_to": { + "type": "boolean" + }, + "like_notification_frequency": { + "type": "integer" + }, + "include_tl0_in_digests": { + "type": "boolean" + }, + "theme_ids": { + "type": "array", + "items": [] + }, + "theme_key_seq": { + "type": "integer" + }, + "allow_private_messages": { + "type": "boolean" + }, + "enable_allowed_pm_users": { + "type": "boolean" + }, + "homepage_id": { + "type": [ + "string", + "null" + ] + }, + "hide_profile_and_presence": { + "type": "boolean" + }, + "text_size": { + "type": "string" + }, + "text_size_seq": { + "type": "integer" + }, + "title_count_mode": { + "type": "string" + }, + "timezone": { + "type": [ + "string", + "null" + ] + }, + "skip_new_user_tips": { + "type": "boolean" + } + }, + "required": [ + "user_id", + "mailing_list_mode", + "mailing_list_mode_frequency", + "email_digests", + "email_level", + "email_messages_level", + "external_links_in_new_tab", + "color_scheme_id", + "dark_scheme_id", + "dynamic_favicon", + "enable_quoting", + "enable_defer", + "digest_after_minutes", + "automatically_unpin_topics", + "auto_track_topics_after_msecs", + "notification_level_when_replying", + "new_topic_duration_minutes", + "email_previous_replies", + "email_in_reply_to", + "like_notification_frequency", + "include_tl0_in_digests", + "theme_ids", + "theme_key_seq", + "allow_private_messages", + "enable_allowed_pm_users", + "homepage_id", + "hide_profile_and_presence", + "text_size", + "text_size_seq", + "title_count_mode", + "timezone", + "skip_new_user_tips" + ] + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "last_posted_at", + "last_seen_at", + "created_at", + "ignored", + "muted", + "can_ignore_user", + "can_mute_user", + "can_send_private_messages", + "can_send_private_message_to_user", + "trust_level", + "moderator", + "admin", + "title", + "badge_count", + "custom_fields", + "time_read", + "recent_time_read", + "primary_group_id", + "primary_group_name", + "flair_group_id", + "flair_name", + "flair_url", + "flair_bg_color", + "flair_color", + "featured_topic", + "staged", + "can_edit", + "can_edit_username", + "can_edit_email", + "can_edit_name", + "uploaded_avatar_id", + "has_title_badges", + "pending_count", + "profile_view_count", + "second_factor_enabled", + "can_upload_profile_header", + "can_upload_user_card_background", + "post_count", + "can_be_deleted", + "can_delete_all_posts", + "locale", + "muted_category_ids", + "regular_category_ids", + "watched_tags", + "watching_first_post_tags", + "tracked_tags", + "muted_tags", + "tracked_category_ids", + "watched_category_ids", + "watched_first_post_category_ids", + "system_avatar_upload_id", + "system_avatar_template", + "muted_usernames", + "ignored_usernames", + "allowed_pm_usernames", + "mailing_list_posts_per_day", + "can_change_bio", + "can_change_location", + "can_change_website", + "can_change_tracking_preferences", + "user_api_keys", + "user_auth_tokens", + "user_notification_schedule", + "use_logo_small_as_avatar", + "featured_user_badge_ids", + "invited_by", + "groups", + "group_users", + "user_option" + ] + } + }, + "required": [ + "user_badges", + "user" + ] + } + } + } + } + } + } + }, + "/u/by-external/{external_id}.json": { + "get": { + "summary": "Get a user by external_id", + "tags": [ + "Users" + ], + "operationId": "getUserExternalId", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "external_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "user response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "user_badges": { + "type": "array", + "items": [] + }, + "user": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "last_posted_at": { + "type": [ + "string", + "null" + ] + }, + "last_seen_at": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "ignored": { + "type": "boolean" + }, + "muted": { + "type": "boolean" + }, + "can_ignore_user": { + "type": "boolean" + }, + "can_mute_user": { + "type": "boolean" + }, + "can_send_private_messages": { + "type": "boolean" + }, + "can_send_private_message_to_user": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "badge_count": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "secondary_emails": { + "type": "array" + }, + "unconfirmed_emails": { + "type": "array" + }, + "associated_accounts": { + "type": "array" + }, + "second_factor_backup_enabled": { + "type": "boolean" + }, + "user_fields": { + "type": "object", + "additionalProperties": false, + "properties": { + "1": { + "type": [ + "string", + "null" + ] + }, + "2": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "1", + "2" + ] + }, + "custom_fields": { + "type": "object", + "additionalProperties": false, + "properties": { + "first_name": { + "type": [ + "string", + "null" + ] + } + }, + "required": [] + }, + "time_read": { + "type": "integer" + }, + "recent_time_read": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_group_id": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "featured_topic": { + "type": [ + "string", + "null" + ] + }, + "staged": { + "type": "boolean" + }, + "can_edit": { + "type": "boolean" + }, + "can_edit_username": { + "type": "boolean" + }, + "can_edit_email": { + "type": "boolean" + }, + "can_edit_name": { + "type": "boolean" + }, + "uploaded_avatar_id": { + "type": [ + "string", + "null" + ] + }, + "has_title_badges": { + "type": "boolean" + }, + "pending_count": { + "type": "integer" + }, + "profile_view_count": { + "type": "integer" + }, + "second_factor_enabled": { + "type": "boolean" + }, + "can_upload_profile_header": { + "type": "boolean" + }, + "can_upload_user_card_background": { + "type": "boolean" + }, + "post_count": { + "type": "integer" + }, + "can_be_deleted": { + "type": "boolean" + }, + "can_delete_all_posts": { + "type": "boolean" + }, + "locale": { + "type": [ + "string", + "null" + ] + }, + "muted_category_ids": { + "type": "array", + "items": [] + }, + "regular_category_ids": { + "type": "array", + "items": [] + }, + "watched_tags": { + "type": "array", + "items": [] + }, + "watching_first_post_tags": { + "type": "array", + "items": [] + }, + "tracked_tags": { + "type": "array", + "items": [] + }, + "muted_tags": { + "type": "array", + "items": [] + }, + "tracked_category_ids": { + "type": "array", + "items": [] + }, + "watched_category_ids": { + "type": "array", + "items": [] + }, + "watched_first_post_category_ids": { + "type": "array", + "items": [] + }, + "system_avatar_upload_id": { + "type": [ + "string", + "null" + ] + }, + "system_avatar_template": { + "type": "string" + }, + "muted_usernames": { + "type": "array", + "items": [] + }, + "ignored_usernames": { + "type": "array", + "items": [] + }, + "allowed_pm_usernames": { + "type": "array", + "items": [] + }, + "mailing_list_posts_per_day": { + "type": "integer" + }, + "can_change_bio": { + "type": "boolean" + }, + "can_change_location": { + "type": "boolean" + }, + "can_change_website": { + "type": "boolean" + }, + "can_change_tracking_preferences": { + "type": "boolean" + }, + "user_api_keys": { + "type": [ + "string", + "null" + ] + }, + "user_auth_tokens": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "client_ip": { + "type": "string" + }, + "location": { + "type": "string" + }, + "browser": { + "type": "string" + }, + "device": { + "type": "string" + }, + "os": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "seen_at": { + "type": "string" + }, + "is_active": { + "type": "boolean" + } + }, + "required": [ + "id", + "client_ip", + "location", + "browser", + "device", + "os", + "icon", + "created_at", + "seen_at", + "is_active" + ] + } + ] + }, + "user_notification_schedule": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "day_0_start_time": { + "type": "integer" + }, + "day_0_end_time": { + "type": "integer" + }, + "day_1_start_time": { + "type": "integer" + }, + "day_1_end_time": { + "type": "integer" + }, + "day_2_start_time": { + "type": "integer" + }, + "day_2_end_time": { + "type": "integer" + }, + "day_3_start_time": { + "type": "integer" + }, + "day_3_end_time": { + "type": "integer" + }, + "day_4_start_time": { + "type": "integer" + }, + "day_4_end_time": { + "type": "integer" + }, + "day_5_start_time": { + "type": "integer" + }, + "day_5_end_time": { + "type": "integer" + }, + "day_6_start_time": { + "type": "integer" + }, + "day_6_end_time": { + "type": "integer" + } + }, + "required": [ + "enabled", + "day_0_start_time", + "day_0_end_time", + "day_1_start_time", + "day_1_end_time", + "day_2_start_time", + "day_2_end_time", + "day_3_start_time", + "day_3_end_time", + "day_4_start_time", + "day_4_end_time", + "day_5_start_time", + "day_5_end_time", + "day_6_start_time", + "day_6_end_time" + ] + }, + "use_logo_small_as_avatar": { + "type": "boolean" + }, + "featured_user_badge_ids": { + "type": "array", + "items": [] + }, + "invited_by": { + "type": [ + "string", + "null" + ] + }, + "groups": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "automatic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "user_count": { + "type": "integer" + }, + "mentionable_level": { + "type": "integer" + }, + "messageable_level": { + "type": "integer" + }, + "visibility_level": { + "type": "integer" + }, + "primary_group": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "grant_trust_level": { + "type": [ + "string", + "null" + ] + }, + "incoming_email": { + "type": [ + "string", + "null" + ] + }, + "has_messages": { + "type": "boolean" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "bio_raw": { + "type": [ + "string", + "null" + ] + }, + "bio_cooked": { + "type": [ + "string", + "null" + ] + }, + "bio_excerpt": { + "type": [ + "string", + "null" + ] + }, + "public_admission": { + "type": "boolean" + }, + "public_exit": { + "type": "boolean" + }, + "allow_membership_requests": { + "type": "boolean" + }, + "full_name": { + "type": [ + "string", + "null" + ] + }, + "default_notification_level": { + "type": "integer" + }, + "membership_request_template": { + "type": [ + "string", + "null" + ] + }, + "members_visibility_level": { + "type": "integer" + }, + "can_see_members": { + "type": "boolean" + }, + "can_admin_group": { + "type": "boolean" + }, + "publish_read_state": { + "type": "boolean" + } + }, + "required": [ + "id", + "automatic", + "name", + "display_name", + "user_count", + "mentionable_level", + "messageable_level", + "visibility_level", + "primary_group", + "title", + "grant_trust_level", + "incoming_email", + "has_messages", + "flair_url", + "flair_bg_color", + "flair_color", + "bio_raw", + "bio_cooked", + "bio_excerpt", + "public_admission", + "public_exit", + "allow_membership_requests", + "full_name", + "default_notification_level", + "membership_request_template", + "members_visibility_level", + "can_see_members", + "can_admin_group", + "publish_read_state" + ] + } + ] + }, + "group_users": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "group_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "notification_level": { + "type": "integer" + }, + "owner": { + "type": "boolean" + } + }, + "required": [ + "group_id", + "user_id", + "notification_level" + ] + } + ] + }, + "user_option": { + "type": "object", + "additionalProperties": false, + "properties": { + "user_id": { + "type": "integer" + }, + "mailing_list_mode": { + "type": "boolean" + }, + "mailing_list_mode_frequency": { + "type": "integer" + }, + "email_digests": { + "type": "boolean" + }, + "email_level": { + "type": "integer" + }, + "email_messages_level": { + "type": "integer" + }, + "external_links_in_new_tab": { + "type": "boolean" + }, + "color_scheme_id": { + "type": [ + "string", + "null" + ] + }, + "dark_scheme_id": { + "type": [ + "string", + "null" + ] + }, + "dynamic_favicon": { + "type": "boolean" + }, + "enable_quoting": { + "type": "boolean" + }, + "enable_defer": { + "type": "boolean" + }, + "digest_after_minutes": { + "type": "integer" + }, + "automatically_unpin_topics": { + "type": "boolean" + }, + "auto_track_topics_after_msecs": { + "type": "integer" + }, + "notification_level_when_replying": { + "type": "integer" + }, + "new_topic_duration_minutes": { + "type": "integer" + }, + "email_previous_replies": { + "type": "integer" + }, + "email_in_reply_to": { + "type": "boolean" + }, + "like_notification_frequency": { + "type": "integer" + }, + "include_tl0_in_digests": { + "type": "boolean" + }, + "theme_ids": { + "type": "array", + "items": [] + }, + "theme_key_seq": { + "type": "integer" + }, + "allow_private_messages": { + "type": "boolean" + }, + "enable_allowed_pm_users": { + "type": "boolean" + }, + "homepage_id": { + "type": [ + "string", + "null" + ] + }, + "hide_profile_and_presence": { + "type": "boolean" + }, + "text_size": { + "type": "string" + }, + "text_size_seq": { + "type": "integer" + }, + "title_count_mode": { + "type": "string" + }, + "timezone": { + "type": [ + "string", + "null" + ] + }, + "skip_new_user_tips": { + "type": "boolean" + } + }, + "required": [ + "user_id", + "mailing_list_mode", + "mailing_list_mode_frequency", + "email_digests", + "email_level", + "email_messages_level", + "external_links_in_new_tab", + "color_scheme_id", + "dark_scheme_id", + "dynamic_favicon", + "enable_quoting", + "enable_defer", + "digest_after_minutes", + "automatically_unpin_topics", + "auto_track_topics_after_msecs", + "notification_level_when_replying", + "new_topic_duration_minutes", + "email_previous_replies", + "email_in_reply_to", + "like_notification_frequency", + "include_tl0_in_digests", + "theme_ids", + "theme_key_seq", + "allow_private_messages", + "enable_allowed_pm_users", + "homepage_id", + "hide_profile_and_presence", + "text_size", + "text_size_seq", + "title_count_mode", + "timezone", + "skip_new_user_tips" + ] + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "last_posted_at", + "last_seen_at", + "created_at", + "ignored", + "muted", + "can_ignore_user", + "can_mute_user", + "can_send_private_messages", + "can_send_private_message_to_user", + "trust_level", + "moderator", + "admin", + "title", + "badge_count", + "custom_fields", + "time_read", + "recent_time_read", + "primary_group_id", + "primary_group_name", + "flair_group_id", + "flair_name", + "flair_url", + "flair_bg_color", + "flair_color", + "featured_topic", + "staged", + "can_edit", + "can_edit_username", + "can_edit_email", + "can_edit_name", + "uploaded_avatar_id", + "has_title_badges", + "pending_count", + "profile_view_count", + "second_factor_enabled", + "can_upload_profile_header", + "can_upload_user_card_background", + "post_count", + "can_be_deleted", + "can_delete_all_posts", + "locale", + "muted_category_ids", + "regular_category_ids", + "watched_tags", + "watching_first_post_tags", + "tracked_tags", + "muted_tags", + "tracked_category_ids", + "watched_category_ids", + "watched_first_post_category_ids", + "system_avatar_upload_id", + "system_avatar_template", + "muted_usernames", + "ignored_usernames", + "allowed_pm_usernames", + "mailing_list_posts_per_day", + "can_change_bio", + "can_change_location", + "can_change_website", + "can_change_tracking_preferences", + "user_api_keys", + "user_auth_tokens", + "user_notification_schedule", + "use_logo_small_as_avatar", + "featured_user_badge_ids", + "invited_by", + "groups", + "group_users", + "user_option" + ] + } + }, + "required": [ + "user_badges", + "user" + ] + } + } + } + } + } + } + }, + "/u/by-external/{provider}/{external_id}.json": { + "get": { + "summary": "Get a user by identity provider external ID", + "tags": [ + "Users" + ], + "operationId": "getUserIdentiyProviderExternalId", + "parameters": [ + { + "name": "Api-Key", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "Api-Username", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "provider", + "in": "path", + "required": true, + "description": "Authentication provider name. Can be found in the provider callback\nURL: `/auth/{provider}/callback`", + "schema": { + "type": "string" + } + }, + { + "name": "external_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "user response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "user_badges": { + "type": "array", + "items": [] + }, + "user": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "last_posted_at": { + "type": [ + "string", + "null" + ] + }, + "last_seen_at": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "ignored": { + "type": "boolean" + }, + "muted": { + "type": "boolean" + }, + "can_ignore_user": { + "type": "boolean" + }, + "can_mute_user": { + "type": "boolean" + }, + "can_send_private_messages": { + "type": "boolean" + }, + "can_send_private_message_to_user": { + "type": "boolean" + }, + "trust_level": { + "type": "integer" + }, + "moderator": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "badge_count": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "secondary_emails": { + "type": "array" + }, + "unconfirmed_emails": { + "type": "array" + }, + "associated_accounts": { + "type": "array" + }, + "second_factor_backup_enabled": { + "type": "boolean" + }, + "user_fields": { + "type": "object", + "additionalProperties": false, + "properties": { + "1": { + "type": [ + "string", + "null" + ] + }, + "2": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "1", + "2" + ] + }, + "custom_fields": { + "type": "object", + "additionalProperties": false, + "properties": { + "first_name": { + "type": [ + "string", + "null" + ] + } + }, + "required": [] + }, + "time_read": { + "type": "integer" + }, + "recent_time_read": { + "type": "integer" + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + }, + "primary_group_name": { + "type": [ + "string", + "null" + ] + }, + "flair_group_id": { + "type": [ + "string", + "null" + ] + }, + "flair_name": { + "type": [ + "string", + "null" + ] + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "featured_topic": { + "type": [ + "string", + "null" + ] + }, + "staged": { + "type": "boolean" + }, + "can_edit": { + "type": "boolean" + }, + "can_edit_username": { + "type": "boolean" + }, + "can_edit_email": { + "type": "boolean" + }, + "can_edit_name": { + "type": "boolean" + }, + "uploaded_avatar_id": { + "type": [ + "string", + "null" + ] + }, + "has_title_badges": { + "type": "boolean" + }, + "pending_count": { + "type": "integer" + }, + "profile_view_count": { + "type": "integer" + }, + "second_factor_enabled": { + "type": "boolean" + }, + "can_upload_profile_header": { + "type": "boolean" + }, + "can_upload_user_card_background": { + "type": "boolean" + }, + "post_count": { + "type": "integer" + }, + "can_be_deleted": { + "type": "boolean" + }, + "can_delete_all_posts": { + "type": "boolean" + }, + "locale": { + "type": [ + "string", + "null" + ] + }, + "muted_category_ids": { + "type": "array", + "items": [] + }, + "regular_category_ids": { + "type": "array", + "items": [] + }, + "watched_tags": { + "type": "array", + "items": [] + }, + "watching_first_post_tags": { + "type": "array", + "items": [] + }, + "tracked_tags": { + "type": "array", + "items": [] + }, + "muted_tags": { + "type": "array", + "items": [] + }, + "tracked_category_ids": { + "type": "array", + "items": [] + }, + "watched_category_ids": { + "type": "array", + "items": [] + }, + "watched_first_post_category_ids": { + "type": "array", + "items": [] + }, + "system_avatar_upload_id": { + "type": [ + "string", + "null" + ] + }, + "system_avatar_template": { + "type": "string" + }, + "muted_usernames": { + "type": "array", + "items": [] + }, + "ignored_usernames": { + "type": "array", + "items": [] + }, + "allowed_pm_usernames": { + "type": "array", + "items": [] + }, + "mailing_list_posts_per_day": { + "type": "integer" + }, + "can_change_bio": { + "type": "boolean" + }, + "can_change_location": { + "type": "boolean" + }, + "can_change_website": { + "type": "boolean" + }, + "can_change_tracking_preferences": { + "type": "boolean" + }, + "user_api_keys": { + "type": [ + "string", + "null" + ] + }, + "user_auth_tokens": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "client_ip": { + "type": "string" + }, + "location": { + "type": "string" + }, + "browser": { + "type": "string" + }, + "device": { + "type": "string" + }, + "os": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "seen_at": { + "type": "string" + }, + "is_active": { + "type": "boolean" + } + }, + "required": [ + "id", + "client_ip", + "location", + "browser", + "device", + "os", + "icon", + "created_at", + "seen_at", + "is_active" + ] + } + ] + }, + "user_notification_schedule": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "day_0_start_time": { + "type": "integer" + }, + "day_0_end_time": { + "type": "integer" + }, + "day_1_start_time": { + "type": "integer" + }, + "day_1_end_time": { + "type": "integer" + }, + "day_2_start_time": { + "type": "integer" + }, + "day_2_end_time": { + "type": "integer" + }, + "day_3_start_time": { + "type": "integer" + }, + "day_3_end_time": { + "type": "integer" + }, + "day_4_start_time": { + "type": "integer" + }, + "day_4_end_time": { + "type": "integer" + }, + "day_5_start_time": { + "type": "integer" + }, + "day_5_end_time": { + "type": "integer" + }, + "day_6_start_time": { + "type": "integer" + }, + "day_6_end_time": { + "type": "integer" + } + }, + "required": [ + "enabled", + "day_0_start_time", + "day_0_end_time", + "day_1_start_time", + "day_1_end_time", + "day_2_start_time", + "day_2_end_time", + "day_3_start_time", + "day_3_end_time", + "day_4_start_time", + "day_4_end_time", + "day_5_start_time", + "day_5_end_time", + "day_6_start_time", + "day_6_end_time" + ] + }, + "use_logo_small_as_avatar": { + "type": "boolean" + }, + "featured_user_badge_ids": { + "type": "array", + "items": [] + }, + "invited_by": { + "type": [ + "string", + "null" + ] + }, + "groups": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "automatic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "user_count": { + "type": "integer" + }, + "mentionable_level": { + "type": "integer" + }, + "messageable_level": { + "type": "integer" + }, + "visibility_level": { + "type": "integer" + }, + "primary_group": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "grant_trust_level": { + "type": [ + "string", + "null" + ] + }, + "incoming_email": { + "type": [ + "string", + "null" + ] + }, + "has_messages": { + "type": "boolean" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "bio_raw": { + "type": [ + "string", + "null" + ] + }, + "bio_cooked": { + "type": [ + "string", + "null" + ] + }, + "bio_excerpt": { + "type": [ + "string", + "null" + ] + }, + "public_admission": { + "type": "boolean" + }, + "public_exit": { + "type": "boolean" + }, + "allow_membership_requests": { + "type": "boolean" + }, + "full_name": { + "type": [ + "string", + "null" + ] + }, + "default_notification_level": { + "type": "integer" + }, + "membership_request_template": { + "type": [ + "string", + "null" + ] + }, + "members_visibility_level": { + "type": "integer" + }, + "can_see_members": { + "type": "boolean" + }, + "can_admin_group": { + "type": "boolean" + }, + "publish_read_state": { + "type": "boolean" + } + }, + "required": [ + "id", + "automatic", + "name", + "display_name", + "user_count", + "mentionable_level", + "messageable_level", + "visibility_level", + "primary_group", + "title", + "grant_trust_level", + "incoming_email", + "has_messages", + "flair_url", + "flair_bg_color", + "flair_color", + "bio_raw", + "bio_cooked", + "bio_excerpt", + "public_admission", + "public_exit", + "allow_membership_requests", + "full_name", + "default_notification_level", + "membership_request_template", + "members_visibility_level", + "can_see_members", + "can_admin_group", + "publish_read_state" + ] + } + ] + }, + "group_users": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "group_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "notification_level": { + "type": "integer" + }, + "owner": { + "type": "boolean" + } + }, + "required": [ + "group_id", + "user_id", + "notification_level" + ] + } + ] + }, + "user_option": { + "type": "object", + "additionalProperties": false, + "properties": { + "user_id": { + "type": "integer" + }, + "mailing_list_mode": { + "type": "boolean" + }, + "mailing_list_mode_frequency": { + "type": "integer" + }, + "email_digests": { + "type": "boolean" + }, + "email_level": { + "type": "integer" + }, + "email_messages_level": { + "type": "integer" + }, + "external_links_in_new_tab": { + "type": "boolean" + }, + "color_scheme_id": { + "type": [ + "string", + "null" + ] + }, + "dark_scheme_id": { + "type": [ + "string", + "null" + ] + }, + "dynamic_favicon": { + "type": "boolean" + }, + "enable_quoting": { + "type": "boolean" + }, + "enable_defer": { + "type": "boolean" + }, + "digest_after_minutes": { + "type": "integer" + }, + "automatically_unpin_topics": { + "type": "boolean" + }, + "auto_track_topics_after_msecs": { + "type": "integer" + }, + "notification_level_when_replying": { + "type": "integer" + }, + "new_topic_duration_minutes": { + "type": "integer" + }, + "email_previous_replies": { + "type": "integer" + }, + "email_in_reply_to": { + "type": "boolean" + }, + "like_notification_frequency": { + "type": "integer" + }, + "include_tl0_in_digests": { + "type": "boolean" + }, + "theme_ids": { + "type": "array", + "items": [] + }, + "theme_key_seq": { + "type": "integer" + }, + "allow_private_messages": { + "type": "boolean" + }, + "enable_allowed_pm_users": { + "type": "boolean" + }, + "homepage_id": { + "type": [ + "string", + "null" + ] + }, + "hide_profile_and_presence": { + "type": "boolean" + }, + "text_size": { + "type": "string" + }, + "text_size_seq": { + "type": "integer" + }, + "title_count_mode": { + "type": "string" + }, + "timezone": { + "type": [ + "string", + "null" + ] + }, + "skip_new_user_tips": { + "type": "boolean" + } + }, + "required": [ + "user_id", + "mailing_list_mode", + "mailing_list_mode_frequency", + "email_digests", + "email_level", + "email_messages_level", + "external_links_in_new_tab", + "color_scheme_id", + "dark_scheme_id", + "dynamic_favicon", + "enable_quoting", + "enable_defer", + "digest_after_minutes", + "automatically_unpin_topics", + "auto_track_topics_after_msecs", + "notification_level_when_replying", + "new_topic_duration_minutes", + "email_previous_replies", + "email_in_reply_to", + "like_notification_frequency", + "include_tl0_in_digests", + "theme_ids", + "theme_key_seq", + "allow_private_messages", + "enable_allowed_pm_users", + "homepage_id", + "hide_profile_and_presence", + "text_size", + "text_size_seq", + "title_count_mode", + "timezone", + "skip_new_user_tips" + ] + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "last_posted_at", + "last_seen_at", + "created_at", + "ignored", + "muted", + "can_ignore_user", + "can_mute_user", + "can_send_private_messages", + "can_send_private_message_to_user", + "trust_level", + "moderator", + "admin", + "title", + "badge_count", + "custom_fields", + "time_read", + "recent_time_read", + "primary_group_id", + "primary_group_name", + "flair_group_id", + "flair_name", + "flair_url", + "flair_bg_color", + "flair_color", + "featured_topic", + "staged", + "can_edit", + "can_edit_username", + "can_edit_email", + "can_edit_name", + "uploaded_avatar_id", + "has_title_badges", + "pending_count", + "profile_view_count", + "second_factor_enabled", + "can_upload_profile_header", + "can_upload_user_card_background", + "post_count", + "can_be_deleted", + "can_delete_all_posts", + "locale", + "muted_category_ids", + "regular_category_ids", + "watched_tags", + "watching_first_post_tags", + "tracked_tags", + "muted_tags", + "tracked_category_ids", + "watched_category_ids", + "watched_first_post_category_ids", + "system_avatar_upload_id", + "system_avatar_template", + "muted_usernames", + "ignored_usernames", + "allowed_pm_usernames", + "mailing_list_posts_per_day", + "can_change_bio", + "can_change_location", + "can_change_website", + "can_change_tracking_preferences", + "user_api_keys", + "user_auth_tokens", + "user_notification_schedule", + "use_logo_small_as_avatar", + "featured_user_badge_ids", + "invited_by", + "groups", + "group_users", + "user_option" + ] + } + }, + "required": [ + "user_badges", + "user" + ] + } + } + } + } + } + } + }, + "/u/{username}/preferences/avatar/pick.json": { + "put": { + "summary": "Update avatar", + "tags": [ + "Users" + ], + "operationId": "updateAvatar", + "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "avatar updated", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "string", + "example": "OK" + } + }, + "required": [ + "success" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "upload_id": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": [ + "uploaded", + "custom", + "gravatar", + "system" + ] + } + }, + "required": [ + "upload_id", + "type" + ] + } + } + } + } + } + }, + "/u/{username}/preferences/email.json": { + "put": { + "summary": "Update email", + "tags": [ + "Users" + ], + "operationId": "updateEmail", + "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "email updated" + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "type": "string", + "format": "email" + } + }, + "required": [ + "email" + ] + } + } + } + } + } + }, + "/directory_items.json": { + "get": { + "summary": "Get a public list of users", + "tags": [ + "Users" + ], + "operationId": "listUsersPublic", + "parameters": [ + { + "name": "period", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "daily", + "weekly", + "monthly", + "quarterly", + "yearly", + "all" + ] + }, + "required": true + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "likes_received", + "likes_given", + "topic_count", + "post_count", + "topics_entered", + "posts_read", + "days_visited" + ] + }, + "required": true + }, + { + "name": "asc", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "true" + ] + } + }, + { + "name": "page", + "in": "query", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "directory items response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "directory_items": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "likes_received": { + "type": "integer" + }, + "likes_given": { + "type": "integer" + }, + "topics_entered": { + "type": "integer" + }, + "topic_count": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "posts_read": { + "type": "integer" + }, + "days_visited": { + "type": "integer" + }, + "user": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "title" + ] + } + }, + "required": [ + "id", + "likes_received", + "likes_given", + "topics_entered", + "topic_count", + "post_count", + "posts_read", + "days_visited", + "user" + ] + } + ] + }, + "meta": { + "type": "object", + "additionalProperties": false, + "properties": { + "last_updated_at": { + "type": [ + "string", + "null" + ] + }, + "total_rows_directory_items": { + "type": "integer" + }, + "load_more_directory_items": { + "type": "string" + } + }, + "required": [ + "last_updated_at", + "total_rows_directory_items", + "load_more_directory_items" + ] + } + }, + "required": [ + "directory_items", + "meta" + ] + } + } + } + } + } + } + }, + "/admin/users/{id}.json": { + "get": { + "summary": "Get a user by id", + "tags": [ + "Users", + "Admin" + ], + "operationId": "adminGetUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + }, + "email": { + "type": "string" + }, + "secondary_emails": { + "type": "array", + "items": [] + }, + "active": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "moderator": { + "type": "boolean" + }, + "last_seen_at": { + "type": [ + "string", + "null" + ] + }, + "last_emailed_at": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_seen_age": { + "type": [ + "number", + "null" + ] + }, + "last_emailed_age": { + "type": [ + "number", + "null" + ] + }, + "created_at_age": { + "type": [ + "number", + "null" + ] + }, + "trust_level": { + "type": "integer" + }, + "manual_locked_trust_level": { + "type": [ + "string", + "null" + ] + }, + "flag_level": { + "type": "integer" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "time_read": { + "type": "integer" + }, + "staged": { + "type": "boolean" + }, + "days_visited": { + "type": "integer" + }, + "posts_read_count": { + "type": "integer" + }, + "topics_entered": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "associated_accounts": { + "type": "array", + "items": [] + }, + "can_send_activation_email": { + "type": "boolean" + }, + "can_activate": { + "type": "boolean" + }, + "can_deactivate": { + "type": "boolean" + }, + "ip_address": { + "type": "string" + }, + "registration_ip_address": { + "type": [ + "string", + "null" + ] + }, + "can_grant_admin": { + "type": "boolean" + }, + "can_revoke_admin": { + "type": "boolean" + }, + "can_grant_moderation": { + "type": "boolean" + }, + "can_revoke_moderation": { + "type": "boolean" + }, + "can_impersonate": { + "type": "boolean" + }, + "like_count": { + "type": "integer" + }, + "like_given_count": { + "type": "integer" + }, + "topic_count": { + "type": "integer" + }, + "flags_given_count": { + "type": "integer" + }, + "flags_received_count": { + "type": "integer" + }, + "private_topics_count": { + "type": "integer" + }, + "can_delete_all_posts": { + "type": "boolean" + }, + "can_be_deleted": { + "type": "boolean" + }, + "can_be_anonymized": { + "type": "boolean" + }, + "can_be_merged": { + "type": "boolean" + }, + "full_suspend_reason": { + "type": [ + "string", + "null" + ] + }, + "silence_reason": { + "type": [ + "string", + "null" + ] + }, + "post_edits_count": { + "type": [ + "integer", + "null" + ] + }, + "primary_group_id": { + "type": [ + "string", + "null" + ] + }, + "badge_count": { + "type": "integer" + }, + "warnings_received_count": { + "type": "integer" + }, + "bounce_score": { + "type": [ + "integer", + "null" + ] + }, + "reset_bounce_score_after": { + "type": [ + "string", + "null" + ] + }, + "can_view_action_logs": { + "type": "boolean" + }, + "can_disable_second_factor": { + "type": "boolean" + }, + "can_delete_sso_record": { + "type": "boolean" + }, + "api_key_count": { + "type": "integer" + }, + "single_sign_on_record": { + "type": [ + "string", + "null" + ] + }, + "approved_by": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar_template": { + "type": "string" + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template" + ] + }, + "suspended_by": { + "type": [ + "string", + "null" + ] + }, + "silenced_by": { + "type": [ + "string", + "null" + ] + }, + "penalty_counts": { + "type": "object", + "additionalProperties": false, + "properties": { + "silenced": { + "type": "integer" + }, + "suspended": { + "type": "integer" + } + }, + "required": [ + "silenced", + "suspended" + ] + }, + "next_penalty": { + "type": "string" + }, + "tl3_requirements": { + "type": "object", + "additionalProperties": false, + "properties": { + "time_period": { + "type": "integer" + }, + "requirements_met": { + "type": "boolean" + }, + "requirements_lost": { + "type": "boolean" + }, + "trust_level_locked": { + "type": "boolean" + }, + "on_grace_period": { + "type": "boolean" + }, + "days_visited": { + "type": "integer" + }, + "min_days_visited": { + "type": "integer" + }, + "num_topics_replied_to": { + "type": "integer" + }, + "min_topics_replied_to": { + "type": "integer" + }, + "topics_viewed": { + "type": "integer" + }, + "min_topics_viewed": { + "type": "integer" + }, + "posts_read": { + "type": "integer" + }, + "min_posts_read": { + "type": "integer" + }, + "topics_viewed_all_time": { + "type": "integer" + }, + "min_topics_viewed_all_time": { + "type": "integer" + }, + "posts_read_all_time": { + "type": "integer" + }, + "min_posts_read_all_time": { + "type": "integer" + }, + "num_flagged_posts": { + "type": "integer" + }, + "max_flagged_posts": { + "type": "integer" + }, + "num_flagged_by_users": { + "type": "integer" + }, + "max_flagged_by_users": { + "type": "integer" + }, + "num_likes_given": { + "type": "integer" + }, + "min_likes_given": { + "type": "integer" + }, + "num_likes_received": { + "type": "integer" + }, + "min_likes_received": { + "type": "integer" + }, + "num_likes_received_days": { + "type": "integer" + }, + "min_likes_received_days": { + "type": "integer" + }, + "num_likes_received_users": { + "type": "integer" + }, + "min_likes_received_users": { + "type": "integer" + }, + "penalty_counts": { + "type": "object", + "additionalProperties": false, + "properties": { + "silenced": { + "type": "integer" + }, + "suspended": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "silenced", + "suspended", + "total" + ] + } + }, + "required": [ + "time_period", + "requirements_met", + "requirements_lost", + "trust_level_locked", + "on_grace_period", + "days_visited", + "min_days_visited", + "num_topics_replied_to", + "min_topics_replied_to", + "topics_viewed", + "min_topics_viewed", + "posts_read", + "min_posts_read", + "topics_viewed_all_time", + "min_topics_viewed_all_time", + "posts_read_all_time", + "min_posts_read_all_time", + "num_flagged_posts", + "max_flagged_posts", + "num_flagged_by_users", + "max_flagged_by_users", + "num_likes_given", + "min_likes_given", + "num_likes_received", + "min_likes_received", + "num_likes_received_days", + "min_likes_received_days", + "num_likes_received_users", + "min_likes_received_users", + "penalty_counts" + ] + }, + "groups": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "automatic": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "user_count": { + "type": "integer" + }, + "mentionable_level": { + "type": "integer" + }, + "messageable_level": { + "type": "integer" + }, + "visibility_level": { + "type": "integer" + }, + "primary_group": { + "type": "boolean" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "grant_trust_level": { + "type": [ + "string", + "null" + ] + }, + "incoming_email": { + "type": [ + "string", + "null" + ] + }, + "has_messages": { + "type": "boolean" + }, + "flair_url": { + "type": [ + "string", + "null" + ] + }, + "flair_bg_color": { + "type": [ + "string", + "null" + ] + }, + "flair_color": { + "type": [ + "string", + "null" + ] + }, + "bio_raw": { + "type": [ + "string", + "null" + ] + }, + "bio_cooked": { + "type": [ + "string", + "null" + ] + }, + "bio_excerpt": { + "type": [ + "string", + "null" + ] + }, + "public_admission": { + "type": "boolean" + }, + "public_exit": { + "type": "boolean" + }, + "allow_membership_requests": { + "type": "boolean" + }, + "full_name": { + "type": [ + "string", + "null" + ] + }, + "default_notification_level": { + "type": "integer" + }, + "membership_request_template": { + "type": [ + "string", + "null" + ] + }, + "members_visibility_level": { + "type": "integer" + }, + "can_see_members": { + "type": "boolean" + }, + "can_admin_group": { + "type": "boolean" + }, + "publish_read_state": { + "type": "boolean" + } + }, + "required": [ + "id", + "automatic", + "name", + "display_name", + "user_count", + "mentionable_level", + "messageable_level", + "visibility_level", + "primary_group", + "title", + "grant_trust_level", + "incoming_email", + "has_messages", + "flair_url", + "flair_bg_color", + "flair_color", + "bio_raw", + "bio_cooked", + "bio_excerpt", + "public_admission", + "public_exit", + "allow_membership_requests", + "full_name", + "default_notification_level", + "membership_request_template", + "members_visibility_level", + "can_see_members", + "can_admin_group", + "publish_read_state" + ] + } + ] + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "active", + "admin", + "moderator", + "last_seen_at", + "last_emailed_at", + "created_at", + "last_seen_age", + "last_emailed_age", + "created_at_age", + "trust_level", + "manual_locked_trust_level", + "flag_level", + "title", + "time_read", + "staged", + "days_visited", + "posts_read_count", + "topics_entered", + "post_count", + "can_send_activation_email", + "can_activate", + "can_deactivate", + "ip_address", + "registration_ip_address", + "can_grant_admin", + "can_revoke_admin", + "can_grant_moderation", + "can_revoke_moderation", + "can_impersonate", + "like_count", + "like_given_count", + "topic_count", + "flags_given_count", + "flags_received_count", + "private_topics_count", + "can_delete_all_posts", + "can_be_deleted", + "can_be_anonymized", + "can_be_merged", + "full_suspend_reason", + "silence_reason", + "primary_group_id", + "badge_count", + "warnings_received_count", + "bounce_score", + "reset_bounce_score_after", + "can_view_action_logs", + "can_disable_second_factor", + "can_delete_sso_record", + "api_key_count", + "single_sign_on_record", + "approved_by", + "suspended_by", + "silenced_by", + "groups" + ] + } + } + } + } + } + }, + "delete": { + "summary": "Delete a user", + "tags": [ + "Users", + "Admin" + ], + "operationId": "deleteUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "deleted": { + "type": "boolean" + } + }, + "required": [ + "deleted" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "delete_posts": { + "type": "boolean" + }, + "block_email": { + "type": "boolean" + }, + "block_urls": { + "type": "boolean" + }, + "block_ip": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "/admin/users/{id}/suspend.json": { + "put": { + "summary": "Suspend a user", + "tags": [ + "Users", + "Admin" + ], + "operationId": "suspendUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "suspension": { + "type": "object", + "additionalProperties": false, + "properties": { + "suspend_reason": { + "type": "string" + }, + "full_suspend_reason": { + "type": "string" + }, + "suspended_till": { + "type": "string" + }, + "suspended_at": { + "type": "string" + } + }, + "required": [ + "suspend_reason", + "full_suspend_reason", + "suspended_till", + "suspended_at" + ] + } + }, + "required": [ + "suspension" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "suspend_until": { + "type": "string", + "example": "2121-02-22" + }, + "reason": { + "type": "string" + }, + "message": { + "type": "string", + "description": "Will send an email with this message when present" + }, + "post_action": { + "type": "string", + "example": "delete" + } + }, + "required": [ + "suspend_until", + "reason" + ] + } + } + } + } + } + }, + "/admin/users/{id}/anonymize.json": { + "put": { + "summary": "Anonymize a user", + "tags": [ + "Users", + "Admin" + ], + "operationId": "anonymizeUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "success", + "username" + ] + } + } + } + } + } + } + }, + "/admin/users/{id}/log_out.json": { + "post": { + "summary": "Log a user out", + "tags": [ + "Users", + "Admin" + ], + "operationId": "logOutUser", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "string", + "example": "OK" + } + }, + "required": [ + "success" + ] + } + } + } + } + } + } + }, + "/user_avatar/{username}/refresh_gravatar.json": { + "post": { + "summary": "Refresh gravatar", + "tags": [ + "Users", + "Admin" + ], + "operationId": "refreshGravatar", + "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "gravatar_upload_id": { + "type": [ + "integer", + "null" + ] + }, + "gravatar_avatar_template": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "gravatar_upload_id", + "gravatar_avatar_template" + ] + } + } + } + } + } + } + }, + "/admin/users/list/{flag}.json": { + "get": { + "summary": "Get a list of users", + "tags": [ + "Users", + "Admin" + ], + "operationId": "adminListUsers", + "parameters": [ + { + "name": "flag", + "in": "path", + "schema": { + "type": "string", + "enum": [ + "active", + "new", + "staff", + "suspended", + "blocked", + "suspect" + ] + }, + "required": true + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "created", + "last_emailed", + "seen", + "username", + "email", + "trust_level", + "days_visited", + "posts_read", + "topics_viewed", + "posts", + "read_time" + ] + } + }, + { + "name": "asc", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "true" + ] + } + }, + { + "name": "page", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "show_emails", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "avatar_template": { + "type": "string" + }, + "email": { + "type": "string" + }, + "secondary_emails": { + "type": "array", + "items": [] + }, + "active": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "moderator": { + "type": "boolean" + }, + "last_seen_at": { + "type": [ + "string", + "null" + ] + }, + "last_emailed_at": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string" + }, + "last_seen_age": { + "type": [ + "number", + "null" + ] + }, + "last_emailed_age": { + "type": [ + "number", + "null" + ] + }, + "created_at_age": { + "type": [ + "number", + "null" + ] + }, + "trust_level": { + "type": "integer" + }, + "manual_locked_trust_level": { + "type": [ + "string", + "null" + ] + }, + "flag_level": { + "type": "integer" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "time_read": { + "type": "integer" + }, + "staged": { + "type": "boolean" + }, + "days_visited": { + "type": "integer" + }, + "posts_read_count": { + "type": "integer" + }, + "topics_entered": { + "type": "integer" + }, + "post_count": { + "type": "integer" + } + }, + "required": [ + "id", + "username", + "name", + "avatar_template", + "active", + "admin", + "moderator", + "last_seen_at", + "last_emailed_at", + "created_at", + "last_seen_age", + "last_emailed_age", + "created_at_age", + "trust_level", + "manual_locked_trust_level", + "flag_level", + "title", + "time_read", + "staged", + "days_visited", + "posts_read_count", + "topics_entered", + "post_count" + ] + } + } + } + } + } + } + } + }, + "/user_actions.json": { + "get": { + "summary": "Get a list of user actions", + "tags": [ + "Users" + ], + "operationId": "listUserActions", + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "username", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "filter", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "user_actions": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "excerpt": { + "type": "string" + }, + "action_type": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "avatar_template": { + "type": "string" + }, + "acting_avatar_template": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "topic_id": { + "type": "integer" + }, + "target_user_id": { + "type": "integer" + }, + "target_name": { + "type": [ + "string", + "null" + ] + }, + "target_username": { + "type": "string" + }, + "post_number": { + "type": "integer" + }, + "post_id": { + "type": [ + "string", + "null" + ] + }, + "username": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "user_id": { + "type": "integer" + }, + "acting_username": { + "type": "string" + }, + "acting_name": { + "type": [ + "string", + "null" + ] + }, + "acting_user_id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "hidden": { + "type": [ + "string", + "null" + ] + }, + "post_type": { + "type": [ + "string", + "null" + ] + }, + "action_code": { + "type": [ + "string", + "null" + ] + }, + "category_id": { + "type": "integer" + }, + "closed": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + } + }, + "required": [ + "excerpt", + "action_type", + "created_at", + "avatar_template", + "acting_avatar_template", + "slug", + "topic_id", + "target_user_id", + "target_name", + "target_username", + "post_number", + "post_id", + "username", + "name", + "user_id", + "acting_username", + "acting_name", + "acting_user_id", + "title", + "deleted", + "hidden", + "post_type", + "action_code", + "category_id", + "closed", + "archived" + ] + } + ] + } + }, + "required": [ + "user_actions" + ] + } + } + } + } + } + } + }, + "/session/forgot_password.json": { + "post": { + "summary": "Send password reset email", + "tags": [ + "Users" + ], + "operationId": "sendPasswordResetEmail", + "parameters": [], + "responses": { + "200": { + "description": "success response", + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "success": { + "type": "string" + }, + "user_found": { + "type": "boolean" + } + }, + "required": [ + "success", + "user_found" + ] + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "login": { + "type": "string" + } + }, + "required": [ + "login" + ] + } + } + } + } + } + }, + "/users/password-reset/{token}.json": { + "put": { + "summary": "Change password", + "tags": [ + "Users" + ], + "operationId": "changePassword", + "parameters": [ + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success response" + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "username", + "password" + ] + } + } } } } } }, - "components": { - "requestBodies": { - "SimpleRequestBody": { - "description": "A reusable request body", - "required": false, - "content": { - "application/json": { - "description": "Message for default response", - "schema": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - } - }, - "schemas": { - "MultilineComment": { - "description": "Testing multiline comments.\nThis must go to the next line.\n\nThis will contain a break.", - "type": "integer" - }, - "SimpleInteger": { - "description": "This is a simple number", - "type": "integer" - }, - "SimpleBoolean": { - "description": "This is a simple boolean", - "type": "boolean" - }, - "SimpleString": { - "description": "This is a simple string", - "type": "string" - }, - "SimpleFile": { - "description": "This is a simple file", - "type": "File" - }, - "SimpleReference": { - "description": "This is a simple reference", - "$ref": "#/components/schemas/ModelWithString" - }, - "SimpleStringWithPattern": { - "description": "This is a simple string", - "type": "string", - "nullable": true, - "maxLength": 64, - "pattern": "^[a-zA-Z0-9_]*$" - }, - "EnumWithStrings": { - "description": "This is a simple enum with strings", - "enum": [ - "Success", - "Warning", - "Error" - ] - }, - "EnumWithNumbers": { - "description": "This is a simple enum with numbers", - "enum": [ - 1, - 2, - 3, - 1.1, - 1.20, - 1.300, - 100, - 200, - 300, - -100, - -200, - -300, - -1.1, - -1.20, - -1.300 - ] - }, - "EnumFromDescription": { - "description": "Success=1,Warning=2,Error=3", - "type": "int" - }, - "EnumWithExtensions": { - "description": "This is a simple enum with numbers", - "enum": [ - 200, - 400, - 500 - ], - "x-enum-varnames": [ - "CUSTOM_SUCCESS", - "CUSTOM_WARNING", - "CUSTOM_ERROR" - ], - "x-enum-descriptions": [ - "Used when the status of something is successful", - "Used when the status of something has a warning", - "Used when the status of something has an error" - ] - }, - "ArrayWithNumbers": { - "description": "This is a simple array with numbers", - "type": "array", - "items": { - "type": "integer" - } - }, - "ArrayWithBooleans": { - "description": "This is a simple array with booleans", - "type": "array", - "items": { - "type": "boolean" - } - }, - "ArrayWithStrings": { - "description": "This is a simple array with strings", - "type": "array", - "items": { - "type": "string" - } - }, - "ArrayWithReferences": { - "description": "This is a simple array with references", - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelWithString" - } - }, - "ArrayWithArray": { - "description": "This is a simple array containing an array", - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelWithString" - } - } - }, - "ArrayWithProperties": { - "description": "This is a simple array with properties", - "type": "array", - "items": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - } - } - } - }, - "DictionaryWithString": { - "description": "This is a string dictionary", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "DictionaryWithReference": { - "description": "This is a string reference", - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/ModelWithString" - } - }, - "DictionaryWithArray": { - "description": "This is a complex dictionary", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelWithString" - } - } - }, - "DictionaryWithDictionary": { - "description": "This is a string dictionary", - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "DictionaryWithProperties": { - "description": "This is a complex dictionary", - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - } - } - } - }, - "ModelWithInteger": { - "description": "This is a model with one number property", - "type": "object", - "properties": { - "prop": { - "description": "This is a simple number property", - "type": "integer" - } - } - }, - "ModelWithBoolean": { - "description": "This is a model with one boolean property", - "type": "object", - "properties": { - "prop": { - "description": "This is a simple boolean property", - "type": "boolean" - } - } - }, - "ModelWithString": { - "description": "This is a model with one string property", - "type": "object", - "properties": { - "prop": { - "description": "This is a simple string property", - "type": "string" - } - } - }, - "ModelWithEnum": { - "description": "This is a model with one enum", - "type": "object", - "properties": { - "test": { - "description": "This is a simple enum with strings", - "enum": [ - "Success", - "Warning", - "Error" - ] - }, - "statusCode": { - "description": "These are the HTTP error code enums", - "enum": [ - "100", - "200 FOO", - "300 FOO_BAR", - "400 foo-bar", - "500 foo.bar", - "600 foo&bar" - ] - }, - "bool": { - "description": "Simple boolean enum", - "type": "boolean", - "enum": [ - true - ] - } - } - }, - "ModelWithEnumFromDescription": { - "description": "This is a model with one enum", - "type": "object", - "properties": { - "test": { - "type": "integer", - "description": "Success=1,Warning=2,Error=3" - } - } - }, - "ModelWithNestedEnums": { - "description": "This is a model with nested enums", - "type": "object", - "properties": { - "dictionaryWithEnum": { - "type": "object", - "additionalProperties": { - "enum": [ - "Success", - "Warning", - "Error" - ] - } - }, - "dictionaryWithEnumFromDescription": { - "type": "object", - "additionalProperties": { - "type": "integer", - "description": "Success=1,Warning=2,Error=3" - } - }, - "arrayWithEnum": { - "type": "array", - "items": { - "enum": [ - "Success", - "Warning", - "Error" - ] - } - }, - "arrayWithDescription": { - "type": "array", - "items": { - "type": "integer", - "description": "Success=1,Warning=2,Error=3" - } - } - } - }, - "ModelWithReference": { - "description": "This is a model with one property containing a reference", - "type": "object", - "properties": { - "prop": { - "$ref": "#/components/schemas/ModelWithProperties" - } - } - }, - "ModelWithArray": { - "description": "This is a model with one property containing an array", - "type": "object", - "properties": { - "prop": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelWithString" - } - }, - "propWithFile": { - "type": "array", - "items": { - "type": "File" - } - }, - "propWithNumber": { - "type": "array", - "items": { - "type": "int" - } - } - } - }, - "ModelWithDictionary": { - "description": "This is a model with one property containing a dictionary", - "type": "object", - "properties": { - "prop": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "ModelWithCircularReference": { - "description": "This is a model with one property containing a circular reference", - "type": "object", - "properties": { - "prop": { - "$ref": "#/components/schemas/ModelWithCircularReference" - } - } - }, - "CompositionWithOneOf": { - "description": "This is a model with one property with a 'one of' relationship", - "type": "object", - "properties": { - "propA": { - "type": "object", - "oneOf": [ - { - "$ref": "#/components/schemas/ModelWithString" - }, - { - "$ref": "#/components/schemas/ModelWithEnum" - }, - { - "$ref": "#/components/schemas/ModelWithArray" - }, - { - "$ref": "#/components/schemas/ModelWithDictionary" - } - ] - } - } - }, - "CompositionWithOneOfAnonymous": { - "description": "This is a model with one property with a 'one of' relationship where the options are not $ref", - "type": "object", - "properties": { - "propA": { - "type": "object", - "oneOf": [ - { - "description": "Anonymous object type", - "type": "object", - "properties": { - "propA": "string" - } - }, - { - "description": "Anonymous string type", - "type": "string" - }, - { - "description": "Anonymous integer type", - "type": "integer" - } - ] - } - } - }, - "CompositionWithAnyOf": { - "description": "This is a model with one property with a 'any of' relationship", - "type": "object", - "properties": { - "propA": { - "type": "object", - "anyOf": [ - { - "$ref": "#/components/schemas/ModelWithString" - }, - { - "$ref": "#/components/schemas/ModelWithEnum" - }, - { - "$ref": "#/components/schemas/ModelWithArray" - }, - { - "$ref": "#/components/schemas/ModelWithDictionary" - } - ] - } - } - }, - "CompositionWithAnyOfAnonymous": { - "description": "This is a model with one property with a 'any of' relationship where the options are not $ref", - "type": "object", - "properties": { - "propA": { - "type": "object", - "anyOf": [ - { - "description": "Anonymous object type", - "type": "object", - "properties": { - "propA": "string" - } - }, - { - "description": "Anonymous string type", - "type": "string" - }, - { - "description": "Anonymous integer type", - "type": "integer" - } - ] - } - } - }, - "CompositionWithOneOfAndNullable": { - "description": "This is a model with one property with a 'one of' relationship", - "type": "object", - "properties": { - "propA": { - "nullable": true, - "type": "object", - "oneOf": [ - { - "type": "object", - "properties": { - "boolean": { - "type": "boolean" - } - } - }, - { - "$ref": "#/components/schemas/ModelWithEnum" - }, - { - "$ref": "#/components/schemas/ModelWithArray" - }, - { - "$ref": "#/components/schemas/ModelWithDictionary" - } - ] - } - } - }, - "CompositionWithAllOfAndNullable": { - "description": "This is a model with one property with a 'all of' relationship", - "type": "object", - "properties": { - "propA": { - "nullable": true, - "type": "object", - "allOf": [ - { - "type": "object", - "properties": { - "boolean": { - "type": "boolean" - } - } - }, - { - "$ref": "#/components/schemas/ModelWithEnum" - }, - { - "$ref": "#/components/schemas/ModelWithArray" - }, - { - "$ref": "#/components/schemas/ModelWithDictionary" - } - ] - } - } - }, - "CompositionWithAnyOfAndNullable": { - "description": "This is a model with one property with a 'any of' relationship", - "type": "object", - "properties": { - "propA": { - "nullable": true, - "type": "object", - "anyOf": [ - { - "type": "object", - "properties": { - "boolean": { - "type": "boolean" - } - } - }, - { - "$ref": "#/components/schemas/ModelWithEnum" - }, - { - "$ref": "#/components/schemas/ModelWithArray" - }, - { - "$ref": "#/components/schemas/ModelWithDictionary" - } - ] - } - } - }, - "ModelWithProperties": { - "description": "This is a model with one nested property", - "type": "object", - "required": [ - "required", - "requiredAndReadOnly", - "requiredAndNullable" - ], - "properties": { - "required": { - "type": "string" - }, - "requiredAndReadOnly": { - "type": "string", - "readOnly": true - }, - "requiredAndNullable": { - "type": "string", - "nullable": true - }, - "string": { - "type": "string" - }, - "number": { - "type": "number" - }, - "boolean": { - "type": "boolean" - }, - "reference": { - "$ref": "#/components/schemas/ModelWithString" - }, - "property with space": { - "type": "string" - }, - "default": { - "type": "string" - }, - "try": { - "type": "string" - }, - "@namespace.string": { - "type": "string", - "readOnly": true - }, - "@namespace.integer": { - "type": "integer", - "readOnly": true - } - } - }, - "ModelWithNestedProperties": { - "description": "This is a model with one nested property", - "type": "object", - "required": [ - "first" - ], - "properties": { - "first": { - "type": "object", - "required": [ - "second" - ], - "readOnly": true, - "nullable": true, - "properties": { - "second": { - "type": "object", - "required": [ - "third" - ], - "readOnly": true, - "nullable": true, - "properties": { - "third": { - "type": "string", - "required": true, - "readOnly": true, - "nullable": true - } - } - } - } - } - } - }, - "ModelWithDuplicateProperties": { - "description": "This is a model with duplicated properties", - "type": "object", - "properties": { - "prop": { - "$ref": "#/components/schemas/ModelWithString" - }, - "prop": { - "$ref": "#/components/schemas/ModelWithString" - }, - "prop": { - "$ref": "#/components/schemas/ModelWithString" - } - } - }, - "ModelWithOrderedProperties": { - "description": "This is a model with ordered properties", - "type": "object", - "properties": { - "zebra": { - "type": "string" - }, - "apple": { - "type": "string" - }, - "hawaii": { - "type": "string" - } - } - }, - "ModelWithDuplicateImports": { - "description": "This is a model with duplicated imports", - "type": "object", - "properties": { - "propA": { - "$ref": "#/components/schemas/ModelWithString" - }, - "propB": { - "$ref": "#/components/schemas/ModelWithString" - }, - "propC": { - "$ref": "#/components/schemas/ModelWithString" - } - } - }, - "ModelThatExtends": { - "description": "This is a model that extends another model", - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/ModelWithString" - }, - { - "type": "object", - "properties": { - "propExtendsA": { - "type": "string" - }, - "propExtendsB": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - ] - }, - "ModelThatExtendsExtends": { - "description": "This is a model that extends another model", - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/ModelWithString" - }, - { - "$ref": "#/components/schemas/ModelThatExtends" - }, - { - "type": "object", - "properties": { - "propExtendsC": { - "type": "string" - }, - "propExtendsD": { - "$ref": "#/components/schemas/ModelWithString" - } - } - } - ] - }, - "ModelWithPattern": { - "description": "This is a model that contains a some patterns", - "type": "object", - "required": [ - "key", - "name" - ], - "properties": { - "key": { - "maxLength": 64, - "pattern": "^[a-zA-Z0-9_]*$", - "type": "string" - }, - "name": { - "maxLength": 255, - "type": "string" - }, - "enabled": { - "type": "boolean", - "readOnly": true - }, - "modified": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "pattern": "^\\d{2}-\\d{3}-\\d{4}$" - }, - "text": { - "type": "string", - "pattern": "^\\w+$" - } + "servers": [ + { + "url": "https://{defaultHost}", + "variables": { + "defaultHost": { + "default": "discourse.example.com" } } } + ], + "components": { + "schemas": {} } }