Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

PUT /roles

Owner administration or the explicitly assigned business permission is required. Actions are scoped to the signed-in branch. A request cannot be approved by its creator. Locked sessions return 423.

PUT/api/v1/security/roles
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Request body
requiredapplication/json
idstringrequired
matches ^[a-z][a-z0-9_]{1,49}$
namestringrequired
min length 2 · max length 80
permissionsstring[]required
max items 50
activebooleanrequired
Responses
200

Operation completed

any
201

Record created

400

Invalid request

detailstringrequired
401

Session expired or revoked

detailstringrequired
403

Permission denied or self-approval

detailstringrequired
409

Record changed or no longer actionable

detailstringrequired
423

Register locked

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X PUT 'http://localhost:8000/api/v1/security/roles' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "string",
  "name": "string",
  "permissions": [
    "sales.prepare"
  ],
  "active": true
}'
Response
Operation completed