# Switch to another workspace you belong to.

> https://koi.dog/docs/api/workspace-team/select-workspace-team/

`POST /api/v1/workspace-team/current` · Key: `session only`

Use a Clerk session token at `https://app.koi.dog/api/v1` with `Origin: https://app.koi.dog`.

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Body.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | `string` | yes | The workspace to open in this browser. The account must belong to it. Matches `^ws_[a-z2-7]{16}$`. |

## Response.

200 OK · JSON object

- **422 validation_failed**: Each schema error appears in `details`.

## Request.

```sh
# Requires a Clerk dashboard session token.
curl -X POST https://app.koi.dog/api/v1/workspace-team/current \
    -H "Authorization: Bearer $KOIDOG_CLERK_SESSION" \
    -H "Origin: https://app.koi.dog" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{
      "workspaceId": "ws_abcdefghijklmnop"
    }'
```

```js
// Requires a Clerk dashboard session token.
const res = await fetch("https://app.koi.dog/api/v1/workspace-team/current", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_CLERK_SESSION}`,
    Origin: "https://app.koi.dog",
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    workspaceId: "ws_abcdefghijklmnop",
  }),
});
console.log(await res.json());
```

```python
import os
import uuid

import requests

# Requires a Clerk dashboard session token.
r = requests.post(
    "https://app.koi.dog/api/v1/workspace-team/current",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_CLERK_SESSION']}",
        "Origin": "https://app.koi.dog",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "workspaceId": "ws_abcdefghijklmnop",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "ok": true
}
```
