Remove a specific role from script access control list.

Authentication: JWT token required Authorization: Admin level access required (ADMIN or SUPERADMIN) Purpose: Revoke script access from all users with a specific role

Path Parameters:

  • script_id: Script identifier/slug or numeric ID
  • role: Role name to remove (USER, ADMIN, or SUPERADMIN)

Request: No request body required

Response Schema:

{
  "data": {
    "script_id": "12345",
    "restricted": true,
    "allowed_roles": ["ADMIN"],
    "allowed_users": [],
    "access_type": "role_restricted"
  }
}

Behavior:

  • Removes role from script's allowed roles list
  • All users with only this role lose access immediately
  • Does not affect other roles' access
  • Gracefully handles removal of non-existent roles

Access Effect:

  • Users with this role can no longer see script in listings
  • Users with this role cannot execute script
  • Existing executions continue to completion
  • Users may retain access through user-specific permissions or other roles

Cleanup Logic:

  • If role list becomes empty, role restrictions may be removed
  • Script may become unrestricted if no other access controls exist
  • Access type is recalculated based on remaining restrictions

Use Cases:

  • Remove access when role permissions change
  • Tighten security by restricting to higher privilege roles only
  • Clean up outdated role-based permissions
  • Implement policy changes across scripts

Error Responses:

  • 401 Unauthorized: JWT token required
  • 403 Forbidden: Admin privileges required
  • 404 Not Found: Script does not exist
  • 500 Internal Server Error: Failed to remove role access
delete/api/v1/script/{script_id}/access/roles/{role}

Path parameters

script_idstring required

Path parameter: script_id

rolestring required

Path parameter: role

Response

Success

object required

Changes

No recorded changes to this endpoint across all 1 revision of this API.