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
settingsobjectYesCase settings
signingSchemasarrayNoAllowed signature methods
recipientsarrayYesRecipient list
documentsarrayYesDocuments to sign

Signing Schemas

  • 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
  • sms-email

Recipient Fields

FieldTypeDescription
namestringRecipient name
emailstringRecipient email
signingbooleanWhether the recipient must sign
needsCprbooleanWhether CPR validation is required
signingSchemastringOptional recipient-specific signing method override
redirectUrlstringRedirect URL after signing
addPhonebooleanSend SMS in addition to email
phonestringPhone number for SMS delivery
ordernumberSigning order
positionstringSignature title/position
messagestringCustom recipient message

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.

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

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.

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@nextengine.dk",
    "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:substantial",
      "urn:grn:authn:dk:mitid:business",
      "draw"
    ],
    "recipients": [
      {
        "name": "Andreas Lauridsen",
        "email": "al@nextengine.dk",
        "signing": true,
        "order": 0,
        "signingSchema": "urn:grn:authn:dk:mitid:business"
      }
    ],
    "documents": [
      {
        "name": "Lejekontrakt.pdf",
        "file": "YOUR_BASE64_STRING_OR_URL",
        "fileIsBlob": true
      }
    ]
  }'

Example Response

200 OK
{
  "data": {
    "_id": "66263484e601d81006d1a132",
    "title": "Lejeaftale",
    "folder": "Default",
    "type": "Simple sign",
    "createdAt": "2024-04-22T09:57:24.498Z",
    "updatedAt": "2024-04-22T09:57:24.498Z"
  },
  "notices": []
}

Response Fields

FieldTypeDescription
dataobjectCreated case object
noticesarrayNon-fatal notices returned during processing

Common Error Responses

Validation error:

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

Server error:

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