Back to API Overview

Sharing API

Create and manage share links for resources including files, flows, and bases.

9 endpoints

Endpoints

POST
/api/v1/sharing/createShare

Create a share link for a resource (file, flow, base, folder)

Parameters

resourceTypestringrequired

Resource type: "FILE", "FLOW", "BASE", or "FOLDER"

resourceIdstringrequired

ID of the resource to share

accessTypestring

"RESTRICTED" for specific users, "ANYONE_WITH_LINK" for public

permissionstring

Permission level

sharedWithstring

Email for restricted shares

allowDownloadboolean

Allow downloading

allowCopyboolean

Allow copying

requireAuthboolean

Require login to access

expiresAtstring

Expiration date

passwordstring

Password protection (will be hashed)

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/createShare \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "resourceType": "example",
  "resourceId": "example",
  "accessType": "example"
}'
POST
/api/v1/sharing/getResourceShares

Get all shares for a resource

Parameters

resourceTypestringrequired

Resource type

resourceIdstringrequired

Resource ID

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/getResourceShares \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "resourceType": "example",
  "resourceId": "example"
}'
POST
/api/v1/sharing/getShareByResourceId

Get share info by resource ID (public)

Parameters

resourceTypestringrequired

Resource type

resourceIdstringrequired

Resource ID

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/getShareByResourceId \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "resourceType": "example",
  "resourceId": "example"
}'
POST
/api/v1/sharing/getShareByToken

Get share info by token (public)

Parameters

shareTokenstringrequired

Share token from the URL

passwordstring

Password if share is protected

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/getShareByToken \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "shareToken": "example",
  "password": "example"
}'
POST
/api/v1/sharing/updateShare

Update share settings

Parameters

shareIdstringrequired

Share ID to update

accessTypestring

New access type

permissionstring

New permission level

allowDownloadboolean

Allow downloading

allowCopyboolean

Allow copying

requireAuthboolean

Require login to access

expiresAtstring

New expiration (null to remove)

passwordstring

New password (null to remove)

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/updateShare \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "shareId": "example",
  "accessType": "example",
  "permission": "example"
}'
POST
/api/v1/sharing/revokeShare

Revoke a share link

Parameters

shareIdstringrequired

Share ID to revoke

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/revokeShare \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "shareId": "example"
}'
POST
/api/v1/sharing/deleteShare

Permanently delete a share

Parameters

shareIdstringrequired

Share ID to delete

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/deleteShare \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "shareId": "example"
}'
POST
/api/v1/sharing/recordActivity

Record share activity (views, downloads)

Parameters

shareTokenstringrequired

Share token from the URL

actionstringrequired

Activity action type

actorEmailstring

Email of the viewer (if known)

ipAddressstring

IP address

userAgentstring

Browser user agent

metadataobject

Additional metadata

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/recordActivity \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "shareToken": "example",
  "action": "example",
  "actorEmail": "example"
}'
POST
/api/v1/sharing/getShareActivity

Get activity log for a share

Parameters

shareIdstringrequired

Share ID

limitnumber

Max activities to return (1-100, default: 50)

offsetnumber

Skip activities for pagination

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/sharing/getShareActivity \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "shareId": "example",
  "limit": 0,
  "offset": 0
}'
Sharing API - Serenities