# Set workspace public access

Source: https://docs.vlayers.ai/reference/public-access/put-workspace-public-access

`PUT /v1/public-access/settings/workspace` · scope `public_access:write`

Sets the workspace's own row: workspace-wide off, and caps every agent and key stays under. A key may tighten (turn off, lower a cap); enabling, raising a cap, turning the bot check off or changing its keys needs a workspace admin, and a key that asks gets 403 `forbidden`. Send the row's `version` as `If-Match` to avoid overwriting a newer change.

Requires an API key with the `public_access:write` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `if-match` | header | string | no | The `version` of the row this edit was made from. A stale one is refused with 409 `version_conflict` instead of overwriting a newer change. Leave it out when creating a row. Example: `"3"` |
| `settings` | body | object | yes | The fields to set; any you leave out inherit from the level above. |
| `note` | body | string | no | Why the change was made; kept in the change log. |

## Request

cURL:

```bash
curl -X PUT https://api.vlayers.ai/v1/public-access/settings/workspace \
  -H "Authorization: Bearer $VOICELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "enabled": false
    },
    "note": "Pausing public sessions during the launch review"
  }'
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { version } = await voicelayer.publicAccess.setWorkspace({
  settings: { enabled: false },
  note: 'Pausing public sessions during the launch review'
});
console.log(version);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.publicAccess.set_workspace(
    settings={
        "enabled": False,
    },
    note="Pausing public sessions during the launch review",
)
print(result.version)
```

## Response `200`

```json
{
  "id": "0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67",
  "scopeKind": "workspace",
  "agentId": null,
  "bindingId": null,
  "enabledForAgentId": null,
  "settings": {
    "enabled": false
  },
  "version": 4,
  "updatedBy": "user_2abc",
  "updatedAt": "2026-10-20T15:04:05.000Z"
}
```
