foliot docs

API reference / Workspaces / Make a workspace and invite its first owner

Make a workspace and invite its first owner

POST/workspaces

Authenticate with an operator token.

Operator token only. Makes the workspace and a pending owner invitation for firstOwnerEmail in one step, so there is never a workspace with nobody on the way in. The person joins, as an owner, when they sign in with that address verified; nobody else is added by this call, and nobody is added by it at once. When the server has an email service configured, an address that has no account is emailed an invitation to sign up; an address that already has an account is sent nothing, and the status and body are the same either way (the time taken is not: it needs fewer calls to Clerk). 409 if the slug is taken. 503 if the email service could not be reached: nothing was made, and either nothing was sent or the message says an email may have been, in which case retrying will not send a second. The workspace’s history starts with who made it. When the server has no email service configured, the invitation is only recorded and nothing is sent.

Request body

firstOwnerEmail
string
REQUIRED

The address of the person who will own the workspace. They are invited as an owner, and join when they sign in with this address verified.

max length 254

name
string
REQUIRED

What people see. 1 to 100 characters.

min length 1 · max length 100

slug
string
OPTIONAL

Lower-case letters, digits and hyphens, starting with a letter or digit; unique. Made from the name when left out.

max length 63

Responses

201 object Created
400 Error Invalid request.
401 Error Missing, malformed or unknown bearer token.
403 Error The token is valid but not permitted on this route.
409 Error Conflicts with existing state.
503 Error A dependency this route needs is unreachable.