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": [],
  "parties": [],
  "externalId": "<string>",
  "expiresAt": "<string>",
  "templateId": "<string>",
  "responsibleUserId": "<string>",
  "documentMeta": {
    "subject": "<string>",
    "message": "<string>",
    "forceReadFullDocument": true,
    "showChatToSigners": true,
    "value": "<string>",
    "redirectUrl": "<string>",
    "redirectEnabled": true
  },
  "documentStyle": {
    "paddingEnabled": true,
    "backgroundColor": "<string>",
    "backgroundOpacity": 0.5,
    "backgroundImageUrl": "<string>",
    "backgroundImageOpacity": 0.5
  },
  "customFields": [
    {
      "customInputId": "<string>",
      "value": "<string>"
    }
  ]
}
'
{
  "documentId": "<string>",
  "signers": [
    {
      "signerId": "<string>",
      "name": "<string>",
      "email": "jsmith@example.com",
      "signingOrder": 123,
      "companyName": "<string>",
      "companyOrgNumber": "<string>",
      "country": "<string>",
      "contactId": "<string>"
    }
  ],
  "parties": [
    {
      "signerId": "<string>",
      "name": "<string>",
      "email": "jsmith@example.com",
      "signingOrder": 123,
      "companyName": "<string>",
      "companyOrgNumber": "<string>",
      "country": "<string>",
      "contactId": "<string>"
    }
  ],
  "externalId": "<string>",
  "expiresAt": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.sajn.se/llms.txt

Use this file to discover all available pages before exploring further.

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

[DEPRECATED — use parties instead, will be removed in API v2] Array of signers to add to the document during creation. If both signers and parties are provided, parties takes precedence.

parties
object[]
required

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

externalId
string | null

Your external reference ID for tracking this document

expiresAt
string | 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

[DEPRECATED — use parties instead, will be removed in API v2] Array of created parties. Same content as parties.

parties
object[]
required

Array of created parties. Use GET /documents/:id/parties/:partyId to retrieve signing URLs.

externalId
string | null

Your external reference ID

expiresAt
string | null

Document expiration date