UsersAssign a role to a user

Assign a role to a user

An admin sets a user's role: admin (full access to Vault configuration, registries, and policies) or user. This is how the second and subsequent admins are assigned; the first one is created by scripts/create-admin.ts.

curl -X PATCH "https://policy-engine-rest.ezig.workers.dev/api/v1/users/example_string/role" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "role": "admin"
}'
{
  "id": "example_string",
  "email": "user@example.com",
  "role": "example_string"
}
PATCH
/api/v1/users/{id}/role
PATCH
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
rolestring
Required
Options: admin, user
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.

Path Parameters

Body

application/json
rolestring
Required
Allowed values:adminuser

Responses

idstring
Required
emailstring
Required
rolestring
Required