> For the complete documentation index, see [llms.txt](https://manual.personr.co/api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.personr.co/api-documentation/workspaces/switching-workspaces.md).

# Switching Workspaces

Easily switch your user account between workspaces.

Workspaces allow you to create separate spaces for your applicants, entities, flows, and more. You may want to use workspaces for different teams, partners, products or countries.

Use this endpoint to switch workspaces, so you can access its data.

## Switch workspaces

<mark style="color:green;">`POST`</mark> `/api-change-workspace`

Switch to another workspace

**Headers**

| Name          | Value                 |
| ------------- | --------------------- |
| Content-Type  | `multipart/form-data` |
| Authorization | `Bearer YOUR_TOKEN`   |

**Body**

| Name        | Type   | Description                                                                                  |
| ----------- | ------ | -------------------------------------------------------------------------------------------- |
| `workspace` | string | The name of the workspace you'd like to switch to <mark style="color:red;">(Required)</mark> |

#### Request

{% tabs %}
{% tab title="cURL" %}

```sh
curl --location 'https://enterprise.personr.co/api/1.1/wf/api-change-workspace' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--form 'workspace="XYZ Co"'
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200 - OK" %}

```json
{
    "status": "success",
    "response": {
        "currentWorkspace": "XYZ Co"
    }
}
```

{% endtab %}

{% tab title="200 - Error" %}

```json
{
    "status": "error",
    "response": "Workspace not found"
}
```

{% endtab %}
{% endtabs %}

Within the response, you'll receive the workspace your user has been switched to. From there, you can call the API as normal and access the data within your current workspace.

{% hint style="info" %}
Workspaces act as a hierarchal structure. Users added to a Workspace can access all Workspaces beneath them, but not above.
{% endhint %}

{% hint style="warning" %}
Ensure your user, or API user, sits at the primary workspace to ensure it has access to all workspaces.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://manual.personr.co/api-documentation/workspaces/switching-workspaces.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
