InvitationsCreate an invitation

Create an invitation

Creates a pending invitation in a Vault with a list of groups the user will join on accept. Validation: the email is free (no User and no active invitation), and all groups belong to the Vault. Registration in the system is possible ONLY by invitation; a hook blocks sign-up without one. Invitations don't expire (MVP).

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/invitations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "vaultId": "example_string",
  "email": "new@user.com",
  "groupIds": [
    "example_string"
  ],
  "createdById": "example_string"
}'
{
  "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",
  "groupMemberships": [
    {
      "id": "cmr3f41z20001psp7phmyapw3",
      "invitationId": "example_string",
      "groupId": "example_string",
      "createdAt": "2026-07-02T11:25:15.134000Z",
      "group": {
        "id": "example_string",
        "code": "traders",
        "name": "John Doe"
      }
    }
  ]
}
POST
/api/v1/invitations
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
emailstring
Required
Format: email • Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
groupIdsarray
Required

Groups the user will join on accept

createdByIdstring

userId of the inviter; not set for system invitations

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
emailstring
Required
Example:
new@user.com
groupIdsarray
Required

Groups the user will join on accept

createdByIdstring

userId of the inviter; not set for system invitations

Responses