Documentation

API quick start

The API creates contracts from your own application and reports their progress back. Here is the shortest path; the full reference covers everything else.

Create a key

Create an API key in your settings. It starts with canu_ and goes into the header of every request. The limit is 60 requests per minute.

Authorization: Bearer canu_your_key

Create a contract

Send your PDF as base64 (up to 3 MB) and place the fields in percent of the page, measured from the top left. A person with an e-mail address in signers gets their personal link.

PDF_B64=$(base64 < order.pdf | tr -d '\n')
curl -X POST https://canusign.com/api/v1/contracts \
  -H "Authorization: Bearer canu_your_key" \
  -H "Content-Type: application/json" \
  -d "{
    \"title\": \"Order 4711\",
    \"language\": \"en\",
    \"document\": { \"name\": \"order.pdf\", \"pdf\": \"$PDF_B64\" },
    \"signatureFields\": [
      { \"label\": \"Client\", \"page\": 1, \"x\": 10, \"y\": 80 },
      { \"label\": \"Contractor\", \"page\": 1, \"x\": 60, \"y\": 80 }
    ],
    \"signers\": [{ \"label\": \"Client\", \"email\": \"client@example.com\" }],
    \"finalize\": true
  }"

Read the response

The response contains id, signUrl for the shared link, publicId and verifyUrl for the verification page. Without credit and without Pro, the contract waits for payment: requiresPayment is then true and signUrl is empty.

Wait for the signatures

Subscribe a webhook to contract.completed, or poll GET /api/v1/contracts/{id}.

curl -X POST https://canusign.com/api/v1/webhooks \
  -H "Authorization: Bearer canu_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://your-app.example/hooks/canusign", "events": ["contract.completed"] }'

Download the PDF

Until everyone has signed, the endpoint answers 409.

curl -o signed.pdf https://canusign.com/api/v1/contracts/{id}/pdf \
  -H "Authorization: Bearer canu_your_key"