Invites

envless.invites.revoke()

Revoke a pending invitation

ts
revoke(id: string, options?: RequestScope): Promise<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

ts
const invites = await envless.invites.listAll({ search: 'dana@example.com' })

if (invites[0]) {
    const revoked = await envless.invites.revoke(invites[0].id)

    console.log(revoked.email)
}

Parameters

ParameterTypeRequiredDescription
idstringYesInvite id taken from a list call, ids only.
options.signalAbortSignalNoCancels the request.

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 Python

envless.invites.revoke()

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

In Ruby

Envless.invites.revoke

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

In PHP

$envless->invites->revoke()

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