Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền mcp.manage; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Nơi điền id tổ chức của bạn
Endpoint này nhận org_id làm một trường trong phần thân JSON.
Mã tổ chức của bạn nằm ở màn hình khóa API trong bảng điều khiển, ngay bên cạnh khóa đó. Đây là cùng một mã trong mọi lệnh gọi mà bạn thực hiện.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X POST https://api.zinndigital.com/v1/mcp/connections \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string>, "scopes": <string[]> }'Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
Mints a per-tool MCP connection and returns the full `zmcp_…` token **once** (only its hash is stored) plus a paste-ready client config snippet. The requested `scopes` must be permissions the caller already holds in the target org — an unheld scope is a `403` (a connection can never out-scope its creator), an unknown one a `422`. An optional spend cap bounds AI-triggered paid actions. Requires `mcp.manage`.
Nội dung yêu cầu
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
name | string | Có | — |
client | McpClient | Không | The AI client a connection is for (informational). |
scopes | string[] | Có | RBAC permission keys to grant the token. Each must be a permission the caller holds in the target org (a connection can never out-scope its creator); an unheld scope is a `403`,… |
sandbox | boolean | Không | — |
org_id | Uuid | null | Không | The org the connection belongs to. Defaults to the caller's sole managed org. |
spend_cap_minor | integer | null | Không | Optional per-window paid-action budget (integer minor units). Null = no cap. |
spend_currency | CurrencyCode | Không | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
spend_window_seconds | integer | Không | — |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
name | string | Có | — |
client | McpClient | Có | The AI client a connection is for (informational). |
prefix | string | Có | The token's public lookup prefix (not a secret). |
scopes | string[] | Có | The RBAC permission keys this connection's token may exercise. |
sandbox | boolean | Có | — |
spend_cap_minor | integer | null | Không | Optional per-window budget (integer minor units, CLAUDE.md §2.8) for AI-triggered paid actions. Null = no cap. |
spend_currency | CurrencyCode | Không | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
spend_window_seconds | integer | Có | The rolling window the spend cap applies over. |
last_used_at | string | null | Không | — |
revoked_at | string | null | Không | — |
created_at | string | Có | — |
token | string | Có | The full `zmcp_…` token, shown exactly once. |
endpoint | string | Có | The MCP protocol endpoint URL to configure in the AI client. |
config | object | Có | A paste-ready MCP client config snippet embedding the endpoint + token. |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 422 · 429