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>",
  "signers": [],
  "externalId": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z",
  "type": "SIGNABLE",
  "templateId": "<string>",
  "responsibleUserId": "<string>",
  "documentMeta": {
    "subject": "<string>",
    "message": "<string>",
    "signingOrder": "PARALLEL",
    "forceReadFullDocument": true,
    "showChatToSigners": true,
    "preferredLanguage": "sv",
    "value": "<string>",
    "redirectUrl": "<string>",
    "redirectEnabled": true
  },
  "documentStyle": {
    "orientation": "PORTRAIT",
    "paddingEnabled": true,
    "backgroundColor": "<string>",
    "backgroundOpacity": 0.5,
    "backgroundImageUrl": "<string>",
    "backgroundImageSize": "FILL",
    "backgroundImagePosition": "TOP_LEFT",
    "backgroundImageRepeat": "REPEAT",
    "backgroundImageOpacity": 0.5,
    "pageSize": "A4"
  },
  "customFields": [
    {
      "customInputId": "<string>",
      "value": "<string>"
    }
  ]
}
'
{
  "documentId": "<string>",
  "signers": [
    {
      "signerId": "<string>",
      "name": "<string>",
      "role": "SIGNER",
      "type": "INDIVIDUAL",
      "email": "jsmith@example.com",
      "signingOrder": 123,
      "companyName": "<string>",
      "companyOrgNumber": "<string>",
      "contactId": "<string>"
    }
  ],
  "externalId": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Headers

authorization
string
required

Bearer token for API authentication

Body

application/json

Body

name
string
required

Document name/title

Minimum string length: 1
signers
object[]
required

Array of signers to add to the document during creation. Provide either contactId to reference existing contacts, or name and email to manually specify signer details.

externalId
string | null

Your external reference ID for tracking this document

expiresAt
string<date-time> | null

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 and template parties are copied by default.

responsibleUserId
string

User ID of the person responsible for this document. Must be a member of your organization. Defaults to the creating user.

documentMeta
object

Document metadata including subject, message, signing order, etc.

documentStyle
object

Document styling configuration including orientation, padding, background, and layout

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. Use GET /documents/:id/signers/:signerId to retrieve signing URLs.

externalId
string | null

Your external reference ID

expiresAt
string<date-time> | null

Document expiration date