Products

envless.products.access.revoke()

Revoke a member grant on a product

ts
access.revoke(slug: string, memberId: string, options?: RequestScope): Promise<RevokedProductAccessResource>

Removes a member grant from a product. A missing grant is not an error: the call still resolves, 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

ts
const result = await envless.products.access.revoke('billing', '8f1c0e42-9b7a-4d21-9d0e-3a41c7f5b210')

if (!result.revoked) {
    console.log('that member had no grant on the product')
}

Parameters

ParameterTypeRequiredDescription
slugstringYesProduct slug, or the product uniqueId when the value is UUID shaped.
memberIdstringYesWorkspace member id whose grant is being removed, never a user id.
options.signalAbortSignalNoCancels the request.

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 resolves revoked: false.
  • An unknown member id is still rejected, so revoked: false only 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 Python

envless.products.access.revoke()

The same method in envless-sdk, the Python SDK, with the same request, retries and errors.

In Ruby

Envless.products.access.revoke

The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.

In PHP

$envless->products->access->revoke()

The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.