Share Documents & Magic Links
Create shareable links for documents.
Endpoint
POST /api/v3/documents/{id}/share
Request
{
"permissions": "view",
"expires_in_days": 30
}
| Field | Type | Description |
|---|---|---|
permissions | string | "view" or "edit" |
expires_in_days | integer | Days until link expires (1-365) |
Response
{
"share_url": "https://app.scriptix.io/share/abc123xyz",
"share_token": "abc123xyz",
"permissions": "view",
"expires_at": "2025-02-16T10:00:00Z"
}
Examples
Create Share Link
curl -X POST https://api.scriptix.io/api/v3/documents/123/share \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"permissions": "view",
"expires_in_days": 7
}'
Python
response = requests.post(
'https://api.scriptix.io/api/v3/documents/123/share',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'permissions': 'view',
'expires_in_days': 7
}
)
share = response.json()
print(f"Share URL: {share['share_url']}")
Permissions
- view: Read-only access
- edit: Can edit document content