Update project 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);curl -X PATCH 'https://app.flora.ai/api/v1/projects/<projectId>/sharing' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "sharing_mode": "restricted", "allow_link_comments": true, "passphrase": "<passphrase>"}'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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Project identifier
Project identifier
Request Body
Section titled “Request Body ”object
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.
Whether visitors arriving through the link may leave comments
Responses
Section titled “ Responses ”Sharing updated.
object
Project identifier
Workspace identifier
Link sharing mode: restricted (no links; members only), view (anyone with the link can view), edit (anyone with the link can edit)
True when only the owner and the people it was shared with can see the project, rather than the whole workspace
Whether the authenticated user may change this project’s sharing
object
Link into the project. Anyone who has it gets the link’s role, so treat it as a secret.
What the link grants: guest can view (and comment when allowed), editor can edit
Whether visitors arriving through the link may leave comments
Whether visitors must enter a passphrase before the link resolves. The passphrase itself is never returned.
Project owner
object
Display name
Email address
People with a seat on the project besides the owner
object
Display name
Email address
Role on the project
Project canvas URL
Example
{ "project_id": "prj_abc123", "workspace_id": "ws_abc123", "sharing_mode": "restricted", "link": { "role": "guest" }, "owner": { "name": "Ada Lovelace", }, "members": [ { "name": "Ada Lovelace", "role": "editor" } ]}