Invites

envless.invites.revoke()

Revoke a pending invitation

def revoke(
    id: str,
    *,
    timeout: float | None = None,
) -> RevokedInviteResource

Soft-deletes the invitation and kills the link in the email immediately. The recipient is not told, and the seat the invite was holding against your plan limit is released, so this is what you call before inviting someone else on a full plan.

There is no way to undo this. To reach the same address again, call members.invite, which now succeeds because no pending invite is blocking the email. Note that revoking has no effect on anyone who already accepted: once accepted the invite is gone from this collection and the person is a member, so use members.remove instead.

id must be an invite id from a list call. Passing an email address or a slug produces a 404 rather than a validation error, and so does an invite that was already revoked or accepted.

Example

from envless import envless

invites = envless.invites.list_all(search='dana@example.com')

if invites:
    revoked = envless.invites.revoke(invites[0]['id'])

    print(revoked['email'])

Parameters

ParameterTypeRequiredDescription
idstrYesInvite id taken from a list call, ids only.
timeoutfloatNoSeconds 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

RevokedInviteResource with the id and email of the invitation that was revoked.

Worth knowing

  • Emits member.invite_revoked.
  • A 404 with invite.not_found is the response for an already revoked invite, so this call is not idempotent.

Required scopes

members:write

Underlying endpoint

DELETE /invites/{id}

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

In TypeScript

envless.invites.revoke()

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