---
title: "Share Account With Workspace"
method: PATCH
path: "/api/channels/{channel}/accounts/{account_id}/workspace"
tags: ["channels", "channels", "channel-accounts"]
---

# Share Account With Workspace

`PATCH /api/channels/{channel}/accounts/{account_id}/workspace`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/channels/{channel}/accounts/{account_id}/workspace`
- Auth: none declared

Share a channel account with a team workspace via channel_workspace_shares.

Only the account owner (app_user_id) may call this endpoint.
share_with_workspace=True inserts into channel_workspace_shares (idempotent).
share_with_workspace=False returns 400 — use DELETE /shares/{target_workspace_id} instead.

channel_account.workspace_id is NEVER mutated by this endpoint.

Args:
    channel: Channel name
    account_id: Account to share
    request: Share configuration (share_with_workspace must be True)

Returns:
    Share status

## Path parameters

- `channel` string, required
- `account_id` string, required

## Request body

- ShareAccountRequest
  - `share_with_workspace` boolean, required
  - `target_workspace_id` integer, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/d84e7dc9977d?raw)
