Accept an invite
Identity module
POST/invites/acceptinvites.accept
Accepts an invite for the confirmed sign-in it was sent to, through `app.accept_invite`: joins the organization, or reuses the active membership, and receives the role. Refused with 422 when the token is invalid or the inviter no longer holds `org.members.invite`. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requires the capability me.account.write.
- OAuth scopes: me.
- Send an Idempotency-Key header. A replay with the same key returns the original response.
- Error statuses: 400, 401, 409, 422, 429. Errors are RFC 9457 problem details.
Request body: InviteTokenRequest
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | Yes | Invite token from the invitation email. Sent in the body, never in a URL.Constraints: length 1 to any |
{
"token": "xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"
}Response 200: AcceptInviteResult
| Field | Type | Required | Description |
|---|---|---|---|
| membership_id | string (uuid) | Yes | Identifier of the membership joined or reused. |
{
"membership_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}Code samples
curl -X POST "$XOS_BASE_URL/invites/accept" \
-H "Authorization: Bearer $XOS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"token":"xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"}'const { data } = await xos.invites.accept({
"token": "xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"
});response = xos.invites.accept({"token": "xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"})xos invites accept --data '{"token":"xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"}'