Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(instance): document the closeInstance endpoint #302

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions openapi/components/paths/instances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,33 @@ paths:
$ref: ../responses/instances/InstanceResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
delete:
summary: Close Instance
tags:
- instances
operationId: closeInstance
security:
- authCookie: []
parameters:
- in: query
name: hardClose
schema:
type: boolean
required: false
description: Whether to hard close the instance. Defaults to false.
description: |-
Close an instance.

You can only close an instance if the ownerId is yourself or if the instance owner is a group and you have the `group-instance-moderate` permission.
responses:
'200':
$ref: ../responses/instances/InstanceResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
'403':
$ref: ../responses/instances/InstanceCloseForbiddenError.yaml
'404':
$ref: ../responses/instances/InstanceNotFoundError.yaml
'/instances/{worldId}:{instanceId}/shortName':
parameters:
- $ref: ../parameters.yaml#/worldId
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
description: Error response due to not being allowed to close an instance
content:
application/json:
schema:
$ref: ../../schemas/Error.yaml
examples:
Not Allowed to Close Instance Example:
value:
error:
message: "You're not allowed to close this instance․"
status_code: 403
Instance Already Closed Example:
value:
error:
message: "You're not allowed to close an already closed instance․"
status_code: 403
9 changes: 9 additions & 0 deletions openapi/components/schemas/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ properties:
type: array
items:
$ref: ./LimitedUser.yaml
nonce:
type: string
closedAt:
format: date-time
type: string
nullable: true
hardClose:
type: boolean
nullable: true
required:
- active
- canRequestInvite
Expand Down
Loading