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
Create a link from this document to another document in the same organization.
Required Fields:
toDocumentId- The document to link tolinkType- 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.
header
AuthorizationBearer <token>Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.
id*stringIdempotency-Key?stringMakes 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.
Length
length <= 255Body
application/json- body
toDocumentId*stringThe document to link to (the older/passive end)
Length
1 <= lengthlinkType*stringHow this document relates to the target
Value in
"AMENDS""REPLACES""RENEWS""RELATES_TO"200
application/json- response
id*stringLink ID
fromDocumentId*stringtoDocumentId*stringlinkType*stringValue in
"AMENDS""REPLACES""RENEWS""RELATES_TO"origin*string|nullcreatedAt*unknowncurl -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?