Remove a member from your organisation
End a person’s access: they are signed out, and the API keys they made and invitations they sent stop working. Console session only, never an API key.
DELETE
/
members
/
{account_id}
# cookies.txt holds the cookies from your signed-in console session.
curl --request DELETE "$MITHUNAI_URL/mithunai/api/v1/members/7c9e6679-7425-40de-944b-e07fc1f90ae7" \
--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()
account_id = "7c9e6679-7425-40de-944b-e07fc1f90ae7"
response = requests.delete(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/members/{account_id}",
cookies=jar,
headers={"X-CSRF-Token": os.environ["MITHUNAI_CSRF_TOKEN"]},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Runs in a page on the MITHUNAI console's own origin, while signed in.
// csrfToken is the value of the csrf_token cookie.
const accountId = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
const response = await fetch(`/mithunai/api/v1/members/${accountId}`, {
method: 'DELETE',
credentials: 'include',
headers: { 'X-CSRF-Token': csrfToken },
})
console.log(await response.json())
{
"removed": true,
"account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"revoked_api_keys": 1,
"revoked_invitations": 0
}
{ "code": "authorization_error", "message": "You cannot change or remove your own seat." }
{ "code": "not_found", "message": "The requested resource was not found." }
{
"code": "conflict",
"message": "The organisation's owner cannot be changed or removed. Transfer ownership first."
}
Removes one person from your organisation. Their account is not deleted, and any other organisation they belong to is unaffected.
Removing someone takes their access with it, straight away:
- They are signed out of the console on every device, and their sign-ins to the other surfaces (Chat, Agents, the Gateway) can no longer be renewed through MITHUNAI. A session already open on one of those may run until it next needs renewing.
- Every API key they created in your organisation is revoked. Anything using one of those keys stops working, so check the keys list first if a key they made is in use. See Managing API keys.
- Every invitation they sent that has not been accepted is withdrawn.
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. You cannot remove yourself (403), someone more senior than you (403), or the organisation’s owner (409). A member who does not exist, a member of another organisation and a malformed ID all return the same 404.
To bring someone back, invite them again. See Members.
string
required
The member’s account ID (UUID), as returned in
account_id by List
members.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.string
required
The account ID of the person removed.
integer
required
How many API keys they created in this organisation were revoked.
integer
required
How many invitations they sent were withdrawn.
# cookies.txt holds the cookies from your signed-in console session.
curl --request DELETE "$MITHUNAI_URL/mithunai/api/v1/members/7c9e6679-7425-40de-944b-e07fc1f90ae7" \
--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()
account_id = "7c9e6679-7425-40de-944b-e07fc1f90ae7"
response = requests.delete(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/members/{account_id}",
cookies=jar,
headers={"X-CSRF-Token": os.environ["MITHUNAI_CSRF_TOKEN"]},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Runs in a page on the MITHUNAI console's own origin, while signed in.
// csrfToken is the value of the csrf_token cookie.
const accountId = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
const response = await fetch(`/mithunai/api/v1/members/${accountId}`, {
method: 'DELETE',
credentials: 'include',
headers: { 'X-CSRF-Token': csrfToken },
})
console.log(await response.json())
{
"removed": true,
"account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"revoked_api_keys": 1,
"revoked_invitations": 0
}
{ "code": "authorization_error", "message": "You cannot change or remove your own seat." }
{ "code": "not_found", "message": "The requested resource was not found." }
{
"code": "conflict",
"message": "The organisation's owner cannot be changed or removed. Transfer ownership first."
}
Last modified on November 7, 2026
# cookies.txt holds the cookies from your signed-in console session.
curl --request DELETE "$MITHUNAI_URL/mithunai/api/v1/members/7c9e6679-7425-40de-944b-e07fc1f90ae7" \
--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()
account_id = "7c9e6679-7425-40de-944b-e07fc1f90ae7"
response = requests.delete(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/members/{account_id}",
cookies=jar,
headers={"X-CSRF-Token": os.environ["MITHUNAI_CSRF_TOKEN"]},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Runs in a page on the MITHUNAI console's own origin, while signed in.
// csrfToken is the value of the csrf_token cookie.
const accountId = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
const response = await fetch(`/mithunai/api/v1/members/${accountId}`, {
method: 'DELETE',
credentials: 'include',
headers: { 'X-CSRF-Token': csrfToken },
})
console.log(await response.json())
{
"removed": true,
"account_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"revoked_api_keys": 1,
"revoked_invitations": 0
}
{ "code": "authorization_error", "message": "You cannot change or remove your own seat." }
{ "code": "not_found", "message": "The requested resource was not found." }
{
"code": "conflict",
"message": "The organisation's owner cannot be changed or removed. Transfer ownership first."
}