Skip to content
TriedDocs
Account

Leave workspace

Remove yourself from the current workspace.

POSThttps://api.tried.com.au/workspace/leave

Removes the signed-in user from the current workspace. This endpoint works with a dashboard session only, not an API key, because an API key has no user. Any role can leave, including member.

Request#

This endpoint takes no path, query or body parameters.

You cannot leave when you are the only member (delete the workspace instead) or the only admin (transfer the workspace first).

Example request#

Note

These examples show the request shape. Sent with an API key, as here, the request returns 403. Send it from a signed-in dashboard session instead.

curl -X POST https://api.tried.com.au/workspace/leave \
  -H "Authorization: Bearer $TRIED_API_KEY"
const res = await fetch("https://api.tried.com.au/workspace/leave", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const result = await res.json();
import os, requests

res = requests.post(
    "https://api.tried.com.au/workspace/leave",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
result = res.json()

Response#

200 OK

{
  "left": "ws_3f9a1c7e5b2d4086a1c9e7f2",
  "me": {
    "user": {
      "user_id": "user_2b4d6f8a0c1e3a5b7d9f1e2c",
      "email": "priya@harbourdental.com.au",
      "name": "priya"
    },
    "workspace": {
      "workspace_id": "ws_6e8a0c2e4b6d8f0a2c4e6b8d",
      "name": "Priya's workspace",
      "webhook_url": null,
      "concurrency_limit": 20,
      "created_timestamp": 1756684800000
    },
    "role": "admin",
    "workspaces": [
      {
        "workspace_id": "ws_6e8a0c2e4b6d8f0a2c4e6b8d",
        "name": "Priya's workspace",
        "webhook_url": null,
        "concurrency_limit": 20,
        "created_timestamp": 1756684800000,
        "role": "admin"
      }
    ]
  }
}
Field Type Description
left string ID of the workspace you left.
me object or null The signed-in user's next workspace: user, workspace, role and workspaces. The session moves to the user's oldest remaining workspace. null when the user has none left (the session is signed out) or when you call with an API key.

Your other sessions in that workspace are signed out.

Errors#

Status When
400 You are the only member. Delete the workspace instead. or You are the only admin. Transfer the workspace to another member first.
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request. This route needs the admin scope. Called with an API key: Sign in as a user to leave a workspace.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.