Skip to Content

Link document to another document

You're viewing API version 2026-09, which is deprecated and stops working on October 1, 2027. To move your integration, see Upgrading to 2026-10.
POST
/api/v1/documents/{id}/links

Create a link from this document to another document in the same organization.

Required Fields:

  • toDocumentId - The document to link to
  • linkType - AMENDS, REPLACES, RENEWS or RELATES_TO (this document acts on the target)

Both documents must be accessible to the acting user. RELATES_TO is symmetric — the same pair can only be related once regardless of direction.

Authorization

headerAuthorizationBearer <token>

Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.

Path Parameters

id*string

Header Parameters

authorization*string

Bearer token for API authentication

Idempotency-Key?string

Makes retries safe. A retry with the same key and the same request replays the stored response for 24 hours (header Idempotent-Replayed: true); the same key with a different request returns 400.

Lengthlength <= 255

Request Body

Body

application/json
  1. body
toDocumentId*string

The document to link to (the older/passive end)

Length1 <= length
linkType*string

How this document relates to the target

Value in"AMENDS""REPLACES""RENEWS""RELATES_TO"

Response Body

200

application/json
  1. response
id*string

Link ID

fromDocumentId*string
toDocumentId*string
linkType*string
Value in"AMENDS""REPLACES""RENEWS""RELATES_TO"
origin*string|null
createdAt*unknown
Example Request
curl -X POST 'https://app.sajn.se/api/v1/documents/string/links' \  -H 'authorization: string' \  -H 'Content-Type: application/json' \  -d '{  "toDocumentId": "string",  "linkType": "AMENDS"}'
Example Response
{  "id": "string",  "fromDocumentId": "string",  "toDocumentId": "string",  "linkType": "AMENDS",  "origin": "string",  "createdAt": null}

Was this page helpful?