# driveItems.setPublication

Publish or unpublish a document to the web.

`PUT /api/v1/drive-items/{itemId}/publication`

- SDK: [`tb.driveItems.setPublication(input)`](/sdk)
- CLI: [`thinkbench drive-items set-publication`](/cli)
- MCP tool: [`drive_items_set_publication`](/mcp)

## Input

| Field | Type | In | Description |
| --- | --- | --- | --- |
| `itemId` | `string` | path |  |
| `published` | `boolean` | body |  |

## Output

Returns an empty response on success.

## Examples

### curl

```bash
curl -X PUT "https://app.thinkbench.com/api/v1/drive-items/<itemId>/publication" \
  -H "x-api-key: $THINKBENCH_API_KEY" \
  -H "content-type: application/json" \
  -d '{"published":true}'
```

### TypeScript SDK

```ts
await tb.driveItems.setPublication({ itemId: "<itemId>", published: true });
```

### CLI

```bash
thinkbench drive-items set-publication --item-id "<itemId>" --published true
```

### MCP

```json
{
  "name": "drive_items_set_publication",
  "arguments": {
    "itemId": "<itemId>",
    "published": true
  }
}
```
