Policy GroupsСоздать группу политик

Создать группу политик

Создаёт PolicyGroup внутри существующего Vault. Пользователь может состоять в нескольких группах одного Vault — политики объединяются, deny из любой группы приоритетнее. Code уникален в рамках Vault.

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/policy-groups" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "vaultId": "example_string",
  "code": "traders",
  "name": "John Doe",
  "description": "example_string",
  "logoUri": "example_string",
  "color": "#0A84FF",
  "emoji": "🛡️"
}'
{
  "id": "cmr3f41z20001psp7phmyapw3",
  "vaultId": "example_string",
  "code": "traders",
  "name": "John Doe",
  "description": "example_string",
  "logoUri": "example_string",
  "color": "#0A84FF",
  "emoji": "👥",
  "createdAt": "2026-07-02T11:25:15.134Z",
  "updatedAt": "2026-07-02T11:25:15.134Z"
}
POST
/api/v1/policy-groups
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)
Content-Typestring
Required

The media type of the request body

Options: application/json
codestring
Required

Только буквы, цифры, _, -. Уникален в рамках Vault

logoUristring

Ссылка на логотип/иконку

Format: uri • Max length: 2048
colorstring

HEX-цвет

Pattern: ^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
emojistring

Emoji-иконка

Min length: 1 • Max length: 16
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.

Body

application/json
codestring
Required

Только буквы, цифры, _, -. Уникален в рамках Vault

Example:
traders
logoUristring

Ссылка на логотип/иконку

colorstring

HEX-цвет

Example:
#0A84FF
emojistring

Emoji-иконка

Example:
🛡️

Responses