Skip to main content
Access control in Togul is permission-based. Each role carries a set of permission strings. When a user performs an action, Togul checks whether their role includes the required permission.
Organization roles govern access to org-level resources: members, billing, exports, projects, and flags.

Built-in roles

Togul ships with five system roles. System roles have is_system: true and cannot be modified or deleted.
RoleTypical use
ownerFull access, including billing and organization deletion
adminFull access except organization deletion
developerFlag and rule management
analystRead-only access to flags, rules, and usage
viewerRead-only access to flags

Custom roles

Create a custom role with POST /api/v1/roles. Requires the roles.create permission.
curl -X POST http://localhost:8080/api/v1/roles \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "release_manager",
    "name": "Release Manager",
    "permissions": ["flags.read", "flags.write", "rules.read", "rules.write"]
  }'
Response:
{
  "role": {
    "id": "role-uuid-here",
    "key": "release_manager",
    "name": "Release Manager",
    "is_system": false,
    "permissions": ["flags.read", "flags.write", "rules.read", "rules.write"]
  }
}
Update a custom role’s name or permissions with PATCH /api/v1/roles/{id} (requires roles.update). Delete it with DELETE /api/v1/roles/{id} (requires roles.delete).
A role that is currently assigned to one or more members cannot be deleted. The API returns 409 Conflict. Remove all member assignments first.

Role schema

FieldTypeDescription
idstring (UUID)Unique role identifier
keystringMachine-readable key (e.g. release_manager)
namestringHuman-readable display name
is_systembooleantrue for built-in roles; false for custom roles
permissionsstring[]Array of permission strings granted by this role

Invitations

When you invite a user with POST /api/v1/invitations, you specify a role_id. The invitation assigns that role to the new member when accepted.If the invited email does not belong to an existing Togul account, you can create the account inline by including name and password in the POST /api/v1/invitations/accept request body.

Available permissions

PermissionDescription
org.readView organization details
org.updateUpdate organization name and settings
org.deleteDelete the organization
PermissionDescription
members.readList organization members and pending invitations
members.inviteCreate and revoke invitations
members.updateChange a member’s role
members.removeRemove a member from the organization
PermissionDescription
roles.readList all roles
roles.createCreate a custom role
roles.updateUpdate a custom role
roles.deleteDelete a custom role
PermissionDescription
projects.readList and view projects
projects.writeCreate and update projects
projects.deleteDelete a project
PermissionDescription
environments.readView environments
environments.writeCreate environments
environments.deleteDelete environments
PermissionDescription
flags.readList and view flags
flags.writeCreate and update flags
flags.deleteDelete flags
PermissionDescription
rules.readView rules
rules.writeCreate and update rules
rules.deleteDelete rules
PermissionDescription
api_keys.readList API keys
api_keys.writeCreate and rotate API keys
api_keys.deleteRevoke API keys
PermissionDescription
billing.readView subscription details and create portal sessions
billing.writeCreate checkout sessions and modify subscriptions
PermissionDescription
exports.writeCreate and list data exports
PermissionDescription
usage.readView usage rollups
PermissionDescription
project_members.readList project members
project_members.writeAdd members and update their project roles
project_members.removeRemove members from a project

Build docs developers (and LLMs) love