Products

Envless.products.access.revoke

Revoke a member grant on a product

def revoke(slug, member_id, timeout: nil)

Removes 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

ruby
require "envless/sdk"

member_id = "8f1c0e42-9b7a-4d21-9d0e-3a41c7f5b210"
result = Envless.products.access.revoke("billing", member_id)

unless result[:revoked]
  puts "that member had no grant on the product"
end

Parameters

ParameterTypeRequiredDescription
slugStringYesProduct slug, or the product uniqueId when the value is UUID shaped.
member_idStringYesWorkspace member id whose grant is being removed, never a user id.
timeout:Integer | Float | RationalNoSeconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off.

Returns

revoked_product_access_resource 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: 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 TypeScript

envless.products.access.revoke()

The same method in @goenvless/sdk, with the same request, retries and errors.