Accept an organization invitation by its token.
POST
/_torii/organizations/invitations/accept
const url = 'https://your-app.torii.so/_torii/organizations/invitations/accept';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"token":"example"}'};
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://your-app.torii.so/_torii/organizations/invitations/accept \ --header 'Content-Type: application/json' \ --data '{ "token": "example" }'Request Body required
Section titled “Request Body required ” Media type application/json
object
token
required
string
Example generated
{ "token": "example"}Responses
Section titled “ Responses ”OK
Media type application/json
object
id
required
string format: uuid
name
required
string
role
required
Caller’s role key in this org (e.g. admin | member).
string
roleName
Human-readable display name of the caller’s role, from the org’s bound role set.
string | null
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "role": "example", "roleName": "example"}