Access checks
One decision for “may this principal do this to that resource?”, with a reason an app or an agent can act on. Every answer names its config version.
Access checks explains the order a check takes and what each reason means.
Paths are relative to https://api.agentpost.tools/v1/identity, and every request follows the API basics. Who may call explains each kind of caller.
Check access
POST /access/check
Allowed or denied, with the reason. explain: true adds each step; audit: true records a denial in the change feed.
- Who may call: Your server or a signed-in principal.
- Access: A principal checks itself, and a principal with a delegated token checks within its delegation. A trusted caller names any
principalId, and may name adelegateIdanddelegationId. - Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - SDK:
client.access.check(request) - Idempotency-Key: not taken. A check reads the current permissions, so IdentityHound runs it on every request and it takes no
Idempotency-Key. Withaudit: true, a retried denial is recorded again.
Body
| Name | Type | Required | Description |
|---|---|---|---|
principalId |
string |
No | A principal ID, prn_…. |
delegateId |
string |
No | The delegate that would act for principalId under a delegation. The check then holds the delegate to that delegation. |
delegationId |
string |
No | The delegation the delegate acts under, dlg_…. Left out, the check uses the newest active delegation from the principal to the delegateId that covers the permission, among those for the resource’s workspace or for none. |
action |
string |
Yes | An action of the resource type, such as “edit” or “transaction.view”. |
resource |
object |
Yes | |
resource. |
string |
Yes | |
resource. |
string |
Yes | |
resource. |
string |
No | The workspace the resource belongs to. Workspace roles count only when it is set, so leave it out only for a resource outside any workspace. |
explain |
boolean |
No | |
audit |
boolean |
No |
Response
200 OK, with CheckResponse.
Errors
forbidden(403)
Any operation can also answer with the codes Conventions lists.
Check access in a batch
POST /access/check-batch
Up to 100 checks in one call, answered in order.
- Who may call: Your server or a signed-in principal.
- Access: Each check follows the rules of
POST /access/check. - Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - SDK:
client.access.checkBatch(checks) - Idempotency-Key: not taken. A check reads the current permissions, so IdentityHound runs it on every request and it takes no
Idempotency-Key. Withaudit: true, a retried denial is recorded again.
Body
| Name | Type | Required | Description |
|---|---|---|---|
checks |
object[] |
Yes | 1–100 items. |
checks[]. |
string |
No | A principal ID, prn_…. |
checks[]. |
string |
No | The delegate that would act for principalId under a delegation. The check then holds the delegate to that delegation. |
checks[]. |
string |
No | The delegation the delegate acts under, dlg_…. Left out, the check uses the newest active delegation from the principal to the delegateId that covers the permission, among those for the resource’s workspace or for none. |
checks[]. |
string |
Yes | An action of the resource type, such as “edit” or “transaction.view”. |
checks[]. |
object |
Yes | |
checks[]. |
string |
Yes | |
checks[]. |
string |
Yes | |
checks[]. |
string |
No | The workspace the resource belongs to. Workspace roles count only when it is set, so leave it out only for a resource outside any workspace. |
checks[]. |
boolean |
No | |
checks[]. |
boolean |
No |
Response
200 OK, with CheckBatchResponse.
Errors
forbidden(403)
Any operation can also answer with the codes Conventions lists.
List permissions on a resource
GET /access/permissions
Every permission a principal holds on one resource. An agent calls this to find what it may do. An action that would be denied for any reason, including a missing entitlement, is left out; POST /access/check says why.
- Who may call: Your server or a signed-in principal.
- Access: A principal asks about itself; a trusted caller names any
principalId. - Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - SDK:
client.access.permissions(query)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
principalId |
string |
No | A principal ID, prn_…. |
resourceType |
string |
Yes | |
resourceId |
string |
Yes | |
workspaceId |
string |
No | The workspace the resource belongs to. Workspace roles count only when it is set. |
Response
200 OK, with PermissionsResponse.
Errors
forbidden(403)
Any operation can also answer with the codes Conventions lists.
The CheckResponse object
| Name | Type | Present | Description |
|---|---|---|---|
allowed |
boolean |
Always | |
reason |
string |
Always | One of "project_role", "workspace_role", "resource_role", "unknown_permission", "principal_inactive", "actor_inactive", "delegation_missing", "delegation_expired", "delegation_scope", "delegation_workspace", "credential_restricted", "no_access", "workspace_archived", or "entitlement_missing". |
matched |
object |
When set | |
matched. |
string |
When set | |
matched. |
string |
When set | A membership ID, mem_…. |
matched. |
string |
When set | A resource role ID, rro_…. |
matched. |
string |
When set | A grant ID, grt_…. |
matched. |
string |
When set | A delegation ID, dlg_…. |
configVersion |
number |
Always | |
steps |
object[] |
When set | |
steps[]. |
string |
Always | |
steps[]. |
string |
Always | One of "pass", "fail", or "skip". |
steps[]. |
string |
When set |
The CheckBatchResponse object
| Name | Type | Present | Description |
|---|---|---|---|
results |
CheckResponse array |
Always |
The PermissionsResponse object
| Name | Type | Present | Description |
|---|---|---|---|
permissions |
string[] |
Always | |
configVersion |
number |
Always |