API ReferencePermissions
Revoke Permission
Remove a permission tuple, revoking a subject's access to a resource.
Endpoint
DELETE /v1/permissionsBase URL: https://api-id.avnology.net
Authentication: API Key or OAuth token with admin:permissions:write scope
Request
curl -X DELETE "https://api-id.avnology.net/v1/permissions" \
-H
Response
Success (204 No Content)
Errors
| Status | Code | Description |
|---|---|---|
| 404 | AVNOLOGY_AUTH_901 | Permission tuple not found |
Code Examples
JavaScript (fetch)
async function revokePermission(apiKey, namespace, object, relation, subject) {
await fetch('https://api-id.avnology.net/v1/permissions', {
method: 'DELETE',
headers: { 'Authorization': `Bearer ${apiKey}`,
Python (httpx)
import httpx
def revoke_permission(api_key: str, namespace: str, object_id: str, relation: str, subject: str) -> None:
httpx.request("DELETE", "https://api-id.avnology.net/v1/permissions"
Go (net/http)
func revokePermission(ctx context.Context, apiKey, ns, obj, rel, sub string) error {
Related
- Grant Permission -- create a permission
- Check Permission -- verify revocation
- SDK:
client.permissions.revoke({ namespace, object, relation, subject })(TypeScript)