On this page
Before you start: Admin role, or role management and Organization API tokens: change.
- In Organizations, click New role under Roles.
- Name it (Deploy), tick needed permissions (Rules and templates: apply), click Create role.
- In API tokens, create an organization token (CI deploy pipeline).
- Pick User, Deploy, short expiry and runner networks.
- Store as a masked CI secret.
Other requests return 403. Role edits apply next request.
Through the API#
Role (POST /organizations, wider than caller returns 403 role_exceeds_caller):
bash
curl -X POST -H "Authorization: Bearer $PRINCIPAL_TOKEN" \
-H "Content-Type: application/json" \
https://principal.example.com/api/v2/organizations/$ORG/roles \
-d '{"name":"Deploy","permissions":["access:read","access:apply"]}'Token (POST /api-tokens):
json
{"name":"CI deploy pipeline","role":"user",
"custom_role_id":"<role-id>","expires_at":"2026-12-16T00:00:00Z"}