Create the JWT token
Generate a one-time HS256-signed JWT containing your tenantId and your private API key.
The doclinc API lets you create secure document transfer transactions, upload files to signed URLs, and trigger an email notification with recipient-side 2FA authentication.
Functional scope of the API within a confidential document sending workflow.
linkExpirationDays.Every confidential document sent follows this process, from the authorization token creation through to confirmation.
Generate a one-time HS256-signed JWT containing your tenantId and your private API key.
Submit the recipient's information and the document name. The API returns a secure upload URL and an HTML banner (if in self-send mode).
Upload the file to the secure channel via the temporary URL provided (valid for urlTimeToLive seconds).
Confirm the transaction, then embed the HTML banner in your email and send it through your own mail server (if in self-send mode).
Credentials to obtain from doclinc and information required for each recipient.
tenantIdapiKeyCA for Canada)sms or voiceTwo options are available depending on your context:
/transactions/cells/transactions/secrets (e.g. employee number)Nominal API call sequence for sending a confidential document to a recipient with SMS authentication.
Build an HS256 JWT from your tenantId and a unique identifier (jti),
encode it in Base64, and sign it with your doclinc API key. This token is valid for at most 2 hours
and must be recreated for each transaction.
// JWT header
{
"alg": "HS256",
"typ": "JWT"
}
// JWT body (payload)
{
"tenantId": "BA686425FBF403B23F3FC4ABE5A98A",
"jti": "pay-1773793968", // prefix + Unix timestamp
"iat": 1773793968, // issued at (GMT)
"exp": 1773801168 // expiry โค iat + 7200 s
}
// API key (fictional example)
F1F5BCBE71F46FC5E704E53469F5A77A55646F293E6568EA5F978FA6A4629450
// Resulting signed token (Base64)
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRJ
ZCCI6IkJBNjg2NDI1RkJGNDAzQjIzRjNGQzRBQkU1QTk4QSIs
Imp0aSI6InBheS0xNzczNzkzOTY4IiwiaWF0IjoxNzczNzkzOT
Y4LCJleHAiOjE3NzM4MDExNjh9.63NKWGi7Zt1Xn9kfkeh9ku
02CxZ0w1fUFq3BgPhz5jM
jti field must be unique on every call. Use a fixed prefix followed by the Unix timestamp (e.g. "pay-" + Date.now()).exp) cannot exceed 1 hour after iat.iat) should be the real network time with a maximum skew of +/- 10 minutes.Submit the recipient's information (email, phone number) and the document name. The API returns a secure upload URL unique per document, an HTML banner to embed in your email, as well as the confirm and cancel commands.
// Header โ use the token generated in step 1
Authorization: Bearer eyJhbGciOiJIUzI1Ni...
// Request body
{
"transactionType": "send",
"transactionLanguageRef": "FR", // sender-side language
"subjectLanguageRef": "FR", // recipient-side language
"linkExpirationDays": 14, // link validity (days)
"isLinkReusable": true,
"isEventNotificationEnabled": false,
"contacts": [ // multiple contacts supported when authenticationMethod is sms/voice
{
"recipientEmail": "recipient@example.com",
"recipientIsoCountryCode": "CA",
"recipientCell": "8191234567",
"authenticationMethod": "sms"
}
],
"documents": [ // multiple documents supported
{
"name": "pay-stub-2026-01-01.pdf"
}
]
}
// API response
{
"sendTransaction": {
"documents": [
{ // unique URL per document
"url": "https://uploadDomain/...",
"urlTimeToLive": 3600
}
]
},
// HTML banner to add to the email
"banner": "<HTML>...</HTML>",
"commands": [
{
"href": "/transactions/cell/6c89a4fd23ae1224d0b754a551bf755a6c35",
"method": "POST",
"rel": "Confirm" // confirm with this endpoint
},
{
"href": "/transactions/cell/6c89a4fd23ae1224d0b754a551bf755a6c35",
"method": "Delete",
"rel": "Cancel"
}
]
}
authenticationMethod is SMS or Voice.isEventNotificationEnabled to false to avoid receiving event notifications for retrievals and expirations.Upload the documents using the URLs received in step 2, via your language's native HTTP library. Use one URL per document, in the same order as specified in the transaction request.
// cURL example
curl -X PUT \
"https://beta-prod-documenttransfer.s3.ca-central-1.amazonaws.com/..." \
--upload-file "./confidential-document.pdf"
The upload link is valid for the period defined by urlTimeToLive (3,600 seconds in this example). Using the link after this period will result in an error. Perform the upload immediately after creating the transaction.
Your subscription enforces a limit on the total document size per transaction. This limit applies to the sum of all uploaded files and is checked at confirmation time (step 4).
Once the document has been uploaded, confirm the transaction using the dynamic href
from the Confirm command received in step 2. Confirmation returns 200 OK.
Then embed the HTML banner in your email body and send it
through your own mail infrastructure.
// cURL example โ use the dynamic href received in step 2
curl -X POST \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
"https://api.doclinc.io/transactions/cell/6c89a4fd23ae1224d0b754a551bf755a6c35"
The API automatically saves recipient contact details with each transaction. You can look up this information before creating a new transaction.
GET /transactions/contacts/{email}
This endpoint returns the preferred language, mobile authentication method,
and stored secret information for a given recipient.
These values can be used directly when creating the next transaction,
notably the secretAnswerRef field to reuse an existing secret.
If the contact is not found, the endpoint returns 404.
// Example
GET /transactions/contacts/recipient@example.com
// Sample response
{
"languageRef": "EN",
"cellContact": {
"cellIsoCountryCode": "CA",
"cell": "8191234567",
"authenticationMethod": "sms"
},
"secretContact": { // may be empty
"secretQuestion": "Employee number ?",
"secretAnswerRef": "5a7574b08771edfc1ba8c87493dfd01a45424c57"
// Encrypted reusable answer if it exists
}
}
An alternative to phone-based authentication: the recipient answers a secret question to access the document.
secretAnswer โ new secretUsed to set a new password for the transaction. The value is transmitted in plain text in the request and stored encrypted by the API.
secretAnswerRef โ pre-registered secretUsed to reuse an existing secret. The value is obtained via GET /transactions/contacts/{email} โ it is the already-stored encrypted value.
{
"transactionType": "send",
"transactionLanguageRef": "EN",
"subjectLanguageRef": "EN",
"linkExpirationDays": 14,
"isLinkReusable": true,
"secretQuestion": "What is your employee number?",
"isEventNotificationEnabled": false,
"contacts": [
{
"recipientEmail": "recipient@example.com",
"secretAnswer": "EMP-00142", // new secret โ OR null if secretAnswerRef provided
"secretAnswerRef": null // encrypted ref obtained via GET /contacts
}
],
"documents": [
{ "name": "pay-stub-2026-01-01.pdf" }
]
}
secretAnswer or secretAnswerRef is provided โ never both simultaneously.
The rest of the flow (upload + confirmation) is identical to the happy path.
This method is temporarily limited to one recipient per transaction.
All available endpoints with their response codes.
Returns pre-registered authentication information for a contact. The API automatically saves recipient contact details with each transaction created โ this endpoint allows you to look them up before creating a new transaction.
// Example
GET /transactions/contacts/recipient@example.com
// Sample response
{
"languageRef": "FR",
"cellContact": {
"cellIsoCountryCode": "CA",
"cell": "8191234567",
"authenticationMethod": "sms"
},
"secretContact": { // may be empty
"secretQuestion": "Employee number ?",
"secretAnswerRef": "5a7574b08771edfc1ba8c87493dfd01a45424c57"
// Encrypted reusable answer if it exists
}
}
| Code | Status | Description |
|---|---|---|
| 200 | SUCCESS | OK |
| 401 | UNAUTHORIZED | Invalid authorization |
| 404 | NOT FOUND | Contact not found |
| 461 | INVALID SUB | Invalid subscription |
| 500 | SERVER ERROR | Unexpected error |
Initializes a secure transaction with SMS or voice call authentication. Returns upload URLs for each document and the transaction identifier.
// Request body
{
"transactionType": "send",
"transactionLanguageRef": "EN", // sender interface language
"subjectLanguageRef": "EN", // recipient interface language
"linkExpirationDays": 14, // link validity (days)
"isLinkReusable": true,
"isEventNotificationEnabled": false,
"contacts": [
{
"recipientEmail": "recipient@example.com",
"recipientIsoCountryCode": "CA", // ISO country code
"recipientCell": "8191234567", // phone for 2FA
"authenticationMethod": "sms" // "sms" or "voice"
}
],
"documents": [
{ "name": "Confidential-document.pdf" }
]
}
// Response
{
"sendTransaction": {
"documents": [
{
"url": "https://uploadDomain/...",
"urlTimeToLive": 3600 // seconds
}
]
},
"banner": "Html code to insert in email",
"commands": [
{ "href": "/transactions/cell/{id}", "method": "POST", "rel": "Confirm" },
{ "href": "/transactions/cell/{id}", "method": "Delete", "rel": "Cancel" }
]
}
| Code | Status | Description |
|---|---|---|
| 201 | CREATED | OK |
| 400 | BAD REQUEST | Invalid JSON or incorrect country code / phone number |
| 401 | UNAUTHORIZED | Invalid authorization |
| 461 | INVALID SUB | Invalid subscription |
| 463 | DUPLICATE | Duplicate phone number in the list |
| 470 | FEATURE NOT AVAILABLE | Feature not included in your plan |
| 500 | SERVER ERROR | Unexpected error |
Initializes a secure transaction with secret question authentication. Provide either secretAnswer (new secret) or secretAnswerRef (pre-registered secret) โ never both. Limited to one recipient per transaction.
// Request body
{
"transactionType": "send",
"transactionLanguageRef": "EN", // sender interface language
"subjectLanguageRef": "EN", // recipient interface language
"linkExpirationDays": 14,
"isLinkReusable": true,
"secretQuestion": "What is your employee number?",
"isEventNotificationEnabled": false,
"contacts": [
{
"recipientEmail": "recipient@example.com",
"secretAnswer": "EMP-00142", // new secret
"secretAnswerRef": null // OR encrypted ref via GET /contacts
}
],
"documents": [
{ "name": "confidential-document.pdf" }
]
}
// Response โ same structure as /transactions/cells
{
"sendTransaction": {
"documents": [
{
"url": "https://uploadDomain/...",
"urlTimeToLive": 3600
}
]
},
"banner": "Html code to insert in email",
"commands": [
{ "href": "/transactions/cell/{id}", "method": "POST", "rel": "Confirm" },
{ "href": "/transactions/cell/{id}", "method": "Delete", "rel": "Cancel" }
]
}
| Code | Status | Description |
|---|---|---|
| 201 | CREATED | OK |
| 400 | BAD REQUEST | Invalid request body |
| 401 | UNAUTHORIZED | Invalid authorization |
| 461 | INVALID SUB | Invalid subscription |
| 470 | FEATURE NOT AVAILABLE | Feature not included in your plan |
| 500 | SERVER ERROR | Unexpected error |
| Code | Status | Description |
|---|---|---|
| 200 | SUCCESS | Transaction confirmed |
| 401 | UNAUTHORIZED | Invalid authorization |
| 404 | NOT FOUND | Transaction or document not found |
| 465 | DOCUMENT SIZE EXCEEDED | Total document size exceeded |
| 500 | SERVER ERROR | Unexpected error |
Cancels the transaction. Note that it is permitted to cancel a transaction even after confirmation.
| Code | Status | Description |
|---|---|---|
| 204 | DELETED | Transaction successfully cancelled |
| 401 | UNAUTHORIZED | Invalid authorization |
| 404 | NOT FOUND | Transaction not found |
| 500 | SERVER ERROR | Unexpected error |
This website uses cookies to enhance your browsing experience and provide personalized content. Privacy Policy
By clicking 'Accept', you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.