NextSign API
Cases

Case Update

Update an existing case using PATCH /api/v2/{company}/case/{case_id}/update.

Case Update

Use this endpoint to update a case after it has been created. You can change the case lifecycle status, update general case settings, patch an existing recipient, append new recipients, and append documents.

Authorization

All requests to this endpoint require authentication using a Bearer Token.

Use your NextSign API key as the bearer token for this endpoint.

PATCH is the documented method for this endpoint. POST is also accepted for backwards compatibility.


Endpoint

PATCH https://www.nextsign.dk/api/v2/{company}/case/{case_id}/update

Path Parameters

ParameterTypeDescription
companystringYour company identifier
case_idstringUnique identifier of the case to update

Request Body

FieldTypeRequiredDescription
titlestringNoUpdate the case title
referenceIdstringNoUpdate or clear the internal reference ID
statusstringNoPublic lifecycle status. Supported values: draft, open, completed, denied, cancelled. Aliases pending -> open and signed -> completed are also accepted
statestringNoAlias for status using canonical lifecycle values
completedReasonstringNoOptional reason stored when the case is marked as completed
settingsobjectNoMerge into the existing case settings. Availability expiration is recalculated from settings.availability.days
signingSchemasarrayNoReplace the case-level signing methods. Each recipient only sees the ones that fit their needsCpr, see Signing Schemas. Blocked after any recipient has signed
recipientobjectNoPatch one existing recipient. recipient._id or recipient.id is required. Blocked after any recipient has signed
recipientsarrayNoAppend new recipients to the case. Blocked after any recipient has signed
addDocumentsarrayNoAppend new documents to the case. Blocked after any recipient has signed

status on this endpoint changes the case lifecycle itself. This is different from the status filter on Case List, which describes signing progress derived from the recipients on the case.

Changing status or state here updates the stored case lifecycle directly. It does not send cancellation emails or run other side effects from dedicated dashboard actions such as the separate cancel flow.

Important After First Signature

Once any recipient has signed, the signing package should be treated as locked.

The update endpoint rejects these contract-shape changes after the first signature:

  • Changing signingSchemas
  • Updating recipient
  • Adding recipients
  • Adding addDocuments

If you need to make one of those changes after someone has signed, re-send a new contract/case instead of editing the existing one.

Possible States

ValueMeaning
draftThe case exists but is not open for signing yet
openThe case is active and can be signed
completedThe case has been marked as completed or fully finished
deniedThe case has been denied during the signing flow
cancelledThe case has been cancelled

Alias values accepted on status:

  • pending maps to open
  • signed maps to completed

Recipient Patch Fields

FieldTypeDescription
_idstringExisting recipient identifier
idstringAlias for _id
namestringUpdated recipient name
emailstringUpdated recipient email
phonestringUpdated recipient phone number
needsCprbooleanEnable or disable CPR validation
cprstringNew CPR number. It is encrypted before storage
clearCprbooleanSet to true together with an empty cpr value to clear stored CPR data
signingbooleanWhether the recipient must sign
signingSchemastringForce a recipient-specific signing method
groupnumberPreferred signing order/group
ordernumberLegacy alias for group
templatestringRecipient-specific template id. An unknown id is ignored and the recipient keeps its current template (see Template Not Found)
typestringDelivery type such as email, sms, or eboks
eboksobjecte-Boks delivery payload. See the e-Boks Object for method, cvr, address, and name
redirectUrlstringRedirect URL after signing

Add Recipient Fields

New recipients appended with recipients use the same structure as Case Create. An unknown template falls back to the case template (see Template Not Found).

Add Document Fields

FieldTypeDescription
namestringFile name including extension
filestringHosted file URL or base64 file data
fileIsBlobbooleanSet to true when file contains base64 data
signObligatedbooleanWhether signing is required for the document

Example Request

cURL
curl --location --request PATCH 'https://www.nextsign.dk/api/v2/{company}/case/{case_id}/update' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data-raw '{
    "status": "completed",
    "completedReason": "Handled manually outside NextSign",
    "title": "Lejeaftale - afsluttet",
    "referenceId": "Jrn. 2342-23B",
    "settings": {
      "reminders": {
        "send": false
      },
      "availability": {
        "days": 14
      }
    },
    "signingSchemas": [
      "urn:grn:authn:dk:mitid:low",
      "urn:grn:authn:dk:mitid:substantial",
      "draw"
    ],
    "recipient": {
      "_id": "65ab12cd34ef56ab78cd90af",
      "email": "kunde@example.com",
      "signingSchema": "urn:grn:authn:dk:mitid:low"
    }
  }'

Example Response

200 OK
{
  "success": true,
  "status": "case_updated",
  "errors": [],
  "notices": [],
  "newDocuments": [],
  "case": {
    "_id": "657b2ffb0965b111023fb0d1",
    "title": "Lejeaftale - afsluttet",
    "referenceId": "Jrn. 2342-23B",
    "state": "completed",
    "signingSchemas": [
      "urn:grn:authn:dk:mitid:low",
      "urn:grn:authn:dk:mitid:substantial",
      "draw"
    ],
    "settings": {
      "deletion": {
        "autoDelete": true,
        "days": 30
      },
      "availability": {
        "days": 14,
        "isExpired": false,
        "unlimited": false,
        "expiration": "2026-06-24T09:10:14.271Z"
      },
      "reminders": {
        "send": false,
        "amount": 2,
        "daysBetween": 3
      }
    },
    "updatedAt": "2026-06-10T09:10:14.294Z"
  }
}

Response Fields

FieldTypeDescription
successbooleanIndicates whether the update was applied
statusstringOperation status, typically case_updated
errorsarrayValidation or processing errors
noticesarrayInformational messages
newDocumentsarrayDocuments appended during this update request
caseobjectUpdated case payload
case.statestringStored lifecycle status of the case

Template Not Found

An unknown template id, for example a deleted template or a mistyped id, is ignored, and the update still returns 200. A patched recipient keeps its current template, and an appended recipient gets the case template. Each ignored id gets a notice that names the field:

{
  "code": "message-template-not-found",
  "field": "recipient.template",
  "message": "recipient.template was not found for this company and was ignored"
}

Common Error Responses

Invalid lifecycle status:

{
  "success": false,
  "errors": [
    {
      "message": "Invalid status. Use draft, open, completed, denied, cancelled, pending, or signed."
    }
  ],
  "notices": [],
  "newDocuments": []
}

Blocked after first signature:

{
  "success": false,
  "errors": [
    {
      "message": "Cannot add documents after a recipient has signed. Re-send a new contract instead."
    }
  ],
  "notices": [],
  "newDocuments": []
}

Case not found (404):

{
  "message": "Case not found"
}

Recipient not found:

{
  "message": "Recipient not found"
}