Share a Files item
POST
/api/v1/files/shares
const url = 'https://example.com/api/v1/files/shares';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"access":"example","path":"example","recipient_id":"example","recipient_kind":"user"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/files/shares \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "access": "example", "path": "example", "recipient_id": "example", "recipient_kind": "user" }'Requires a signed-in User with the data scope and permission to share the Item. It returns 400 when the share request is invalid or 403 when access is denied. Route: /api/v1/files/shares. Inputs: . Do not automatically replay this operation after an uncertain result.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
access
required
string
path
required
string
recipient_id
required
string
recipient_kind
The default preserves existing User clients; Groups retain one grant (#1028).
string
Responses
Section titled “Responses”Media typeapplication/json
object
access
required
string
created_at
required
Original grant time, in Unix seconds; access changes preserve it (§54/#1034).
integer format: int64
direction
required
string
group_name
string | null
id
required
string
owner_id
required
string
path
required
string
recipient_id
required
string
recipient_kind
required
The stored recipient identity; access resolves Group membership live (#1028).
string
Example
{ "recipient_kind": "user"}Media typeapplication/json
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}