Sharing
Library access control and sharing with users and teams.
GET /api/libraries/{id}/shares
List all shares for a library.
Authentication: Required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
Response:
{
"_links": {
"self": { "href": "/api/libraries/{id}/shares" }
},
"_embedded": {
"inf:share": [
{
"principalId": "team:engineering",
"libraryId": "550e8400-e29b-41d4-a716-446655440000",
"accessLevel": 1
},
{
"principalId": "alice",
"libraryId": "550e8400-e29b-41d4-a716-446655440000",
"accessLevel": 1
}
]
},
"start": 0,
"count": 2,
"total": 2
}
Access Levels:
| Level | Name | Description |
|---|---|---|
0 | NONE | No access |
1 | READ | Read-only access to indexed files |
GET /api/libraries/{id}/shares/{principalId}
Get a specific share for a principal (user or team).
Authentication: Required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
principalId | string | User ID or team ID (e.g., team:engineering) |
Response:
{
"principalId": "team:engineering",
"libraryId": "550e8400-e29b-41d4-a716-446655440000",
"accessLevel": 1
}
PUT /api/libraries/{id}/shares/{principalId}
Create or update a share for a principal.
Authentication: Required
Permissions: Requires library:write permission
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
principalId | string | User ID or team ID |
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
accessLevel | integer | Yes | Access level (0 = NONE, 1 = READ) |
Example:
{
"accessLevel": 1
}
Response:
200 OK
{
"principalId": "team:data-science",
"libraryId": "550e8400-e29b-41d4-a716-446655440000",
"accessLevel": 1
}
DELETE /api/libraries/{id}/shares/{principalId}
Remove a share for a principal.
Authentication: Required
Permissions: Requires library:write permission
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | Library ID or natural ID |
principalId | string | User ID or team ID |
Response:
204 No Content