Send Invitation
const url = 'https://example.com/v1/invitations';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"email":"example","role":"viewer"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/invitations \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "email": "example", "role": "viewer" }'Invite someone by email to the organization, or to one workspace with
project_id, at a role. Needs members:write, and the authority to
give that role there (never above the creator’s own). Someone already in
the organization is given a role with PUT /v1/members/{user_id}
instead (400).
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.
A workspace of the organization; omit it for the organization itself. A workspace key names its own workspace.
Request Body required
Section titled “Request Body required ”POST /v1/invitations: invite someone by email at a role (to the
workspace the query’s project_id names, as a guest, else to the
organization).
object
Responses
Section titled “ Responses ”The invitation, sent
A pending invitation.
object
The space it grants a role on
The role it grants there
Example
{ "space_role": "viewer", "space_kind": "organization"}Refused by the role rules
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Invalid or missing API key
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}The key lacks members:write, or its creator may not give or take this role here (nobody grants above their own role)
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Not found or not readable
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}The organization’s last owner stays
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Validation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}