Skip to content

Invite someone to the domain

POST
/domains/{domain}/invites
curl --request POST \
--url https://api.nsin.ir/domains/example.com/invites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "role": "admin", "expires_in_hours": 1 }'

Creates an invitation and emails it.

An invite is bound to the address it was sent to: forwarding the email does not let someone else accept it. Requires members.manage.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com
Media type application/json
object
email
required
string format: email
role
required

A role that may be assigned to a member or invitation. owner is not grantable — it always follows domain ownership.

string
Allowed values: admin editor viewer
expires_in_hours

Lifetime of the invitation. Omit for the default.

integer

Invitation created, with its accept link.

Media type application/json
object
id
integer
domain_id
integer
email

The address the invitation is bound to.

string
role

A role that may be assigned to a member or invitation. owner is not grantable — it always follows domain ownership.

string
Allowed values: admin editor viewer
invited_by

User id of the inviter.

integer
expires_at
string format: date-time
max_uses
integer
uses
integer
revoked_at
string format: date-time
created_at
string format: date-time
link

The accept URL. Returned when the invitation is created or resent.

string
is_link

True for a shareable link rather than an emailed invitation.

boolean
exhausted

True when uses has reached max_uses.

boolean
Example
{
"role": "admin"
}

Invalid body, an invalid role, a missing or malformed email, an attempt to invite yourself, or an attempt to invite the domain’s owner.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Missing, malformed, revoked or expired API key — or the owning account is inactive.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

The key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

That user is already a member.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}