> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Leave workspace

> Leave a workspace you are a member of with DELETE /v2/workspaces/leave, losing access to its shared applications at once. Owners delete it instead.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Requires an API key with the `workspaces:manage` [scope](/en/api-reference/authentication#scopes).

Removes the authenticated user from a workspace's member list. This is the self-service counterpart to [Remove Member](/en/api-reference/endpoint/workspace/members/kick), for a member who wants out without asking the owner to act.

The workspace owner cannot leave their own workspace this way; they must call [Delete Workspace](/en/api-reference/endpoint/workspace/delete) instead, which removes it for every member. Leaving revokes access to the workspace's shared applications immediately. Rate limited to 1 request every 5 seconds per user.

## Parameters

<ParamField body="workspaceId" type="string" placeholder="Workspace Id" required>
  The ID of the workspace.
</ParamField>

## Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful: `success` if it was, `error` if not.
</ResponseField>

<ResponseExample>
  ```json theme={"system"}
  {
    "status": "success"
  }
  ```
</ResponseExample>

## Common errors

| Code | HTTP | Meaning |
| - | - | - |
| `INVALID_ID` | 400 | `workspaceId` is missing. |
| `CANNOT_LEAVE_OWNER` | 400 | The caller is the workspace owner and must delete it instead of leaving. |
| `WORKSPACE_NOT_FOUND` | 404 | The workspace does not exist or the caller is not a member. |

## Related

* CLI: [`squarecloud workspace leave`](/en/cli-reference/workspaces#squarecloud-workspace-leave)
* SDKs: [`api.workspaces.leave()`](/en/sdks/js/workspaces) (JavaScript), [`client.workspaces.leave()`](/en/sdks/py/workspaces) (Python), [`c.Workspaces.Leave()`](/en/sdks/go/workspaces) (Go)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.