Skip to main content
POST
/
api
/
v1
/
documents
Create a new document
curl --request POST \
  --url https://app.sajn.se/api/v1/documents \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "name": "<string>",
  "externalId": "<string>",
  "expiresAt": "<any>",
  "type": "SIGNABLE",
  "templateId": "<string>",
  "signers": [],
  "customFields": [
    {
      "customInputId": "<string>",
      "value": "<string>"
    }
  ]
}'
{
  "documentId": "<string>",
  "externalId": "<string>",
  "expiresAt": "<any>",
  "signers": [
    {
      "signerId": "<string>",
      "name": "<string>",
      "email": "jsmith@example.com",
      "token": "<string>",
      "role": "SIGNER",
      "signingOrder": 123,
      "signingUrl": "<string>"
    }
  ]
}

Headers

authorization
string
required

Bearer token for API authentication

Body

application/json

Body

name
string
required

Document name/title

Minimum length: 1
signers
object[]
required

Array of signers to add to the document during creation

externalId
string | null

Your external reference ID for tracking this document

expiresAt
any

Expiration date for the document

type
enum<string>

Document type: SIGNABLE (default), ACCEPTABLE, or ARCHIVE_IMPORTED

Available options:
SIGNABLE,
ACCEPTABLE,
ARCHIVE_IMPORTED
templateId
string | null

Template ID to create document from. Template fields will be copied to the document.

customFields
object[]

Custom field values for the document

Response

200

documentId
string
required

Unique identifier for the created document

signers
object[]
required

Array of created signers with their signing URLs and tokens

externalId
string | null

Your external reference ID

expiresAt
any

Document expiration date

I