Accept invitation

Accept an invitation. Requires an authenticated Better Auth session whose email matches the invitation; adds the user to the org and returns the joined organization. Account creation happens beforehand through the standard login/signup flow, never here.

POST/invite/{token}/accept

Authorization

cookieAuth
better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Path Parameters

token*string
curl -X POST "https://your-instance/invite/string/accept"
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Acme Corp",
  "slug": "acme-corp",
  "role": "member",
  "permissions": [
    "org:read",
    "spaces:read"
  ],
  "createdAt": "2026-01-10T08:00:00Z",
  "deleting_at": null,
  "created": true
}
{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "about:blank",
  "title": "Email mismatch",
  "status": 403,
  "detail": "This invitation is for newuser@example.com",
  "code": "email_mismatch",
  "request_id": "req_stu901"
}
{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "Invitation not found",
  "code": "invitation_not_found",
  "request_id": "req_mno345"
}
{
  "type": "about:blank",
  "title": "Gone",
  "status": 410,
  "detail": "Invitation has already been accepted",
  "code": "invitation_accepted",
  "request_id": "req_pqr678"
}
{
  "type": "https://docs.appstrate.dev/errors/internal-error",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "An unexpected error occurred. Please try again or contact support.",
  "code": "internal_error",
  "request_id": "req_abc123"
}