Skip to content

Commit

Permalink
feat(instance): document the closeInstance endpoint (#302)
Browse files Browse the repository at this point in the history
Document the closeInstance endpoint.
  • Loading branch information
ttshivers authored Apr 15, 2024
1 parent 3541a77 commit 5f78f2c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
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

0 comments on commit 5f78f2c

Please sign in to comment.