Docs menu

Create share link legacy

POST /v1/organisations/{organisation_id}/workspaces/{workspace_id}/share-links Deprecated

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_id path string required
  • workspace_id path string required

Request body

application/json CreateShareLink required

  • access ShareAccess | null
  • audience ShareAudience | null
  • budget_credits integer (int32) | null

    App 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_id string | null

    The conversation whose composer offered the link, which the caller reads; recorded with the link's creation.

  • entry_id string required

    A file's or folder's id, or with entry_kind app an app's id.

  • entry_kind ShareEntryKind | null
  • expires_at string (date-time) | null

    Left 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.

  • notify ShareNotify | null
  • password string | null

    8-128 characters; stored as an Argon2id hash.

  • pin_version integer (int32) | null

    A file's version number to serve; left out or null follows the newest clean version.

  • role ShareRole | null

Responses

  • 201 application/json CreatedShareLink

    The link and its URL, shown once

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    forbidden: space editors and admins only; external_links_disabled; external_links_people_only for API keys; app_links_off, app_link_role_capped (details.max_role), app_links_people_only; workspace_content_restricted, insufficient_scope, invalid_origin

  • 404 application/json ErrorBody

    No such space, file or folder

  • 409 application/json ErrorBody

    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

  • 413 application/json ErrorBody

    storage_limit_reached: the organisation has no room for the app's share files

  • 422 application/json ErrorBody

    validation_failed, password_required, expiry_required, expiry_too_long, recipient_not_in_organisation, app_not_shareable; unsupported in the Local organisation

  • 429 application/json ErrorBody

    rate_limited: too many link emails today; too_many_uploads: the creator's uploads are busy while an app link copies its files; retry

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    email_unavailable when notify is set but email isn't configured; or unavailable: the database is briefly unavailable; retry after Retry-After seconds

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_found generic 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
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/workspaces/$WORKSPACE_ID/share-links" \
  -H "Authorization: Bearer $IVY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entry_id":"entry_123"}'
JavaScript SDK
import { client, createShareLinkLegacy } 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 createShareLinkLegacy({
  path: { organisation_id: organisationId, workspace_id: workspaceId },
  body: {
    entry_id: "entry_123"
  },
});
Example request body
{
  "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"
}
Example response (201)
{
  "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"
}