TsgcWSAPIKeyManager › Methods › RevokeScope
Removes a scope from an existing key.
procedure RevokeScope(const aKey, aScope: string);
| Name | Type | Description |
|---|---|---|
aKey | const string | Raw plaintext key whose scope list will be trimmed. |
aScope | const string | Case-sensitive scope identifier to remove. No-op when the scope is not currently attached. |
Removes a single scope from an issued key without invalidating the key itself — the customer keeps using the same key string but loses access to endpoints that required the dropped scope. Appends a kaaScopeRevoked audit entry and persists the change when StorageType is kstFile. Use it for plan downgrades or targeted permission reductions. To strip every scope at once, call RevokeScope repeatedly or RevokeKey instead when the key should be killed outright.
// Downgrade: customer no longer has write access
sgcWSAPIKeyManager1.RevokeScope(vKey, 'write:shipments');