Skip to content
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
73 changes: 73 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,79 @@ paths:
"404":
$ref: '#/components/responses/NotFound'

/users/{id}/resend_invitation:
post:
tags: [Users]
summary: Resend a colleague's invitation
description: |
Sends a new invitation email to someone who was invited to an Organisation but hasn't yet set
their password (Manage Colleagues shows them as "Invited, not yet accepted"). The new link stops
the earlier one working. Makerble never emails a password: the invitation has a link where the
person sets their own, and this response never contains the link or its token.

Only an Organisation Admin of an Organisation the person is a colleague in can do this, as on
the Manage Colleagues page. Pass `organisation_id` to choose the Organisation the invitation is
for; without it, the first such Organisation is used. An address can be sent at most 3 new links
an hour.
operationId: resendInvitation
security: [{tokenAuth: []}]
parameters:
- $ref: '#/components/parameters/ResourceId'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
organisation_id:
type: integer
description: The Organisation (Charity) to invite them into. Optional.
example:
organisation_id: 512
responses:
"200":
description: A new invitation is being sent
content:
application/json:
schema:
type: object
required: [id, email, organisation_id, invitation_status, message]
properties:
id:
type: integer
email:
type: string
organisation_id:
type: integer
invitation_status:
type: string
enum: [sent]
message:
type: string
example:
id: 4012
email: thandi@example.org
organisation_id: 512
invitation_status: sent
message: A new invitation is on its way. The earlier link no longer works.
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'
"429":
description: The address has been sent 3 new links in the last hour
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: This colleague has been sent 3 new links in the last hour. Try again later.

/users/permissions:
get:
tags: [Users]
Expand Down
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,17 @@ function buildDocsPage() {
{ code: "200", cls: "response-2xx", desc: "User record" },
{ code: "404", cls: "response-4xx", desc: "Not found" }
])}
${endpointCard("POST", "/users/{id}/resend_invitation", "Resend a colleague's invitation", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "User ID of someone invited but not yet accepted" },
{ name: "organisation_id", in: "body", type: "integer", required: false, desc: "The Organisation to invite them into. Without it, the first Organisation they're a colleague in that you're an Organisation Admin of" }
], [
{ code: "200", cls: "response-2xx", desc: "<code>{id, email, organisation_id, invitation_status: \"sent\", message}</code>. Never the link or its token" },
{ code: "401", cls: "response-4xx", desc: "Not authenticated" },
{ code: "403", cls: "response-4xx", desc: "You aren't an Organisation Admin of that Organisation" },
{ code: "404", cls: "response-4xx", desc: "Not found, or someone outside your Organisations" },
{ code: "422", cls: "response-4xx", desc: "They have already set their password" },
{ code: "429", cls: "response-4xx", desc: "They have been sent 3 new links in the last hour" }
], "Sends a new invitation to someone shown as <b>Invited, not yet accepted</b> on Manage Colleagues, as its <b>Resend invitation</b> button does. Makerble never emails a password: the invitation has a link where they set their own. The new link stops the earlier one working.")}
${endpointCard("POST", "/users", "Create a new User", false, [], [
{ code: "200", cls: "response-2xx", desc: "User created — returns id and email" },
{ code: "422", cls: "response-4xx", desc: "Validation failed (check password requirements)" }
Expand Down
Loading