Member VisibilityОткрыть видимость участников (admin)

Открыть видимость участников (admin)

Кому (subjectType user|group) и кого он видит (scope self|group|vault). scope="self" для group-субъекта — участники этой же группы; для user-субъекта — участники всех его групп. scope="group" требует targetGroupId. Повторный грант той же пары реактивирует отозванный.

curl -X POST "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/visibility-grants" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "subjectType": "user",
  "subjectUserId": "example_string",
  "subjectGroupId": "example_string",
  "scope": "self",
  "targetGroupId": "example_string"
}'
{
  "id": "cmr3f41z20001psp7phmyapw3",
  "vaultId": "example_string",
  "subjectType": "example_string",
  "subjectUserId": "example_string",
  "subjectGroupId": "example_string",
  "subject": {
    "id": "example_string",
    "name": "John Doe",
    "username": "John Doe",
    "image": "example_string",
    "color": "example_string",
    "emoji": "example_string"
  },
  "subjectGroup": {
    "id": "example_string",
    "name": "John Doe",
    "color": "example_string",
    "emoji": "example_string"
  },
  "scope": "example_string",
  "targetGroupId": "example_string",
  "targetGroup": {
    "id": "example_string",
    "name": "John Doe",
    "color": "example_string",
    "emoji": "example_string"
  },
  "status": "example_string",
  "grantorId": "example_string",
  "createdAt": "2026-07-02T11:25:15.134Z"
}
POST
/api/v1/vaults/{code}/visibility-grants
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
codestring
Required

Уникальный код Vault'а (slug)

Content-Typestring
Required

The media type of the request body

Options: application/json
subjectTypestring
Required
Options: user, group
subjectUserIdstring

При subjectType="user"

subjectGroupIdstring

При subjectType="group"

scopestring
Required

Кого видит субъект: "self" — участников своей группы; "group" — указанной группы (targetGroupId); "vault" — всех участников Vault'а

Options: self, group, vault
targetGroupIdstring

Обязателен при scope="group"

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

codestring
Required

Уникальный код Vault'а (slug)

Example:
demo_vault

Body

application/json
subjectTypestring
Required
Allowed values:usergroup
subjectUserIdstring

При subjectType="user"

subjectGroupIdstring

При subjectType="group"

scopestring
Required

Кого видит субъект: "self" — участников своей группы; "group" — указанной группы (targetGroupId); "vault" — всех участников Vault'а

Allowed values:selfgroupvault
targetGroupIdstring

Обязателен при scope="group"

Responses