nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Sharing

Accept an invitation

posthttps://api.nsin.ir/invites/{token}/accept

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

Joins the domain with the role the invitation carries.

The invitation binds to the address it was sent to, so accepting from a different account fails with 403 and code: "invite_email_mismatch". Accepting when you already have access is a no-op that returns already_member: true.

Path parameters

  • tokenstringrequiredpath

    The invitation token from the accept link.

Responses

200Accepted, or you already had access.

Content type: application/json

  • acceptedboolean
  • already_memberboolean

    Returned instead of accepted when you already had access.

  • domainstring
  • rolestring

    Your role on a domain. owner is implicit for the domain's creator and for global admins; the other three are grantable via sharing.

    One of: "owner" "admin" "editor" "viewer"
json
{
  "accepted": true,
  "already_member": true,
  "domain": "string",
  "role": "owner"
}
401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
403Read-only key, or the invitation was sent to a different email address.

Content type: application/json

  • errorstring
  • codestring
    One of: "invite_email_mismatch"
  • invited_emailstring

    Masked address the invitation was actually sent to.

json
{
  "error": "string",
  "code": "invite_email_mismatch",
  "invited_email": "string"
}
404The invitation does not exist, has expired, was revoked, or is used up.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
429The key exceeded its request budget (300 requests per minute by default).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "rate limit exceeded"
}

Example request

bash
curl -X POST "https://api.nsin.ir/invites/%7Btoken%7D/accept" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc