Skip to content

Update project sharing

PATCH
/projects/{projectId}/sharing
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const sharing = await client.projects.sharing.update({
projectId: '<projectId>',
sharing_mode: 'restricted',
allow_link_comments: true,
passphrase: '<passphrase>',
});
console.log(sharing);

Changes the project’s link sharing explicitly. Set sharing_mode to restricted to unshare (every share link stops resolving), or to view or edit to open it — the response then carries the link for that mode, created if needed; edit requires the workspace plan to include editable sharing (paid_plan_required otherwise). allow_link_comments and passphrase apply to the link and are rejected while sharing is restricted. Only fields present in the body change. Returns the resulting sharing state.

Error responses use the standard error body.

projectId
required

Project identifier

string
/^prj_\S+$/

Project identifier

Media type application/json
object
sharing_mode

New link sharing mode. restricted revokes every share link; view or edit opens sharing and the response carries the link for that mode, created if needed.

string
Allowed values: restricted view edit
allow_link_comments

Whether visitors arriving through the link may leave comments

boolean
passphrase
Any of:
string
<= 200 characters

Sharing updated.

Media type application/json
object
project_id
required

Project identifier

string
/^prj_\S+$/
workspace_id
required

Workspace identifier

string
/^ws_\S+$/
sharing_mode
required

Link sharing mode: restricted (no links; members only), view (anyone with the link can view), edit (anyone with the link can edit)

string
Allowed values: restricted view edit
is_private
required

True when only the owner and the people it was shared with can see the project, rather than the whole workspace

boolean
can_manage_sharing
required

Whether the authenticated user may change this project’s sharing

boolean
link
required
Any of:
object
url
required

Link into the project. Anyone who has it gets the link’s role, so treat it as a secret.

string format: uri
role
required

What the link grants: guest can view (and comment when allowed), editor can edit

string
Allowed values: guest editor
allow_comments
required

Whether visitors arriving through the link may leave comments

boolean
passphrase_protected
required

Whether visitors must enter a passphrase before the link resolves. The passphrase itself is never returned.

boolean
owner
required

Project owner

object
name
required

Display name

string
email
required

Email address

string
members
required

People with a seat on the project besides the owner

Array<object>
object
name
required

Display name

string
email
required

Email address

string
role
required

Role on the project

string
canvas_url
required

Project canvas URL

string format: uri
Example
{
"project_id": "prj_abc123",
"workspace_id": "ws_abc123",
"sharing_mode": "restricted",
"link": {
"role": "guest"
},
"owner": {
"name": "Ada Lovelace",
"email": "[email protected]"
},
"members": [
{
"name": "Ada Lovelace",
"email": "[email protected]",
"role": "editor"
}
]
}