Update a collection share
PUT
/api/collections/{id}/shares/{shareId}
const url = 'https://firma.company-gpt.com/companygpt/rag/api/api/collections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/shares/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"viewer"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://firma.company-gpt.com/companygpt/rag/api/api/collections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/shares/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "viewer" }'Change a share’s role. Only the collection owner may update shares.
Authorizations
Abschnitt betitelt „Authorizations“Parameters
Abschnitt betitelt „Parameters“Path Parameters
Abschnitt betitelt „Path Parameters“id
required
string format: uuid
Collection UUID
shareId
required
string format: uuid
Share UUID
Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“Media typeapplication/json
object
role
required
string
Responses
Abschnitt betitelt „Responses“Share updated
Media typeapplication/json
A collection share (handlers.ShareResponse)
object
id
required
string format: uuid
collection_id
required
string format: uuid
type
required
string
target
required
Email for “user” shares, Entra group ID for “entra_group” shares, empty for “public”
string
targetDisplay
required
Human-readable label (e.g. resolved Entra group name); falls back to “target”
string
role
required
string
created_at
required
string format: date-time
Example
{ "type": "user", "role": "viewer"}Invalid request
Unauthorized
Forbidden — only the collection owner may update shares
Collection or share not found