Access Control
Penny’s access model has two kinds of principal — Users (people) and Applications (machine-to-machine clients). Each principal holds permissions, either directly or through roles. A role is a reusable bundle of permissions; it is not a principal and cannot authenticate.
Permissions
A permission is a resource + action pair:
Every permission you grant is scoped to your own business.
Resource is one of:
Action is one of:
reveal and act_as are never included in a wildcard. Grant them explicitly, and only to the principals that need them.
Each endpoint in the API reference lists the permission it requires.
You can grant a permission — directly, or by adding it to a role — only if you hold it yourself. A request that grants a permission you do not hold fails with 422 Unprocessable Entity.
Roles
A role bundles permissions so you can assign a named set instead of managing individual grants on each principal. Penny provides two kinds of role:
Preset and custom roles are assigned in exactly the same way. A preset role grants access only within your own business, the same as a custom role.
Preset roles
Discover the preset roles available to your business rather than hardcoding a list. Names and permission sets can change as Penny adds presets.
Inspect a preset’s permissions, then assign its role_id to a user or application.
Custom roles
Create a custom role with POST /access/roles/:
Use a preset role when it matches the job function. Create a custom role when you need a stable combination that no preset provides, and use direct permissions only for narrow exceptions.
Assigning access to users and applications
Users and applications can hold both directly granted permissions and a set of role_ids. Their effective access is the union of both.
role_ids accepts both preset (global_role_…) and custom (role_…) role IDs.
Setting the full set
POSTon a user or application sets its initialpermissionsandrole_ids.PATCHon a user, application, or role replaces the wholepermissionsset (and, for users and applications, the wholerole_idsset) with what you send. It does not merge. Send an empty list to remove everything; omit the field to leave it unchanged.
Because PATCH replaces the set, two concurrent updates can overwrite each other, and adding one permission requires sending the full list.
Adding or removing one grant
To add or remove a single role or permission without sending the full set, use the incremental endpoints:
The same endpoints exist under /access/users/{user_id}/.... Custom roles support incremental permission changes too:
Attaching a role or permission that is already present, or detaching one that is already absent, succeeds without making a change.
When changes take effect
Changes to roles and permissions can take up to about 5 minutes to apply to requests. Access tokens issued before the change keep working until they expire.
Rotate application secrets
An application’s client_secret is returned once, in the response to POST /access/applications/. Penny does not store it in a retrievable form and does not return it on GET or PATCH. If you lose it, or suspect it was exposed, rotate it:
Rotation returns a new one-time secret. The old secret stops working immediately, so it can no longer be used to request tokens. Access tokens already issued with the old secret stay valid until they expire.