|
|
|
|
@ -16,7 +16,7 @@ info:
|
|
|
|
|
title: Matrix Client-Server Administration API
|
|
|
|
|
version: 1.0.0
|
|
|
|
|
paths:
|
|
|
|
|
"/admin/whois/{userId}":
|
|
|
|
|
"/v3/admin/whois/{userId}":
|
|
|
|
|
get:
|
|
|
|
|
summary: Gets information about a particular user.
|
|
|
|
|
description: |-
|
|
|
|
|
@ -107,6 +107,391 @@ paths:
|
|
|
|
|
}
|
|
|
|
|
tags:
|
|
|
|
|
- Server administration
|
|
|
|
|
"/v1/admin/suspend/{userId}":
|
|
|
|
|
get:
|
|
|
|
|
summary: Gets information about the suspended status of a particular user.
|
|
|
|
|
x-addedInMatrixVersion: "1.18"
|
|
|
|
|
description: |-
|
|
|
|
|
Gets information about the suspended status of a particular server-local user.
|
|
|
|
|
|
|
|
|
|
The user calling this endpoint MUST be a server admin.
|
|
|
|
|
|
|
|
|
|
In order to prevent user enumeration, servers MUST ensure that authorization is checked
|
|
|
|
|
prior to trying to do account lookups.
|
|
|
|
|
operationId: getAdminSuspendUser
|
|
|
|
|
security:
|
|
|
|
|
- accessTokenQuery: []
|
|
|
|
|
- accessTokenBearer: []
|
|
|
|
|
parameters:
|
|
|
|
|
- in: path
|
|
|
|
|
name: userId
|
|
|
|
|
description: The user to look up.
|
|
|
|
|
required: true
|
|
|
|
|
example: "@peter:rabbit.rocks"
|
|
|
|
|
schema:
|
|
|
|
|
type: string
|
|
|
|
|
format: mx-user-id
|
|
|
|
|
pattern: "^@"
|
|
|
|
|
|
|
|
|
|
responses:
|
|
|
|
|
"200":
|
|
|
|
|
description: The lookup was successful.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
suspended:
|
|
|
|
|
type: boolean
|
|
|
|
|
description: Whether the target account is suspended.
|
|
|
|
|
example: true
|
|
|
|
|
required:
|
|
|
|
|
- suspended
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"suspended": true,
|
|
|
|
|
}
|
|
|
|
|
"400":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID does not belong to the local server. The errcode is `M_INVALID_PARAM`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_INVALID_PARAM",
|
|
|
|
|
"error": "User does not belong to the local server."
|
|
|
|
|
}
|
|
|
|
|
"403":
|
|
|
|
|
description: |-
|
|
|
|
|
The requesting user is not a server administrator, or the target user is another
|
|
|
|
|
administrator. The errcode is `M_FORBIDDEN`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_FORBIDDEN",
|
|
|
|
|
"error": "Requesting user is not a server administrator."
|
|
|
|
|
}
|
|
|
|
|
"404":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID is not found, or is deactivated. The errcode is `M_NOT_FOUND`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_NOT_FOUND",
|
|
|
|
|
"error": "User not found."
|
|
|
|
|
}
|
|
|
|
|
tags:
|
|
|
|
|
- Server administration
|
|
|
|
|
put:
|
|
|
|
|
summary: Set the suspended status of a particular user.
|
|
|
|
|
x-addedInMatrixVersion: "1.18"
|
|
|
|
|
description: |-
|
|
|
|
|
Sets the suspended status of a particular server-local user.
|
|
|
|
|
|
|
|
|
|
The user calling this endpoint MUST be a server admin. The client SHOULD check that the user
|
|
|
|
|
is allowed to suspend other users at the [`GET /capabilities`](/client-server-api/#get_matrixclientv3capabilities)
|
|
|
|
|
endpoint prior to using this endpoint.
|
|
|
|
|
|
|
|
|
|
In order to prevent user enumeration, servers MUST ensure that authorization is checked
|
|
|
|
|
prior to trying to do account lookups.
|
|
|
|
|
operationId: setAdminSuspendUser
|
|
|
|
|
security:
|
|
|
|
|
- accessTokenQuery: []
|
|
|
|
|
- accessTokenBearer: []
|
|
|
|
|
parameters:
|
|
|
|
|
- in: path
|
|
|
|
|
name: userId
|
|
|
|
|
description: The user to change the suspended status of.
|
|
|
|
|
required: true
|
|
|
|
|
example: "@peter:rabbit.rocks"
|
|
|
|
|
schema:
|
|
|
|
|
type: string
|
|
|
|
|
format: mx-user-id
|
|
|
|
|
pattern: "^@"
|
|
|
|
|
requestBody:
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
suspended:
|
|
|
|
|
type: boolean
|
|
|
|
|
description: Whether to suspend the target account.
|
|
|
|
|
example: true
|
|
|
|
|
required:
|
|
|
|
|
- suspended
|
|
|
|
|
examples:
|
|
|
|
|
request:
|
|
|
|
|
value: {
|
|
|
|
|
"suspended": true,
|
|
|
|
|
}
|
|
|
|
|
required: true
|
|
|
|
|
|
|
|
|
|
responses:
|
|
|
|
|
"200":
|
|
|
|
|
description: The action was successful.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
suspended:
|
|
|
|
|
type: boolean
|
|
|
|
|
description: Whether the target account is suspended.
|
|
|
|
|
example: true
|
|
|
|
|
required:
|
|
|
|
|
- suspended
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"suspended": true,
|
|
|
|
|
}
|
|
|
|
|
"400":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID does not belong to the local server. The errcode is `M_INVALID_PARAM`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_INVALID_PARAM",
|
|
|
|
|
"error": "User does not belong to the local server."
|
|
|
|
|
}
|
|
|
|
|
"403":
|
|
|
|
|
description: |-
|
|
|
|
|
The requesting user is not a server administrator, is trying to suspend their own
|
|
|
|
|
account, or the target user is another administrator. The errcode is `M_FORBIDDEN`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_FORBIDDEN",
|
|
|
|
|
"error": "Requesting user is not a server administrator."
|
|
|
|
|
}
|
|
|
|
|
"404":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID is not found, or is deactivated. The errcode is `M_NOT_FOUND`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_NOT_FOUND",
|
|
|
|
|
"error": "User not found."
|
|
|
|
|
}
|
|
|
|
|
tags:
|
|
|
|
|
- Server administration
|
|
|
|
|
"/v1/admin/lock/{userId}":
|
|
|
|
|
get:
|
|
|
|
|
summary: Gets information about the locked status of a particular user.
|
|
|
|
|
x-addedInMatrixVersion: "1.18"
|
|
|
|
|
description: |-
|
|
|
|
|
Gets information about the locked status of a particular server-local user.
|
|
|
|
|
|
|
|
|
|
The user calling this endpoint MUST be a server admin.
|
|
|
|
|
|
|
|
|
|
In order to prevent user enumeration, servers MUST ensure that authorization is checked
|
|
|
|
|
prior to trying to do account lookups.
|
|
|
|
|
operationId: getAdminLockUser
|
|
|
|
|
security:
|
|
|
|
|
- accessTokenQuery: []
|
|
|
|
|
- accessTokenBearer: []
|
|
|
|
|
parameters:
|
|
|
|
|
- in: path
|
|
|
|
|
name: userId
|
|
|
|
|
description: The user to look up.
|
|
|
|
|
required: true
|
|
|
|
|
example: "@peter:rabbit.rocks"
|
|
|
|
|
schema:
|
|
|
|
|
type: string
|
|
|
|
|
format: mx-user-id
|
|
|
|
|
pattern: "^@"
|
|
|
|
|
|
|
|
|
|
responses:
|
|
|
|
|
"200":
|
|
|
|
|
description: The lookup was successful.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
locked:
|
|
|
|
|
type: boolean
|
|
|
|
|
description: Whether the target account is locked.
|
|
|
|
|
required:
|
|
|
|
|
- locked
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"locked": true,
|
|
|
|
|
}
|
|
|
|
|
"400":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID does not belong to the local server. The errcode is `M_INVALID_PARAM`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_INVALID_PARAM",
|
|
|
|
|
"error": "User does not belong to the local server."
|
|
|
|
|
}
|
|
|
|
|
"403":
|
|
|
|
|
description: |-
|
|
|
|
|
The requesting user is not a server administrator, or the target user is another
|
|
|
|
|
administrator. The errcode is `M_FORBIDDEN`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_FORBIDDEN",
|
|
|
|
|
"error": "Requesting user is not a server administrator."
|
|
|
|
|
}
|
|
|
|
|
"404":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID is not found, or is deactivated. The errcode is `M_NOT_FOUND`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_NOT_FOUND",
|
|
|
|
|
"error": "User not found."
|
|
|
|
|
}
|
|
|
|
|
tags:
|
|
|
|
|
- Server administration
|
|
|
|
|
put:
|
|
|
|
|
summary: Set the locked status of a particular user.
|
|
|
|
|
x-addedInMatrixVersion: "1.18"
|
|
|
|
|
description: |-
|
|
|
|
|
Sets the locked status of a particular server-local user.
|
|
|
|
|
|
|
|
|
|
The user calling this endpoint MUST be a server admin. The client SHOULD check that the user
|
|
|
|
|
is allowed to lock other users at the [`GET /capabilities`](/client-server-api/#get_matrixclientv3capabilities)
|
|
|
|
|
endpoint prior to using this endpoint.
|
|
|
|
|
|
|
|
|
|
In order to prevent user enumeration, servers MUST ensure that authorization is checked
|
|
|
|
|
prior to trying to do account lookups.
|
|
|
|
|
operationId: setAdminLockUser
|
|
|
|
|
security:
|
|
|
|
|
- accessTokenQuery: []
|
|
|
|
|
- accessTokenBearer: []
|
|
|
|
|
parameters:
|
|
|
|
|
- in: path
|
|
|
|
|
name: userId
|
|
|
|
|
description: The user to change the locked status of.
|
|
|
|
|
required: true
|
|
|
|
|
example: "@peter:rabbit.rocks"
|
|
|
|
|
schema:
|
|
|
|
|
type: string
|
|
|
|
|
format: mx-user-id
|
|
|
|
|
pattern: "^@"
|
|
|
|
|
requestBody:
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
locked:
|
|
|
|
|
type: boolean
|
|
|
|
|
description: Whether to lock the target account.
|
|
|
|
|
example: true
|
|
|
|
|
required:
|
|
|
|
|
- locked
|
|
|
|
|
examples:
|
|
|
|
|
request:
|
|
|
|
|
value: {
|
|
|
|
|
"locked": true,
|
|
|
|
|
}
|
|
|
|
|
required: true
|
|
|
|
|
|
|
|
|
|
responses:
|
|
|
|
|
"200":
|
|
|
|
|
description: The action was successful.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
locked:
|
|
|
|
|
type: boolean
|
|
|
|
|
description: Whether the target account is locked.
|
|
|
|
|
example: true
|
|
|
|
|
required:
|
|
|
|
|
- locked
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"locked": true,
|
|
|
|
|
}
|
|
|
|
|
"400":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID does not belong to the local server. The errcode is `M_INVALID_PARAM`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_INVALID_PARAM",
|
|
|
|
|
"error": "User does not belong to the local server."
|
|
|
|
|
}
|
|
|
|
|
"403":
|
|
|
|
|
description: |-
|
|
|
|
|
The requesting user is not a server administrator, is trying to lock their own
|
|
|
|
|
account, or the target user is another administrator. The errcode is `M_FORBIDDEN`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_FORBIDDEN",
|
|
|
|
|
"error": "Requesting user is not a server administrator."
|
|
|
|
|
}
|
|
|
|
|
"404":
|
|
|
|
|
description: |-
|
|
|
|
|
The user ID is not found, or is deactivated. The errcode is `M_NOT_FOUND`.
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_NOT_FOUND",
|
|
|
|
|
"error": "User not found."
|
|
|
|
|
}
|
|
|
|
|
tags:
|
|
|
|
|
- Server administration
|
|
|
|
|
servers:
|
|
|
|
|
- url: "{protocol}://{hostname}{basePath}"
|
|
|
|
|
variables:
|
|
|
|
|
@ -118,7 +503,7 @@ servers:
|
|
|
|
|
hostname:
|
|
|
|
|
default: localhost:8008
|
|
|
|
|
basePath:
|
|
|
|
|
default: /_matrix/client/v3
|
|
|
|
|
default: /_matrix/client
|
|
|
|
|
components:
|
|
|
|
|
securitySchemes:
|
|
|
|
|
accessTokenQuery:
|
|
|
|
|
|