InvitationsAccept an invitation (debug)

Accept an invitation (debug)

For debugging/curl tests. In the real flow, acceptance happens automatically in databaseHooks.user.create.after: the pending invitation is found by email, PolicyGroupMemberships are created, and the invitation is marked accepted. This endpoint runs the same logic for an existing User.

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/invitations/accept-debug" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "user": {
    "id": "example_string",
    "email": "user@example.com"
  }
}'
{
  "invitation": {
    "id": "cmr3f41z20001psp7phmyapw3",
    "vaultId": "example_string",
    "email": "new@user.com",
    "status": "pending",
    "createdById": "example_string",
    "acceptedAt": "2026-07-02T11:25:15.134000Z",
    "acceptedUserId": "example_string",
    "revokedAt": "2026-07-02T11:25:15.134000Z",
    "createdAt": "2026-07-02T11:25:15.134000Z",
    "updatedAt": "2026-07-02T11:25:15.134000Z",
    "token": "a94aad35339dd6d3a5ca35e1b1ef2f78"
  },
  "membershipsCreated": 42
}
POST
/api/v1/invitations/accept-debug
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Session token. Mobile/services. The web uses a cookie.

Session token. Mobile/services. The web uses a cookie.
API Key (cookie: session_token)
session_tokenstring
Required

API key (sent in cookie)

Content-Typestring
Required

The media type of the request body

Options: application/json
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Session token. Mobile/services. The web uses a cookie.

path
parameterstring
Required

API Key for authentication. Provide your API key in the cookie.

Body

application/json
userobject
Required

Responses

invitationobject
Required
membershipsCreatedinteger
Required