Withdraw an invitation
Stop an invitation link working before it is used. Takes a signed-in console session, never an API key. Repeats are safe.
DELETE
/
invitations
/
{invitation_id}
# cookies.txt holds the cookies from your signed-in console session.
curl --request DELETE \
"$MITHUNAI_URL/mithunai/api/v1/invitations/9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13" \
--cookie cookies.txt \
--header "X-CSRF-Token: $MITHUNAI_CSRF_TOKEN"
import os
from http.cookiejar import MozillaCookieJar
import requests
jar = MozillaCookieJar("cookies.txt")
jar.load()
invitation_id = "9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13"
response = requests.delete(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/invitations/{invitation_id}",
cookies=jar,
headers={"X-CSRF-Token": os.environ["MITHUNAI_CSRF_TOKEN"]},
timeout=30,
)
response.raise_for_status()
// Runs in a page on the MITHUNAI console's own origin, while signed in.
// csrfToken is the value of the csrf_token cookie.
const invitationId = '9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13'
await fetch(`/mithunai/api/v1/invitations/${invitationId}`, {
method: 'DELETE',
credentials: 'include',
headers: { 'X-CSRF-Token': csrfToken },
})
{ "revoked": true }
{ "code": "not_found", "message": "The requested resource was not found." }
{
"code": "conflict",
"message": "That invitation has already been accepted. Remove the member instead."
}
Withdraws an invitation that has not been accepted. The link in the email stops working at once, and the invitation leaves the list. You can invite the same address again afterwards.
Withdrawing is idempotent: withdrawing an invitation that is already withdrawn succeeds and changes nothing.
An invitation that has already been accepted cannot be withdrawn, because that person is a member now; the request returns
409. To end their access, remove the member.
This endpoint takes a signed-in console session, not an API key. Send the session cookies your browser received when you signed in, plus the X-CSRF-Token header set to the value of the csrf_token cookie. A request authenticated with an mithunai_sk_ key is refused with 403.
You need the owner or admin role. An invitation that does not exist, an invitation in another organisation and a malformed ID all return the same 404. See Invitations.
string
required
The invitation’s ID (UUID), as returned in
id by List
invitations.string
required
The value of your session’s
csrf_token cookie (named __Host-csrf_token when the console is
served over HTTPS without a shared cookie domain). A missing or mismatched token returns 401.Response
boolean
required
Always
true.# cookies.txt holds the cookies from your signed-in console session.
curl --request DELETE \
"$MITHUNAI_URL/mithunai/api/v1/invitations/9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13" \
--cookie cookies.txt \
--header "X-CSRF-Token: $MITHUNAI_CSRF_TOKEN"
import os
from http.cookiejar import MozillaCookieJar
import requests
jar = MozillaCookieJar("cookies.txt")
jar.load()
invitation_id = "9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13"
response = requests.delete(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/invitations/{invitation_id}",
cookies=jar,
headers={"X-CSRF-Token": os.environ["MITHUNAI_CSRF_TOKEN"]},
timeout=30,
)
response.raise_for_status()
// Runs in a page on the MITHUNAI console's own origin, while signed in.
// csrfToken is the value of the csrf_token cookie.
const invitationId = '9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13'
await fetch(`/mithunai/api/v1/invitations/${invitationId}`, {
method: 'DELETE',
credentials: 'include',
headers: { 'X-CSRF-Token': csrfToken },
})
{ "revoked": true }
{ "code": "not_found", "message": "The requested resource was not found." }
{
"code": "conflict",
"message": "That invitation has already been accepted. Remove the member instead."
}
Last modified on November 3, 2026
# cookies.txt holds the cookies from your signed-in console session.
curl --request DELETE \
"$MITHUNAI_URL/mithunai/api/v1/invitations/9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13" \
--cookie cookies.txt \
--header "X-CSRF-Token: $MITHUNAI_CSRF_TOKEN"
import os
from http.cookiejar import MozillaCookieJar
import requests
jar = MozillaCookieJar("cookies.txt")
jar.load()
invitation_id = "9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13"
response = requests.delete(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/invitations/{invitation_id}",
cookies=jar,
headers={"X-CSRF-Token": os.environ["MITHUNAI_CSRF_TOKEN"]},
timeout=30,
)
response.raise_for_status()
// Runs in a page on the MITHUNAI console's own origin, while signed in.
// csrfToken is the value of the csrf_token cookie.
const invitationId = '9d4e2a71-3c5b-4f80-a6d1-8e7b2c0f4a13'
await fetch(`/mithunai/api/v1/invitations/${invitationId}`, {
method: 'DELETE',
credentials: 'include',
headers: { 'X-CSRF-Token': csrfToken },
})
{ "revoked": true }
{ "code": "not_found", "message": "The requested resource was not found." }
{
"code": "conflict",
"message": "That invitation has already been accepted. Remove the member instead."
}