NextSign API
Documents

Document Upload

Upload a file using POST /v3/company/{company}/file/upload.

Document Upload

Use this endpoint to upload a file before case creation.

If the combined size of the documents you want to send in a case is more than 3.5 MB, upload the files first and pass the returned URL into documents[].file in Case Create.

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://api.nextsign.dk/v3/company/{company}/file/upload

Path Parameters

ParameterTypeDescription
companystringYour company identifier

Request Formats

This endpoint supports both:

  • multipart/form-data
  • Base64 payloads in the request body

Accepted File Types

  • application/pdf
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document

Multipart Form Data Fields

FieldTypeRequiredDescription
filefileYesFile to upload
namestringNoFile name to store with the upload
typestringNoValid MIME type such as application/pdf

Base64 Body Fields

FieldTypeRequiredDescription
filestringYesBase64 string or full data URL
namestringYesFile name to store with the upload
typestringConditionallyMIME type. Optional when file is a full data URL like data:application/pdf;base64,...

For base64 uploads, send either a full data URL such as data:application/pdf;base64,... or a raw base64 string plus an explicit type.

Example Request

cURL
curl --location 'https://api.nextsign.dk/v3/company/{company}/file/upload' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'file=@"/path/to/Hi.pdf"' \
  -F 'name=Hi.pdf' \
  -F 'type=application/pdf'

Example Request With Base64

JSON Body
{
  "file": "data:application/pdf;base64,JVBERi0xLjQKJcfs...",
  "name": "Hi.pdf"
}
cURL - Base64
curl --location 'https://api.nextsign.dk/v3/company/{company}/file/upload' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{
    "file": "data:application/pdf;base64,JVBERi0xLjQKJcfs...",
    "name": "Hi.pdf"
  }'

Example Response

200 OK
{
  "url": "https://nextsign-dev.hel1.your-objectstorage.com/686557955db9ec08e6a94c39/1774622990607-Hi.pdf",
  "type": "application/pdf"
}

Response Fields

FieldTypeDescription
urlstringUploaded file URL to use in later API requests
typestringMIME type stored for the uploaded file

Use In Case Create

Pass the returned url into the documents[].file field:

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

Common Error Responses

Missing file:

{
  "error": "missing-file"
}

Missing file name:

{
  "error": "missing-file-name"
}

Missing file type:

{
  "error": "missing-file-type"
}

Invalid file type:

{
  "error": "invalid-file-type"
}