Skip to main content

Sharing API

Share resources between users and groups. Supports read-only and forkable permission levels with optional expiration.

Share Resource

Share a resource with a user or group. Exactly one of sharedWithUserId or sharedWithGroupId must be provided.

Request

POST /api/sharing

Auth: requireAuth, buildAbilities

Content-Type: application/json

{
"resourceType": "persona",
"resourceId": "bb0e8400-e29b-41d4-a716-446655440030",
"sharedWithUserId": "880e8400-e29b-41d4-a716-446655440003",
"permissionLevel": "forkable"
}

Request Body

FieldTypeRequiredDescription
resourceTypestringYesOne of: annotation, summary, claim, persona, world_state
resourceIdstringYesUUID of the resource to share
sharedWithUserIdUUIDConditionalID of the recipient user (mutually exclusive with sharedWithGroupId)
sharedWithGroupIdUUIDConditionalID of the recipient group (mutually exclusive with sharedWithUserId)
permissionLevelstringNoread_only (default) or forkable

Response

Status: 201 Created

{
"id": "dd0e8400-e29b-41d4-a716-446655440050",
"resourceType": "persona",
"resourceId": "bb0e8400-e29b-41d4-a716-446655440030",
"sharedByUserId": "660e8400-e29b-41d4-a716-446655440001",
"sharedWithUserId": "880e8400-e29b-41d4-a716-446655440003",
"sharedWithGroupId": null,
"permissionLevel": "forkable",
"expiresAt": null,
"createdAt": "2026-02-23T10:00:00.000Z"
}

Status Codes

CodeDescription
201Share created
400Invalid body, or both/neither target specified
403No permission to share this resource
404Resource, user, or group not found

Permission Requirements

The caller must own the resource, or hold a forkable share on it (which grants permission to re-share).


List Received Shares

List resources shared with the current user, either directly or through group membership. Expired shares are excluded.

Request

GET /api/sharing/received

Auth: requireAuth

Response

Status: 200 OK

[
{
"id": "dd0e8400-e29b-41d4-a716-446655440050",
"resourceType": "persona",
"resourceId": "bb0e8400-e29b-41d4-a716-446655440030",
"sharedByUserId": "660e8400-e29b-41d4-a716-446655440001",
"sharedByUser": {
"id": "660e8400-e29b-41d4-a716-446655440001",
"username": "jdoe",
"displayName": "Jane Doe"
},
"sharedWithUserId": "880e8400-e29b-41d4-a716-446655440003",
"sharedWithGroupId": null,
"permissionLevel": "forkable",
"expiresAt": null,
"createdAt": "2026-02-23T10:00:00.000Z"
}
]

Status Codes

CodeDescription
200Shares listed
401Not authenticated

List Sent Shares

List resources shared by the current user.

Request

GET /api/sharing/sent

Auth: requireAuth

Response

Status: 200 OK

[
{
"id": "dd0e8400-e29b-41d4-a716-446655440050",
"resourceType": "persona",
"resourceId": "bb0e8400-e29b-41d4-a716-446655440030",
"sharedByUserId": "660e8400-e29b-41d4-a716-446655440001",
"sharedWithUserId": "880e8400-e29b-41d4-a716-446655440003",
"sharedWithUser": {
"id": "880e8400-e29b-41d4-a716-446655440003",
"username": "asmith",
"displayName": "Alice Smith"
},
"sharedWithGroupId": null,
"sharedWithGroup": null,
"permissionLevel": "forkable",
"expiresAt": null,
"createdAt": "2026-02-23T10:00:00.000Z"
}
]

Status Codes

CodeDescription
200Shares listed
401Not authenticated

Revoke Share

Delete a share, removing the recipient's access. Only the original sharer or a system_admin can revoke a share.

Request

DELETE /api/sharing/:shareId

Auth: requireAuth

Parameters

ParameterTypeDescription
shareIdUUIDShare identifier

Response

Status: 200 OK

{
"message": "Share revoked successfully"
}

Status Codes

CodeDescription
200Share revoked
403Not the original sharer or system admin
404Share not found

Fork Shared Resource

Create an independent copy of a shared resource in the current user's workspace. The share must have permissionLevel: "forkable" and must not be expired.

Request

POST /api/sharing/:shareId/fork

Auth: requireAuth, buildAbilities

Parameters

ParameterTypeDescription
shareIdUUIDShare identifier

Response

Status: 201 Created

{
"resourceType": "persona",
"resourceId": "ee0e8400-e29b-41d4-a716-446655440060",
"resource": {
"id": "ee0e8400-e29b-41d4-a716-446655440060",
"name": "Sports Scout",
"role": "Analyst",
"informationNeed": "Player performance evaluation"
}
}

Response Fields

FieldTypeDescription
resourceTypestringType of the forked resource
resourceIdstringUUID of the newly created copy
resourceobjectThe full forked resource object

Forking Behavior by Resource Type

Resource TypeWhat Gets Copied
annotationFull annotation including bounding box sequence data
summaryFull summary including visual analysis, transcript, and key frames
claimFull claim including gloss, text spans, claimer, and modality metadata
personaPersona and its associated ontology (entity types, event types, role types, relation types)
world_stateFull world state including entities, events, times, collections, and relations

Status Codes

CodeDescription
201Resource forked
400Resource type cannot be forked
403Share is not forkable, has expired, or user is not a recipient
404Share or source resource not found