def revoke(
slug: str,
member_id: str,
*,
timeout: float | None = None,
) -> RevokedProductAccessResourceasync def revoke(
slug: str,
member_id: str,
*,
timeout: float | None = None,
) -> RevokedProductAccessResourceRemoves a member grant from a product. A missing grant is not an error: the call still succeeds, with 'revoked': False, so read that flag instead of treating a successful call as proof that something was removed.
Revoking the membership belonging to the key owner is refused, and that guard is what stops an integration locking itself out of a private product. Revoking on a public product deletes the stored row and changes nothing about who can read the product.
Example
from envless import envless
result = envless.products.access.revoke(
'billing', '8f1c0e42-9b7a-4d21-9d0e-3a41c7f5b210'
)
if not result['revoked']:
print('that member had no grant on the product')import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
result = await envless.products.access.revoke(
'billing', '8f1c0e42-9b7a-4d21-9d0e-3a41c7f5b210'
)
if not result['revoked']:
print('that member had no grant on the product')
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | str | Yes | Product slug, or the product uniqueId when the value is UUID shaped. |
member_id | str | Yes | Workspace member id whose grant is being removed, never a user id. |
timeout | float | No | Seconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
RevokedProductAccessResource with the member id and a revoked flag.
Worth knowing
- The call is idempotent, so running it twice is safe and the second run returns
'revoked': False. - An unknown member id is still rejected, so
'revoked': Falseonly ever means the member existed without a grant.
Required scopes
product-access:write
Underlying endpoint
DELETE /products/{slug}/access/{memberId}
Request and response schema, every error code, and a live playground.
In TypeScript
envless.products.access.revoke()
The same method in @goenvless/sdk, with the same request, retries and errors.