Accept an invite — join the organization or the repository
POST/api/invites/{token}/accept
acceptInvite
Session-authenticated caller only. The caller must hold a verified email equal (case-insensitively) to the invited address, else 403 `forbidden` (`invite_email_mismatch`) and the invite stays pending. In one transaction: marks the invite accepted and creates or upgrades the grant — an org membership, or an account grant on the repository — never demoting an existing role, bound to the invited address (ADR 0164): it lapses if the account stops holding that address verified. An org invite then auto-joins the default team. 409 `already_exists` if the invite is no longer pending.
Requires authentication using a session cookie — see tokens and scopes.
curl
curl -X POST 'https://neosource.dev/api/invites/TOKEN/accept' \
-b 'ns_session=$NEOSOURCE_SESSION'fetch
fetch("https://neosource.dev/api/invites/TOKEN/accept", {
method: "POST",
credentials: "include",
});Path parameters
tokenrequired
Responses
200Accepted
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 404Not Found — one of: not_found
- 409Conflict — one of: already_exists, conflict
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
WorkspaceRole
Workspace membership role. Ordered low → high (`Member < Admin < Owner`) so that `if actor_role >= WorkspaceRole::Admin` reads naturally.
"member""admin""owner"
RepoRole
Repo-level role (read/write/maintain/admin). Ordered low → high so `if role >= RepoRole::Write` reads naturally.
"read""write""maintain""admin"