Sharing API
Grant other users or deployments access to a resource without exposing it to the Public space, using the DIAL Core Sharing API. This guide is for developers building sharing workflows on top of the Unified API. You should understand DIAL access control and how resources are stored in private spaces.
In DIAL, a resource is a conversation, prompt, file, or application, owned by a user or a deployment (an application or Toolset). When created, a resource lives in its owner's private folder. Sharing grants specific recipients access to it while keeping it out of the public file space. When a user shares a resource, it becomes available in DIAL Chat and the Catalog, where recipients can discover and use it.
The Sharing API has two perspectives: the resource owner and the resource recipient. It also includes a separate set of endpoints for deployments that need to share resources with each other during a request.
Users can authenticate to the Sharing API with either a JWT or an API key. Deployments must use per-request keys.
Endpoints for resource owners
| Endpoint | Description |
|---|---|
create | Share a resource by creating an invitationLink that contains an invitationId. Grant READ or WRITE access. Add the SHARE permission to let recipients re-share the resource with READ access; use maxAcceptedUsers to cap how many users can accept the link (unlimited by default). SHARE can only be combined with another permission, and re-sharing is limited to READ. The system does not support listing all recipients of a shared resource. |
copy | Add permissions for a new resource. For example, when a new attachment is added to an already-shared conversation, this ensures recipients can access the updated resource, including the new attachment. |
list | Query all resources you have shared. Send "with": "others" in the request body. When a conversation with attachments is shared, the attachments appear as separate shared resources. |
revoke | Stop sharing a resource. The content becomes inaccessible to all recipients, and any associated invitation link stops working. |
invitations | List all active invitations you have created. Invitations are created by the create endpoint. |
invitations/{invitationId} | Use the DELETE method to revoke a specific invitation. |
When an owner or recipient changes a shared resource, DIAL Core uses the HTTP ETag to version the resource and resolve conflicts. Use the Subscribe API to be notified of changes made by other users or deployments.
Endpoints for resource recipients
| Endpoint | Description |
|---|---|
discard | Stop using a shared resource. The resource is no longer marked as shared for the owner. |
list | Query all resources shared with you. Send "with": "me" in the request body. |
invitations/{invitationId} | Use the GET method to view invitation details and to accept the invitation. |
create | Re-share a resource you received with the SHARE permission, creating a new invitationLink. You can grant only READ access when re-sharing. |
Workflow examples
Basic workflow
- The owner shares a resource with
createand gives the invitation link to the recipient. - The recipient extracts the
invitationIdfrom the link and callsinvitations/{invitationId}to accept the resource. - The recipient lists shared resources and their details with
list.
Revoke workflow
- The owner shares a resource with
createand gives the invitation link to the recipient. - The recipient accepts the resource with
invitations/{invitationId}. - The owner revokes access with
revoke. - The recipient can no longer access the resource.
Re-share workflow
- The owner shares a resource with
create, including the SHARE permission, and gives the invitation link to the recipient. - The recipient accepts the resource with
invitations/{invitationId}. - The recipient re-shares the resource with
createand gives a new invitation link to a second recipient. - The second recipient accepts the resource with
invitations/{invitationId}. - The second recipient lists shared resources with
list.
Re-sharing rules
The SHARE permission lets a recipient re-share a resource. A re-shared resource is always granted with READ access only. DIAL Core validates each re-share request and returns 400 when a rule is violated:
- The original owner must have shared the resource with the SHARE permission.
- The invitation must be within its time-to-live, governed by the
invitation_ttlDIAL Core dynamic setting. - The re-share permission set must not include WRITE — only READ is allowed for re-sharing.
- The number of accepted invitations must not exceed the limit set by the
max_accepted_usersdynamic setting or bymaxAcceptedUsersin the original share request.
For these limits, see the configuration reference.
Sharing in DIAL Chat
Chat users can share resources, accept invitations, and view resources shared by or with them, all from the UI. When a conversation that includes attachments is shared, the attachments are shared as well and can be opened through the chat file manager. For the end-user workflow, see the DIAL Chat user guide.
Sharing between deployments
DIAL includes a separate API for cases where deployments — applications and Toolsets — need to share their private resources with each other to complete a task. For example, an application may need to give another application access to its files.
Authorization
Deployments must authenticate to this API with per-request keys only. A request authorized with an API key or JWT is rejected: 403 Unauthorized - Operation is only permitted by per request API key.
Time-to-live
The owner controls the time-to-live of granted permissions within the scope of the current request. The recipient can access the shared resource only during the request timeline.
Re-sharing between deployments
Granted permissions are not transitive — a recipient deployment cannot re-share them. For example, if an application grants another application read access to a file, the recipient cannot pass that access to a third deployment; it must be granted explicitly through the permissions API. Permissions granted by the owner are revoked automatically once the recipient completes the current request.
The exception is interceptors: when a resource is shared with a deployment that has interceptors, those interceptors gain access to the resource as well.
Endpoints
| Endpoint | Description |
|---|---|
per-request-permissions/grant | Share a resource by path with another deployment, identified by its ID. Grant READ and WRITE access. The recipient implicitly accepts the invitation. |
per-request-permissions/revoke | Explicitly revoke access. Until access is revoked, the recipient can reuse the permission on identical subsequent calls. |
per-request-permissions/list | List permissions granted by or to a specific deployment. |
Example
In this scenario, an application shares READ and WRITE access to a folder with another application, the recipient:
-
The application calls
per-request-permissions/grantto share its folderfiles/<app_bucket>/appdata/<folder>with the recipient deploymentapplications/<user_bucket>/<recipient_app>, granting READ and WRITE:{
"resources": [
{
"url": "files/<app_bucket>/appdata/<folder>",
"permissions": ["READ", "WRITE"]
}
],
"receiver": "applications/<user_bucket>/<recipient_app>"
} -
DIAL Core records the grant against the application's per-request key.
-
The application calls the recipient to perform an action that needs the shared folder.
-
DIAL Core issues a new per-request key to the recipient and, finding that the application shared resources with it, records the grant against the recipient's key.
-
The recipient writes to the shared folder through DIAL Core.
-
When the recipient's call completes, DIAL Core invalidates its per-request key and the associated permissions.
Result
You can share resources with users and deployments, manage invitations, revoke access, support controlled re-sharing, and grant transient access between deployments during a request.
Further reading
- Notifications — subscribe to changes on shared resources
- Publications API — publish private resources to the Public space and review them
- Per-request keys — the credentials deployments use to share resources
- Collaboration and sharing — how sharing and publication give colleagues controlled access
- Public and private access — how to narrow public access and extend private access through sharing
- Sharing API reference — every sharing endpoint and field