Skip to main content
POST
Issue a direct-share link for a Struct or Batch
Mints a token for a schema or a batch. For a batch the acceptance is full edit access. The secret is the token — treat it like a key.

Authorizations

Authorization
string
header
required

Organisation API key from Settings → API / /api/keys/. The secret is shown once. Send Authorization: Bearer sk-abacus-…. One active key per organisation. Ingest (/api/v2/ingest/*) refuses API keys — that surface is Auth0-only with ingest:read / ingest:write scopes.

Body

application/json

Input for POST /api/v2/library/share/links/.

The view resolves (content_type, object_id) to a concrete Struct or Batch instance, enforces org-match + owner-or-mod semantics, and inserts the link row. This serializer just validates input shape.

content_type
enum<string>
required
  • struct - struct
  • batch - batch
Available options:
struct,
batch
object_id
integer
required
Required range: x >= 1
note
string
Maximum string length: 500

Response

Output projection for a :class:DirectShareLink row.

Composed for the list endpoint (owner-side roster) and as the response body of every mutation endpoint.

The acceptances field carries the roster — recipients do NOT see other users' acceptances (Decision 33), so the view layer is responsible for nulling this out (or using a different serializer class entirely) on recipient-facing endpoints.

The url field is the fully-qualified token-landing URL, built from the request's build_absolute_uri when available. Falls back to a relative path otherwise.

id
integer
required
read-only
content_type
string
required
read-only
object_id
integer
required
read-only
content_object_summary
object | null
required

Tiny shape: just enough to render a share row in the UI.

Mirrors :class:deckmonkey.api_v2.library.serializers._ContentObjectSummarySerializer so the SPA's orval client gets a stable shape between org-library and direct-share surfaces. For Struct rows: {"id", "slug", "name", "status", "kind"}; for Batch rows: {"id", "name", "status", "kind"}.

Named with a _DirectShare prefix to avoid a drf-spectacular component-name collision with the org-library serializer of the same role (same shape, but spectacular keys components by Python class name).

token
string
required
read-only
url
string | null
required
read-only
created_by
object | null
required

Compact user projection for created_by / revoked_by / accepted_by.

Named with a _DirectShare prefix to avoid a drf-spectacular component-name collision with :class:deckmonkey.api_v2.library.serializers._ActorSerializer.

created_at
string<date-time>
required
read-only
revoked_at
string<date-time> | null
required
read-only
revoked_by
object | null
required

Compact user projection for created_by / revoked_by / accepted_by.

Named with a _DirectShare prefix to avoid a drf-spectacular component-name collision with :class:deckmonkey.api_v2.library.serializers._ActorSerializer.

is_revoked
boolean
required
read-only
note
string
required
read-only
acceptances
object[]
required
read-only