---
title: "Set Connection Shares"
method: PUT
path: "/connections/{connection_id}/shares"
tags: ["connections"]
---

# Set Connection Shares

`PUT /connections/{connection_id}/shares`

## Request

- Base URL: `https://api.myaltimate.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.myaltimate.com/connections/{connection_id}/shares`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Set the caller's connection's sharing mode and whole grant set in one
call, as ``PUT /datamates/{id}/shares`` does for a workspace.

## Path parameters

- `connection_id` integer, required

## Request body

- ConnectionSharesRequest: Set a connection's sharing mode and whole grant set, as for a workspace.
  - `privacy` 'private' | 'public' | 'restricted', required: Sharing modes for a workspace. Deliberately local rather than adding a member to the shared ``PrivacySetting``, which is imported by five resources (datamates, knowledge bases, notebooks, query bookmarks, custom skills). ``restricted`` is meaningless for the other four, and widening the shared enum would make it a legal value there. The two overlapping values keep identical strings, so rows written before this existed, and every cross-file read that compares against ``PrivacySetting.PUBLIC.value``, still work. Reviewers found this argument was made and then broken in the same diff: four ``CustomSkill`` schemas were swapped to this enum, which made ``restricted`` a legal value for a resource with no grant table behind it — ``_visible_to`` (``crud/custom_skills.py``) matches owner-or-public only, and ``custom_skills.privacy`` has no CHECK, so such a skill would persist and be permanently invisible to everyone but its creator. Custom skills are back on ``PrivacySetting``; keep them there until they implement sharing.
  - `user_ids` integer[]
  - `team_ids` integer[]

## Response `200`

Successful Response

- ConnectionSharesResponse
  - `connection_id` integer, required
  - `privacy` 'private' | 'public' | 'restricted', required: Sharing modes for a workspace. Deliberately local rather than adding a member to the shared ``PrivacySetting``, which is imported by five resources (datamates, knowledge bases, notebooks, query bookmarks, custom skills). ``restricted`` is meaningless for the other four, and widening the shared enum would make it a legal value there. The two overlapping values keep identical strings, so rows written before this existed, and every cross-file read that compares against ``PrivacySetting.PUBLIC.value``, still work. Reviewers found this argument was made and then broken in the same diff: four ``CustomSkill`` schemas were swapped to this enum, which made ``restricted`` a legal value for a resource with no grant table behind it — ``_visible_to`` (``crud/custom_skills.py``) matches owner-or-public only, and ``custom_skills.privacy`` has no CHECK, so such a skill would persist and be permanently invisible to everyone but its creator. Custom skills are back on ``PrivacySetting``; keep them there until they implement sharing.
  - `user_ids` integer[], required
  - `team_ids` integer[], required

## Other responses

- `404`: Connection not found
- `422`: Invalid grantees

## Changes

- **2026-10-27** `883849803623`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/myaltimate/apis/fastapi/changes/connections/:connection_id/shares/put.md)

---

[API](https://skmtc.dev/myaltimate/apis/fastapi.md) - [All operations](https://skmtc.dev/myaltimate/apis/fastapi/llms.txt) - [OpenAPI document](https://skmtc.dev/myaltimate/apis/fastapi/revisions/6f0cdcf50d27?raw)
