Skip to content

Invite somebody

POST
/orgs/{org}/invitations
curl --request POST \
--url https://api.sloose.com/orgs/org_9f3c/invitations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "role": "operator" }'

Sends an invitation to an email address with a role, valid for seven days. The person accepts it in the account app after signing in with that address — by Zoho or by magic link — and joins the org at that role.

You cannot grant a role above your own, or invite an address that already has an open invitation. Somebody who is already a member is not invited; change their role instead.

org
required

The org id the session was issued for. A token for one org can never read another.

string
Example
org_9f3c

The org id the session was issued for. A token for one org can never read another.

Media typeapplication/json
object
email
required

The address to invite. The invitation is for this address only.

string format: email
role
string
default: operator
Allowed values: operator builder admin

Sent.

Media typeapplication/json
object
invitation
required
object
id
required
string
email
required
string
role
required
string
Allowed values: operator builder admin
status
required
string
Allowed values: pending accepted revoked expired
expiresAt
required
string
invitedByUserId
required
string
invitedByEmail
required
string
acceptedAt
required
string | null
revokedAt
required
string | null
createdAt
required
string
Example
{
"invitation": {
"role": "operator",
"status": "pending"
}
}

The request body did not match the schema. issues carries the Zod issue list.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The bearer’s role is too low, or it was issued for a different org.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The address already has an open invitation (code: ALREADY_INVITED) or is already a member (code: ALREADY_MEMBER); or the role is above yours (code: OUTRANKED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}