Policy GroupsДобавить пользователя в группу

Добавить пользователя в группу

Создаёт PolicyGroupMembership. User-модель для членства не обязательна — userId может быть произвольной строкой (используется и для сервисов).

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/policy-groups/example_string/members" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "userId": "user-1"
}'
{
  "id": "cmr3f41z20001psp7phmyapw3",
  "groupId": "example_string",
  "userId": "user-1",
  "createdAt": "2026-07-02T11:25:15.134Z"
}
POST
/api/v1/policy-groups/{id}/members
POST
Base URLstring

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

Bearer Token
Bearer Tokenstring
Required

better-auth session token. Мобилка/сервисы. Веб использует cookie.

better-auth session token. Мобилка/сервисы. Веб использует cookie.
API Key (cookie: better-auth.session_token)
path
idstring
Required

id группы (cuid)

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. better-auth session token. Мобилка/сервисы. Веб использует cookie.

path
parameterstring
Required

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

Path Parameters

idstring
Required

id группы (cuid)

Body

application/json
userIdstring
Required
Example:
user-1

Responses