Skip to Content
Documents

Change a sent document's expiration date

POST
/api/v1/documents/{id}/extend-expiration

Change the expiration date of a document that has already been sent for signing. The new date can be earlier or later than the current one.

Status Requirements:

  • Document must be in PENDING or EXPIRED status. An EXPIRED document returns to PENDING. A document in any other status returns 409 INVALID_STATE. For DRAFT documents, set expiresAt with PATCH /api/v1/documents/{id} instead.

Permissions:

  • Requires the EDIT_DOCUMENT workspace permission.

Request Body:

  • expiresAt (required) - The new expiration date/time (ISO 8601). Must be at least 24 hours in the future.

What happens:

  1. The document's expiresAt is updated.
  2. An audit log entry is recorded.
  3. Every recipient that is still notifiable (has an email, notifications enabled, delivery method other than NONE, and has not rejected) is emailed that the signing deadline has moved.

Response: Returns the document in the same shape as GET /api/v1/documents/{id}, without fields.

Authorization

headerAuthorizationBearer <token>

API key, e.g. Authorization: Bearer sajn_svc_.... Not scope-limited: acts with its owner's workspace role.

Path Parameters

id*string

The document ID.

Header Parameters

Sajn-Version?string

API version for this request. Without it, the request uses the organization's default version; an organization without a default is pinned to the latest version by its first request.

Value in"2026-09""2026-10"
Sajn-Workspace?string

ID of the workspace this request acts in, from GET /api/v1/workspaces. Without it, an API key acts in its default workspace. The token's user must be a member of the workspace; an OAuth token only accepts the workspace it was granted for. A workspace that doesn't exist or can't be reached returns 403 WORKSPACE_ACCESS_DENIED.

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

Change the expiration date of a PENDING or EXPIRED document. Recipients are notified that the deadline moved.

expiresAt*string

New expiration date/time (ISO 8601). Must be at least 24 hours in the future. Can be earlier or later than the current expiration.

Formatdate-time

Response Body

200

application/json
  1. response
id*string

Unique document identifier

externalId*|

Your external reference ID for this document

expiresAt*|

Date and time when the document expires

Formatdate-time
name*string

Document name/title

status*string

Document status

Value in"DRAFT""PENDING_APPROVAL""PENDING""COMPLETED""EXPIRED""CANCELLED""REJECTED""IMPORTED"
documentMeta*|

Document metadata including subject, message, signing order, etc.

createdAt*string

Date and time when the document was created

Formatdate-time
updatedAt*string

Date and time when the document was last updated

Formatdate-time
completedAt*|

Date and time when all signers completed signing

Formatdate-time
deletedAt*|

Date and time when the document moved to the trash, or null when it isn't in the trash

Formatdate-time
templateId*|

ID of the template the document was created from, or null

folderId*|

ID of the folder that holds the document, or null at the top level

responsibleUserId*|

ID of the workspace member responsible for the document

parties*array<>

Array of document parties (signers and other participants).

tags*array<>
customFields*array<>
content*array<>|

Content blocks in position order when you pass expand=content, and null otherwise. See the content endpoints for the per-type shapes.

productTables*array<>

Every product table on the document, resolved: each row carries the recipient's final selected state and quantity, and the totals count the selected rows only. Empty when the document has no product table.

approvalRequestId*|

ID of the document's approval request, or null when it has none. To read it, call GET /api/v1/approval-requests/{id}.

bundleId*|

ID of the bundle the document was sent in, or null. Every document in a bundle also fires its own events, so this is the key that groups them. To read the bundle, call GET /api/v1/bundles/{id}.

Example Request
curl -X POST 'https://app.sajn.se/api/v1/documents/cm4k2x9p10003abcd1234efgh/extend-expiration' \  -H 'Content-Type: application/json' \  -d '{  "expiresAt": "2026-11-15T22:00:00.000Z"}'
Example Response
{  "id": "cm4k2x9p10003abcd1234efgh",  "externalId": "HR-2026-0142",  "expiresAt": "2026-11-15T22:00:00.000Z",  "name": "Anställningsavtal – Kai Lindqvist",  "status": "PENDING",  "documentMeta": {    "subject": "Ditt anställningsavtal från Exempelbolaget AB",    "message": "Hej Kai! Här är ditt anställningsavtal. Signera det med BankID senast den 28 oktober.",    "signingMode": "PARALLEL",    "forceReadFullDocument": false,    "showChatToSigners": false,    "language": "sv",    "value": "540000",    "redirectUrl": null,    "redirectEnabled": true,    "internalRecipients": [      "hr@example.com"    ],    "signableAfterExpired": false,    "sendPlainTextEmailOnly": false,    "reminderIntervalDays": 3,    "allowDelegation": false,    "openVerification": "PIN",    "aiChatEnabled": false,    "nationalIdDisplayMode": "FULL",    "sameDeviceSigning": false,    "documentCategoryId": "cm4k2x9p10017abcd1234efgh"  },  "createdAt": "2026-09-28T09:12:00.000Z",  "updatedAt": "2026-09-28T09:15:00.000Z",  "completedAt": null,  "deletedAt": null,  "templateId": "cm4k2x9p10008abcd1234efgh",  "folderId": "cm4k2x9p10011abcd1234efgh",  "responsibleUserId": "cm4k2x9p10002abcd1234efgh",  "parties": [    {      "id": "cm4k2x9p10004abcd1234efgh",      "documentId": "cm4k2x9p10003abcd1234efgh",      "email": "kai@example.com",      "name": "Kai Lindqvist",      "phone": "+46701740605",      "type": "INDIVIDUAL",      "company": null,      "externalId": "HR-2026-0142",      "contactId": "cm4k2x9p10006abcd1234efgh",      "nationalId": "191212121212",      "country": "SE",      "role": "SIGNER",      "signingOrder": 1,      "signedAt": "2026-09-29T07:41:00.000Z",      "readStatus": "READ",      "signingStatus": "SIGNED",      "delivery": [        "EMAIL"      ],      "signatureMethod": "SE_BANKID",      "signVerification": "PIN",      "openVerification": "PIN",      "sendStatus": "DELIVERED",      "identityVerified": true,      "identityMismatch": false,      "createdAt": "2026-09-28T09:12:00.000Z"    }  ],  "tags": [    {      "id": "cm4k2x9p10010abcd1234efgh",      "name": "Anställning",      "color": "#16A34A"    }  ],  "customFields": [    {      "id": "cm4k2x9p10016abcd1234efgh",      "name": "Startdatum",      "type": "TEXT",      "value": "2026-11-01"    }  ],  "content": [    {      "id": "cm4k2x9p10009abcd1234efgh",      "documentId": "cm4k2x9p10003abcd1234efgh",      "templateId": null,      "type": "TEXT",      "position": 0,      "fieldMeta": {        "type": "TEXT",        "content": "<p>Anställningen gäller tills vidare från och med den 1 november 2026, med sex månaders provanställning.</p>"      },      "createdAt": "2026-09-28T09:12:00.000Z",      "updatedAt": "2026-09-28T09:12:00.000Z"    }  ],  "productTables": [    {      "fieldId": "cm4k2x9p10009abcd1234efgh",      "name": "Anställningsavtal – Kai Lindqvist",      "currency": "SEK",      "language": "sv",      "allowSelection": false,      "selectionPartyId": "cm4k2x9p10004abcd1234efgh",      "selectionRequired": false,      "sections": [        {          "id": "cm4k2x9p10037abcd1234efgh",          "name": "Utbildningar",          "pickOne": false        }      ],      "rows": [        {          "id": "cm4k2x9p10036abcd1234efgh",          "sku": "UTB-INTRO",          "name": "Introduktionsutbildning",          "description": "Introduktionsutbildning.",          "unit": "st",          "price": 4500,          "vat": 25,          "billing": "ONE_TIME",          "discount": {            "type": "PERCENT",            "value": 1          },          "optional": false,          "selected": false,          "quantity": 1,          "lineTotal": 1,          "lineNet": 1,          "lineVat": 1,          "sectionId": "cm4k2x9p10037abcd1234efgh",          "productType": "GOODS"        }      ],      "totals": {        "subtotal": 4500,        "discountAmount": 1,        "vatAmount": 1125,        "total": 1,        "rotDeduction": 1,        "rutDeduction": 1,        "payable": 5625,        "byBilling": {          "ONE_TIME": {            "subtotal": 4500,            "vatAmount": 1125,            "total": 1          },          "MONTHLY": {            "subtotal": 4500,            "vatAmount": 1125,            "total": 1          },          "QUARTERLY": {            "subtotal": 4500,            "vatAmount": 1125,            "total": 1          },          "YEARLY": {            "subtotal": 4500,            "vatAmount": 1125,            "total": 1          }        }      }    }  ],  "approvalRequestId": "cm4k2x9p10003abcd1234efgh",  "bundleId": "cm4k2x9p10044abcd1234efgh"}

Was this page helpful?