Skip to main content
In this guide, you choose how each party signs a document and whether they verify their identity first. You list the methods your account can offer, set them per party, and add a verification step for the parties who need one. Each party has two settings:
  • requiredSignature: how the party signs, such as with a drawn signature or with BankID.
  • twoStepVerification: an optional check the party passes before signing, such as an SMS code.
The document also has documentMeta.accessVerification, a check that every party passes before the document opens. For what each method proves legally, see Signing methods.

Before you begin

  • Store your API key in the SAJN_API_KEY environment variable. To create a key, go to workspace settings in the sajn app, then Utvecklare (Developer) > API-nycklar (API keys).
  • Have a DRAFT document with parties. For more information, see Create a document.

Signing methods

The following values are available for requiredSignature: DRAWING and CLICK_TO_SIGN prove that the party intended to sign. The eID methods also prove who signed. With an eID, an optional nationalId on the party is matched against the eID; without one, sajn matches the name. The API accepts the Norwegian BankID values in the schema, such as NO_BANKID_BIOMETRIC, but rejects them with the message This eID scheme is not yet available until the scheme is switched on. NONE and MANUAL are derived values: a party gets NONE when its role doesn’t sign, and MANUAL marks a document imported after paper signing. If you leave out requiredSignature, the party gets the workspace’s default signing method. Without a workspace default, the party gets the national eID of your organization’s country, or DRAWING when the country has none.

Set the methods on a document

1

List the methods you can offer

Build your picker from the API instead of a hard-coded list, because eID schemes are switched on market by market:
The response lists the eID methods first, then the generic ones:
The list shows which methods sajn offers, not which your plan includes. For the plan rule, see Plan availability.
2

Set a method per party

Parties on the same document can use different methods. Set requiredSignature when you add the party, or update it on a draft:
Replace TEMPLATE_ID with the ID of a template. country is the party’s ISO 3166-1 alpha-2 country code. To change the method later, send a PATCH request to /api/v1/documents/DOCUMENT_ID/parties/PARTY_ID with requiredSignature.
3

Optional: Add a verification step

To make a party verify before signing, set twoStepVerification. The following update asks Kai for a one-time SMS code. An SMS code needs a phone number on the party:
To make every party verify before the document even opens, set documentMeta.accessVerification on the document instead:
For the values, see the following section.

Verification steps

Both twoStepVerification and accessVerification take the following values. To list them with labels, call List selectable verification gates. Use twoStepVerification to protect the signature of one party, and accessVerification to protect the content of the whole document. A party who signs with an eID is already identified, so an eID verification step on top of an eID signature is a second, separately billed eID transaction.

eID schemes by country

Plan availability

Which eID schemes an organization can use depends on its plan:
  • On paid plans from Solo upward, every scheme in the preceding table is available.
  • On the free plan, only the national eID with included signatures is available, such as SE_BANKID for a Swedish organization.
  • In a sandbox organization, every scheme is available.
sajn checks the plan when you send the document. To see the included signatures and what you’ve used, call Get plan limits and usage.

Read how a party was verified

After signing, each party has identityVerified, which is true when an eID verified the party through the signature or a verification step. identityMismatch is true when the eID identity didn’t match the intended party and the signature was still recorded. For the verified identities, call Get verified signer identities.

Handle errors

  • 400 VALIDATION_FAILED with the message This eID scheme is not yet available: the scheme isn’t switched on. Pick a method from /helpers/signature-methods.
  • 403 PERMISSION_DENIED on send: a party’s signing method or verification step isn’t included in your plan. The userMessage names the method.
For the error shape and every code, see Errors.

Next steps

Signing methods

Learn what each method proves.

Verify identity with sajn ID

Verify a person without a document.

Send for signing

Send the document to its parties.