Invite someone to a team
curl --request POST \
--url https://my.server.express/api/v1/user/teams/{id}/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"role": "VIEWER"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '[email protected]', role: 'VIEWER'})
};
fetch('https://my.server.express/api/v1/user/teams/{id}/invites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/teams/{id}/invites"
payload = {
"email": "[email protected]",
"role": "VIEWER"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"email": "[email protected]",
"role": "ADMIN",
"expired": false,
"expiresAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Teams
Invite someone to a team
OWNER or ADMIN only. Emails a single-use link (32 random bytes, stored only as SHA-256) valid for 7 days. Re-inviting the same address replaces the old invite and token. 409 when inviting yourself, someone already in the team, past 50 pending invites, or racing another invite for the same address. Writes a TEAM_INVITE_SENT audit entry.
POST
/
v1
/
user
/
teams
/
{id}
/
invites
Invite someone to a team
curl --request POST \
--url https://my.server.express/api/v1/user/teams/{id}/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"role": "VIEWER"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '[email protected]', role: 'VIEWER'})
};
fetch('https://my.server.express/api/v1/user/teams/{id}/invites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/teams/{id}/invites"
payload = {
"email": "[email protected]",
"role": "VIEWER"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"email": "[email protected]",
"role": "ADMIN",
"expired": false,
"expiresAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Path Parameters
Team id.
Body
application/json