Create share link
POST /v1/organisations/{organisation_id}/spaces/{space_id}/share-links
Creates a link to a file or folder, or with entry_kind = app to an app. The URL carries a random token that Ivy stores only as a hash, so it is shown only in this response. External links (audience = anyone) need the organisation's setting and a person; notify emails the link. An app link creates a share space with copies of the app's [share] files and a link identity every visitor acts as, with the link's role.
Authentication
Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work
Scope the API key needs: share_links:write
Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)
Parameters
-
organisation_idpathstringrequired -
space_idpathstringrequired
Request body
application/json CreateShareLink required
-
accessShareAccess|null -
audienceShareAudience|null -
budget_creditsinteger (int32)|nullApp links: the link identity's credits a billing period, 1 to the organisation's
max_app_link_budget_credits; defaults to 100.minimum 0 -
conversation_idstring|nullThe conversation whose composer offered the link, which the caller reads; recorded with the link's creation.
-
entry_idstringrequiredA file's or folder's id, or with
entry_kindappan app's id. -
entry_kindShareEntryKind|null -
expires_atstring (date-time)|nullLeft out: external links expire after 7 days (or the organisation's maximum), others never.
null: no expiry, unless the organisation forces one for external links. -
notifyShareNotify|null -
passwordstring|null8-128 characters; stored as an Argon2id hash.
-
pin_versioninteger (int32)|nullA file's version number to serve; left out or
nullfollows the newest clean version. -
roleShareRole|null
Responses
-
The link and its URL, shown once
-
unauthenticated -
forbidden: space editors and admins only;external_links_disabled;external_links_people_onlyfor API keys;app_links_off,app_link_role_capped(details.max_role),app_links_people_only;workspace_content_restricted,insufficient_scope,invalid_origin -
No such space, file or folder
-
workspace_archived,share_link_limit_reached,app_link_limit_reached,app_not_approved,workspace_limit_reached;share_link_busy: the link or its organisation's app links are being changed; retry -
storage_limit_reached: the organisation has no room for the app's share files -
validation_failed,password_required,expiry_required,expiry_too_long,recipient_not_in_organisation,app_not_shareable;unsupportedin the Local organisation -
rate_limited: too many link emails today;too_many_uploads: the creator's uploads are busy while an app link copies its files; retry -
internal -
email_unavailablewhennotifyis set but email isn't configured; orunavailable: the database is briefly unavailable; retry afterRetry-Afterseconds
Error codes
Errors come back as an ErrorBody whose code is one of these.
- 401
unauthenticated - 403
forbiddenexternal_links_disabledexternal_links_people_onlyapp_links_offapp_link_role_cappedapp_links_people_onlyworkspace_content_restrictedinsufficient_scopeinvalid_origin - 404
not_foundgeneric code for this status - 409
workspace_archivedshare_link_limit_reachedapp_link_limit_reachedapp_not_approvedworkspace_limit_reachedshare_link_busy - 413
storage_limit_reached - 422
validation_failedpassword_requiredexpiry_requiredexpiry_too_longrecipient_not_in_organisationapp_not_shareableunsupported - 429
rate_limitedtoo_many_uploads - 500
internal - 503
email_unavailableunavailable
Examples
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/spaces/$SPACE_ID/share-links" \
-H "Authorization: Bearer $IVY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"entry_id":"entry_123"}' import { client, createShareLink } from "@spacivapp/ivy-sdk";
client.setConfig({
baseUrl: process.env.IVY_API_URL,
headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});
const { data, error, response } = await createShareLink({
path: { organisation_id: organisationId, space_id: spaceId },
body: {
entry_id: "entry_123"
},
}); {
"access": "view",
"audience": "organisation",
"budget_credits": 0,
"conversation_id": "conversation_123",
"entry_id": "entry_123",
"entry_kind": "file",
"expires_at": "2026-01-15T09:30:00Z",
"notify": {
"emails": [
"string"
],
"message": "A short explanation for people"
},
"password": "string",
"pin_version": 1,
"role": "viewer"
} {
"emailed": 0,
"share_link": {
"access": "view",
"app": {
"budget_credits": 0,
"chosen_role": {},
"last_copy_at": "2026-01-15T09:30:00Z",
"left_out": [],
"refresh": {},
"share_space_id": "share_space_123",
"share_space_name": "Ada Lovelace",
"share_workspace_id": "share_workspace_123",
"share_workspace_name": "Ada Lovelace"
},
"audience": "organisation",
"can_revoke": false,
"created_at": "2026-01-15T09:30:00Z",
"created_by": {
"id": "id_123",
"name": "Ada Lovelace",
"type": "user"
},
"download_count": 0,
"entry_id": "entry_123",
"entry_kind": "file",
"entry_name": "Ada Lovelace",
"expires_at": "2026-01-15T09:30:00Z",
"id": "id_123",
"last_opened_at": "2026-01-15T09:30:00Z",
"open_count": 0,
"password_protected": false,
"paused_reason": "creator_lost_access",
"revoked_at": "2026-01-15T09:30:00Z",
"role": "viewer",
"space_id": "space_123",
"state": "active",
"version": 1,
"workspace_id": "workspace_123"
},
"url": "https://example.com"
}