Members

Envless.members.remove

Remove another member from the workspace

def remove(id, timeout: nil)

Soft deletes a membership. The user account is untouched and the same person can be invited again later, which is why this frees a seat rather than destroying anything.

It refuses to remove the caller with 409 member.self_mutation, so use leave for that, and it refuses the workspace owner with 409 member.owner_immutable. Ownership has to be transferred in the dashboard first.

The returned value is a tombstone carrying id alone. It gives you back no email, no role and no user, so read the member before removing if you need those for an audit trail.

Example

ruby
require "envless/sdk"

page = Envless.members.list(limit: 100)
target = page.items.find do |member|
  member.dig(:user, :email) == "contractor@example.com"
end

if target
  removed = Envless.members.remove(target[:id])

  puts removed[:id]
end

Parameters

ParameterTypeRequiredDescription
idStringYesWorkspace member id from the list methods, not the 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

deleted_member_resource carrying only the removed member id.

Worth knowing

  • Every API key belongs to a member, so the removed person keys stop authenticating with 401 as soon as this succeeds.
  • Emits member.removed without left, which is how a webhook consumer tells an admin removal from a voluntary departure.

Required scopes

members:write

Underlying endpoint

DELETE /members/{id}

Request and response schema, every error code, and a live playground.

In TypeScript

envless.members.remove()

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