NextSign API
Cases

Case Create

Create a case using POST /api/v2/{company}/case/create.

Case Create

Use this endpoint to create a case with recipients, settings, and documents for signing.

Authorization

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

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


Endpoint

POST https://www.nextsign.dk/api/v2/{company}/case/create

Path Parameters

ParameterTypeDescription
companystringYour company identifier

Request Body

FieldTypeRequiredDescription
titlestringYesCase title
referenceIdstringNoInternal reference ID
folderstringNoFolder name
autoSendbooleanNoSend immediately after creation
customMessagebooleanNoEnable a custom recipient message
messagestringNoCustom recipient message
user_emailstringNoSender email address
emailtemplatestringNoEmail template ID. An unknown id is ignored (see Template Not Found)
messageTemplateobjectNoA template for this case only, written into the request instead of emailtemplate. See A Template for This Case Only
settingsobjectYesCase settings
signingSchemasarrayNoAllowed signature methods
recipientsarrayYesRecipient list
documentsarrayYesDocuments to sign
tagsarrayNoValues filled into {tag} placeholders in .docx documents
signingPageobjectNoThe logo and company name recipients see for this case. See Signing Page

Signing Schemas

  • urn:grn:authn:dk:mitid:substantial (MitID Privat with CPR match, only offered to recipients with needsCpr: true)
  • urn:grn:authn:dk:mitid:low (MitID Privat, only offered to recipients with needsCpr: false)
  • urn:grn:authn:dk:mitid:business
  • urn:grn:authn:se:bankid
  • urn:grn:authn:no:bankid (Norwegian BankID, 1.5 credits, not in the default set)
  • urn:grn:authn:de:personalausweis
  • draw-cpr
  • draw
  • sms-email
  • approve (recipient-level only — see Approvers)

Each recipient is only offered the methods that fit their needsCpr. low and substantial are the same MitID Privat login without and with a CPR match, not two security levels, so a list with substantial but not low gives recipients without needsCpr no MitID Privat option at all. Send both and NextSign picks the right one per recipient. See Signing Schemas.

Recipient Fields

FieldTypeDescription
namestringRecipient name
emailstringRecipient email
signingbooleanWhether the recipient must sign
groupnumberPreferred signing order/group. Lower numbers are invited first
ordernumberLegacy alias for group on create endpoints
needsCprbooleanWhether CPR validation is required
cprstringRecipient CPR number. Required when needsCpr is true
signingSchemastringOptional recipient-specific signing method override
redirectUrlstringRedirect URL after signing. Must be sent inside the recipient object
denyRedirectUrlstringRedirect URL after the recipient denies the case. Must be sent inside the recipient object. Without it the recipient stays on the signing page; redirectUrl is never used after a denial
phonestringPhone number for SMS delivery
positionstringSignature title/position
onBehalfOfstringThe organisation the recipient signs for, e.g. Aarhus Kommune. Printed as "On behalf of" under the signature. When the recipient signs with MitID Erhverv, the company from their MitID is printed instead
typestringDelivery type. Supported values are email, phone, and eboks
templatestringOptional recipient-specific template id. An unknown id falls back to the case template (see Template Not Found)
messageTemplateobjectThis recipient's own template for this case only, instead of template. See A Template for This Case Only
messagestringCustom recipient message
eboksobjecte-Boks delivery payload. See the e-Boks Object for method, cvr, address, and name

recipient.signingSchema accepts the same values listed under Signing Schemas.

If recipient.signingSchema is omitted, the recipient falls back to the case-level signingSchemas. If it is set, that recipient is locked to the selected method and cannot choose other signing options during signing.

If needsCpr is true and recipient.signingSchema is set, CPR verification still uses urn:grn:authn:dk:mitid:substantial before the signer continues with the forced signing method.

If needsCpr is true, you must also send recipient.cpr in the payload. If recipient.cpr is missing, the signer cannot complete CPR verification.

If you need the CPR number later in your own workflow, store it on your side as well. Do not rely on NextSign as a source for recovering the original plain-text CPR value after processing.

Example recipient with CPR validation:

{
  "name": "Andreas",
  "email": "al@nextsign.dk",
  "cpr": "190497xxxx",
  "needsCpr": true,
  "signing": true
}

Approvers

An approver reviews the documents and approves them with a single click — no eID, no signature. Approvals are logged (timestamp, IP, browser) but the approver never appears on the signed documents or the signature page. An approval or rejection is charged 0.5 credits (see the credit price of each method under Signing Schemas).

Create an approver by forcing the approve method on the recipient:

{
  "name": "Andreas",
  "email": "al@nextsign.dk",
  "signing": true,
  "signingSchema": "approve",
  "group": 1
}

Approvers participate in the signing order like signers: an approver in group 1 must approve before group 2 is contacted. If the approver rejects, the whole case is denied and the case owner is notified with the rejection reason.

approve cannot be used in the case-level signingSchemas list — it is a per-recipient method only. needsCpr is not supported for approvers.

Document Fields

FieldTypeDescription
namestringFile name including extension
filestringHosted file URL, uploaded file URL, or base64 data
fileIsBlobbooleanSet to true for base64 payloads. Omit it when using an uploaded file URL
signObligatedbooleanWhether signing is required
documentMustBeReadbooleanWhether the document must be read before signing
signatoriesarraySelected signatories
mergeTagsbooleanSet to false to leave this .docx out of the template-tag merge. See Template Tags

Documents can be PDF, Word (.docx), or iXBRL / XML (.xhtml, .html, .xml). iXBRL annual reports for the Danish Business Authority (Erhvervsstyrelsen) are supported and signed with an enveloped XAdES seal. See Accepted File Types.

If the combined size of the documents in a case is more than 3.5 MB, upload the files first with Document Upload and use the returned URL in documents[].file.

Template Tags

When the request body contains a non-empty tags array, every .docx in documents is rendered with those values before it is converted to PDF — {customer_name} in the Word file becomes the value you sent. PDF documents are never affected, and a request without tags converts each .docx as-is.

FieldTypeDescription
tagstringTag name as written in the Word file, without braces
valuestring | number | arrayValue to insert
typestringTag type such as text, number, date, condition, or array
namestringOptional human-readable label stored on the case
sensitivebooleanEncrypt the value at rest on the case. The plain value is still used for the merge

See Template Tags for the {tag} placeholder syntax to write in the Word file, including conditional sections and lists.

Set mergeTags: false on an individual document to leave that file out of the merge. Use it for appendices that travel with the main contract but are not built from the same template — the file is converted to PDF unchanged, so unrelated { characters in it cannot break the render.

{
  "tags": [
    { "tag": "customer_name", "value": "Andreas", "type": "text" }
  ],
  "documents": [
    {
      "name": "Lejekontrakt.docx",
      "file": "BASE64_DATA",
      "fileIsBlob": true
    },
    {
      "name": "Bilag 1.docx",
      "file": "BASE64_DATA",
      "fileIsBlob": true,
      "mergeTags": false
    }
  ]
}

mergeTags only has an effect on this endpoint, and only on .docx documents in a request that also sends tags. Omitting it means the document takes part in the merge, so existing payloads keep their current behaviour.

Signing Page

Shows recipients another logo and company name, for this case only.

This is for groups that send for several companies from one NextSign account. Each case can carry the logo and name of the company it is sent for, so every company gets its own signing page:

{
  "signingPage": {
    "companyName": "Nordhavn Ejendomme ApS",
    "logo": "iVBORw0KGgoAAAANSUhEUgAA..."
  }
}
FieldTypeDescription
logostringBase64 PNG or JPEG data, or a logo URL previously returned by NextSign. A link to an image hosted elsewhere is not accepted
companyNamestringReplaces your company's name on the signing page and in the {company_name} and {sender_company} tags of the case's emails and SMS. At most 200 characters. Spaces at either end are removed, and a blank name is ignored

Both fields are optional and work on their own. Leave them out and the signing page shows your company's own logo and name.

The sender name and logo of the emails and SMS come from the message template, otherwise from your company. To send each company's messages in its own name and with its own logo, create a message template per company under Skabeloner in the dashboard and pass its id as emailtemplate.

In v3 the same fields are settings.logo and settings.companyName, see Company name.

Fixed Expiry Time

By default a case is available for settings.availability.days days, counted from when it is created. To have it expire at a set date and time instead, send settings.availability.expiresAt:

{
  "settings": {
    "availability": {
      "expiresAt": "2026-12-01T14:00:00+01:00"
    }
  }
}
  • Format. ISO 8601 with a date, a time and a UTC offset (Z or +01:00). A time without an offset is refused, because it doesn't say which time zone it is in. Danish time is +01:00 in winter and +02:00 in summer.
  • Range. It must be in the future and at most 3650 days ahead.
  • To the minute. From that time the signing link stops working, also for a recipient who opened it before. Within a minute the case is marked expired (availability.isExpired) and the case.expiry.expired webhook is sent.
  • In the response. availability.expiration is the time you sent, availability.exactExpiration is true, and availability.days is the number of days until then, rounded up. expiresAt itself is not stored.
  • With days. expiresAt wins, and a notice says that days was ignored.
  • CPR numbers. A case holding CPR numbers is available for at most 90 days. A later expiresAt is moved back to that limit, with a notice.

Invalid values are refused with 400 and nothing is created:

{
  "errors": [
    {
      "message": "settings.availability.expiresAt must be an ISO 8601 date and time with a UTC offset, e.g. 2026-12-01T14:00:00+01:00"
    }
  ]
}

To change the time later, see Case Update.

Large Document Upload Flow

  1. Upload the file with Document Upload
  2. Take the url from the upload response
  3. Pass that URL into documents[].file in the case creation payload

Example:

{
  "documents": [
    {
      "name": "Lejekontrakt.pdf",
      "file": "https://nextsign-dev.hel1.your-objectstorage.com/.../Lejekontrakt.pdf"
    }
  ]
}

Example Request

cURL
curl --location 'https://www.nextsign.dk/api/v2/{company}/case/create' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data-raw '{
    "title": "Lejeaftale",
    "referenceId": "Jrn. 2342-23",
    "folder": "Default",
    "autoSend": true,
    "customMessage": true,
    "message": "Kære {recipient_name}, som aftalt er hermed dokumenter til underskrift",
    "user_email": "info@example.com",
    "settings": {
      "reminders": {
        "send": true,
        "amount": 2,
        "daysBetween": 3
      },
      "lang": "da",
      "deletion": {
        "autoDelete": false,
        "days": 30
      },
      "availability": {
        "unlimited": true,
        "days": 10
      },
      "template": 2
    },
    "signingSchemas": [
      "urn:grn:authn:dk:mitid:low",
      "urn:grn:authn:dk:mitid:substantial",
      "urn:grn:authn:dk:mitid:business",
      "draw"
    ],
    "recipients": [
      {
        "name": "Andreas Lauridsen",
        "email": "al@example.com",
        "signing": true,
        "group": 0,
        "redirectUrl": "https://example.com/complete",
        "signingSchema": "urn:grn:authn:dk:mitid:business"
      }
    ],
    "documents": [
      {
        "name": "Lejekontrakt.pdf",
        "file": "YOUR_BASE64_STRING_OR_URL",
        "fileIsBlob": true
      }
    ]
  }'

Example Response

200 OK
{
  "data": {
    "user": "65ab12cd34ef56ab78cd90ef",
    "nextSignKey": "7QmLp2Xs8HdNa4VrTc9YwKbJf",
    "realtime": false,
    "user_email": "api@example.com",
    "user_company": "65ab12cd34ef56ab78cd90a1",
    "title": "Lejeaftale",
    "referenceId": "REF-48392",
    "bin": false,
    "type": "Simple sign",
    "folder": "Default",
    "folderId": "65ab12cd34ef56ab78cd90a2",
    "signingSchemas": [
      "urn:grn:authn:dk:mitid:substantial",
      "urn:grn:authn:dk:mitid:low",
      "urn:grn:authn:dk:mitid:business",
      "urn:grn:authn:se:bankid",
      "draw-cpr",
      "draw"
    ],
    "settings": {
      "deletion": {
        "autoDelete": false,
        "days": 30
      },
      "availability": {
        "unlimited": false,
        "days": 10,
        "expiration": "2026-05-11T08:54:36.371Z",
        "isExpired": false
      },
      "reminders": {
        "send": true,
        "amount": 2,
        "daysBetween": 3
      },
      "template": 2,
      "lang": "da",
      "allowedRoles": [],
      "allowAPI": false,
      "allowRecipientsViewOthers": true
    },
    "recipients": [
      {
        "group": 0,
        "name": "Mia Sørensen",
        "needsCpr": false,
        "redirectUrl": "https://example.com/complete",
        "position": "Director",
        "onBehalfOf": "",
        "cpr": "U2FsdGVkX18nR4mQ2Lp6YvZ8nT1aKs5JwP3eHx9LmNo=",
        "email": "mia.soerensen@example.com",
        "phone": "28123456",
        "sort": 0,
        "template": "",
        "type": "email",
        "signing": true,
        "signed": "pending",
        "signingToken": "Qp7Lm2Va9XrTc4Hs8KdNy5WbE",
        "signingSchema": "",
        "smsEmailVerification": {
          "attempts": 0
        },
        "signer": {
          "signer_type": "recipient",
          "identity": {
            "confirmed": false,
            "cprIsMatch": false
          }
        },
        "message": {
          "enable": true,
          "content": "Insert Custom message per Recipient here."
        },
        "uid": "pL8xRt2Q",
        "_id": "65ab12cd34ef56ab78cd90b1",
        "emailSent": [],
        "log": [],
        "emailEvents": [],
        "events": [],
        "url": "https://www.nextsign.dk/sign/65ab12cd34ef56ab78cd90b0/2/Qp7Lm2Va9XrTc4Hs8KdNy5WbE"
      }
    ],
    "integrations": {
      "microsoft": {
        "status": false
      },
      "uniconta": {
        "status": false
      }
    },
    "errorEmailSent": false,
    "reminders": {
      "allSigned": false,
      "createdAt": "2026-05-01T08:54:36.578Z"
    },
    "documents": [
      {
        "name": "Lejekontrakt.pdf",
        "file": "https://nextsign.hel1.your-objectstorage.com/65ab12cd34ef56ab78cd90a1/case/1777625676406-Lejekontrakt.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=R4ND0MCR3D3NT14LKEY1%2F20260501%2Fhel1%2Fs3%2Faws4_request&X-Amz-Date=20260501T085437Z&X-Amz-Expires=3600&X-Amz-Signature=9f1c2d3a4b5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
        "document_id": "https://nextsign.hel1.your-objectstorage.com/65ab12cd34ef56ab78cd90a1/case/1777625676406-Lejekontrakt.pdf",
        "signObligated": true,
        "documentMustBeRead": true,
        "signatories": [],
        "_id": "65ab12cd34ef56ab78cd90b2"
      }
    ],
    "roles": [
      "admin",
      "økonomi",
      "salg",
      "marketing",
      "standard",
      "it",
      "support",
      "hr"
    ],
    "message": "Kære {recipient_name}, som aftalt er hermed dokumenter til underskrift",
    "customMessage": true,
    "autoSend": true,
    "reminderAutoSend": true,
    "attachFiles": true,
    "source": {
      "type": "api"
    },
    "state": "open",
    "_id": "65ab12cd34ef56ab78cd90b0",
    "tags": [],
    "errors": [],
    "otherDocuments": [],
    "signedDocuments": [],
    "logs": [],
    "createdAt": "2026-05-01T08:54:36.581Z",
    "updatedAt": "2026-05-01T08:54:36.581Z",
    "__v": 0,
    "id": "65ab12cd34ef56ab78cd90b0"
  },
  "notices": [
    {
      "message": "No user id provided, adding the email.",
      "using": "65ab12cd34ef56ab78cd90ef"
    },
    {
      "message": "No user name provided"
    },
    {
      "message": "No roles provided - default roles used",
      "using": [
        "admin",
        "økonomi",
        "salg",
        "marketing",
        "standard",
        "it",
        "support",
        "hr"
      ]
    },
    {
      "message": "No email template provided - using default"
    }
  ]
}

Response Fields

FieldTypeDescription
dataobjectCreated case object
noticesarrayNon-fatal notices returned during processing

e-Boks Delivery Failures

An open case with autoSend on is sent before the response is returned, so an e-Boks recipient that e-Boks rejects (a CPR not registered for Digital Post, an address that cannot be resolved) is reported in notices. The status is still 200: the case exists, so do not retry the request.

{
  "code": "eboks-delivery-failed",
  "message": "e-Boks delivery to Example ApS failed: eboks-not-subscribed (e-Boks 6003: The end user is not subscribed to the content type)",
  "recipientId": "65ab12cd34ef56ab78cd90b1",
  "error": "eboks-not-subscribed",
  "eboksError": {
    "code": 6003,
    "text": "The end user is not subscribed to the content type",
    "identifier": "2026-10-20-15.48.29.604795",
    "httpStatus": 400
  }
}

There is one notice per failed recipient. error is a stable code you can branch on, and eboksError (present when e-Boks itself rejected the message) is e-Boks' own code, text and reference. The values are listed in e-Boks errors. The same failure also fires the case.delivery.failed webhook.

If the invitation email could not be sent, the case is still created and the response is still 200, with this notice:

{ "code": "email-delivery-failed", "message": "The invitation email could not be sent" }

An e-Boks recipient is reached through e-Boks only: an email or phone on it is not used for an invitation.

Template Not Found

An unknown template id, for example a deleted template or a mistyped id, is ignored, and the case is still created with status 200. The case falls back to the default copy, and a recipient's template falls back to the case template. Each ignored id gets a notice that names the field:

{
  "code": "message-template-not-found",
  "field": "recipients[1].template",
  "message": "recipients[1].template was not found for this company and was ignored"
}

The v3 API rejects the request instead, with the message-template-not-found error.

A Template for This Case Only

Instead of the id of a saved template, you can write the template into the request as messageTemplate: on the case for the e-mail, on a recipient for that recipient's SMS or e-Boks message. It takes the same fields as creating a template: type and the email, sms or eboks block. Then you don't need to keep a template on your account for a one-off wording.

{
  "title": "Lejekontrakt Vestergade 4",
  "messageTemplate": {
    "type": "email",
    "email": { "subject": "Underskriv {case_name}", "body": "Kære {recipient_name}\n\nHer er lejekontrakten til underskrift." }
  },
  "recipients": [
    { "name": "Henrik Børgesen", "email": "henrik@example.com", "signing": true },
    {
      "name": "Mia Sørensen",
      "type": "sms",
      "phone": "+4512345678",
      "signing": true,
      "messageTemplate": {
        "type": "sms",
        "sms": { "senderName": "LandPlan", "body": "Hej {recipient_name}, underskriv her: {recipient_url}" }
      }
    }
  ]
}

The case's messageTemplate then works exactly as a saved template given as emailtemplate, and a recipient's as their template:

  • It is saved with the case, because reminders and the e-mail when everyone has signed are sent later. It is not one of your templates: it is not in the template list or the dashboard's template pickers, only on the case's own page. It is deleted within a day after the case is deleted, unless another case uses it.
  • Defaults. name defaults to "Kun til denne sag:" followed by the case title, and language to the case's settings.lang. Everything else gets the same starting point as a new template in the dashboard.
  • Starting from a saved template. With copyFrom, it starts as a copy of one of yours, and the fields you give change only the copy.
  • Checked like a saved template. Unlike a template id, a template that cannot be saved refuses the case with 400 and an error that names the field, for example messageTemplate.email.senderEmail. Nothing is created.

Give messageTemplate or emailtemplate on the case, and messageTemplate or template on a recipient, not both.

Common Error Responses

Validation error:

{
  "errors": [
    {
      "message": "Missing recipients"
    }
  ],
  "notices": []
}

An e-Boks recipient without a CPR, CVR or address (see the e-Boks Object) is rejected before the case is created. This covers recipients that get the eboks type from the emailtemplate, and only recipients of type eboks:

{
  "errors": [
    {
      "message": "recipients[0].cpr is required for an e-Boks recipient, unless eboks.cvr or eboks.address is given",
      "recipient": 0,
      "field": "cpr"
    }
  ],
  "notices": []
}

Not enough credits (402). Only a company invoiced by its partner gets this: its credits come from the partner, so a case whose signatures they do not cover is not created. Drafts are not affected.

{
  "error": "insufficient-credits",
  "message": "Not enough credits to cover this case's signatures. The partner that invoices this company has to grant more credits.",
  "errors": [
    {
      "code": "insufficient-credits",
      "message": "Not enough credits to cover this case's signatures. The partner that invoices this company has to grant more credits."
    }
  ],
  "coverage": { "required": 1, "available": 0, "credits": 0, "reserved": 0, "missing": 1 },
  "notices": []
}

Server error:

{
  "errors": [
    {
      "message": "Server error",
      "error": "Internal error details"
    }
  ]
}