def revoke(id, timeout: nil)def revoke: (String id, ?timeout: seconds?) -> revoked_invite_resourceSoft-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
require "envless/sdk"
invites = Envless.invites.list_all(search: "dana@example.com")
invite = invites.first
if invite
revoked = Envless.invites.revoke(invite[:id])
puts revoked[:email]
endParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | Invite id taken from a list call, ids only. |
timeout: | Integer | Float | Rational | No | Seconds 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_invite_resource with the id and email of the invitation that was revoked.
Worth knowing
- Emits
member.invite_revoked. - A 404 with
invite.not_foundis 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.