curl --request POST \
--url https://app.trustivan.com/api/v1/members/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com"
}
'import requests
url = "https://app.trustivan.com/api/v1/members/invitations"
payload = { "email": "jsmith@example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jsmith@example.com'})
};
fetch('https://app.trustivan.com/api/v1/members/invitations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/members/invitations"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Invite somebody to the organization
An invitation rather than “add a user by email”, because adding somebody by address grants authority to whoever eventually controls that mailbox. The invitation splits the grant in two: the administrator decides what is offered and to whom, and the recipient proves control of the address by presenting a token that was only ever sent there. Neither half is a grant on its own.
The token is in the response and nowhere else, ever. It is stored only as a SHA-256 digest, so a lost invitation is revoked and re-issued rather than recovered.
owner is refused. Ownership transfer can leave a tenant with an owner
who never agreed to be one, so it is an operation performed on somebody
already in the organization, not one offered by email. An administrator
also cannot offer a role above their own.
The authority is re-checked when the invitation is ACCEPTED, not only here: if the issuing administrator is demoted in between, the invitation confers only what they may still confer.
curl --request POST \
--url https://app.trustivan.com/api/v1/members/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com"
}
'import requests
url = "https://app.trustivan.com/api/v1/members/invitations"
payload = { "email": "jsmith@example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jsmith@example.com'})
};
fetch('https://app.trustivan.com/api/v1/members/invitations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/members/invitations"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
Response
The invitation, its token (shown once), accept_url (the dashboard accept page carrying the token) and emailed (whether the invitation mail was queued; false means the admin sends the link) and organization_name.