# Open your own workspace after a platform invitation.

> Hosted dashboard only.
> https://koi.dog/docs/api/session/accept-platform-workspace/

`POST /api/v1/session/workspace` · Key: `session only`

Requires a verified Clerk session, an accepted platform invitation for a verified address, and a same-origin request. 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). |

## Response.

200 OK · JSON object

## Request.

```sh
# Requires a Clerk dashboard session token.
curl -X POST https://app.koi.dog/api/v1/session/workspace \
    -H "Authorization: Bearer $KOIDOG_CLERK_SESSION" \
    -H "Origin: https://app.koi.dog" \
    -H "Idempotency-Key: $(uuidgen)"
```

```js
// Requires a Clerk dashboard session token.
const res = await fetch("https://app.koi.dog/api/v1/session/workspace", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_CLERK_SESSION}`,
    Origin: "https://app.koi.dog",
    "Idempotency-Key": crypto.randomUUID(),
  },
});
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/session/workspace",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_CLERK_SESSION']}",
        "Origin": "https://app.koi.dog",
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "workspace": {
    "id": "string",
    "name": "string"
  },
  "accepted": false
}
```
