Skip to main content

Send a PDF

Use this walkthrough when your application already has a PDF to send. To collect values in a reusable agreement instead, follow Create a contract from a template.

Before you begin​

Complete authentication and set KREBIT_API and ACCESS_TOKEN. You also need cURL, jq, a recipient, and a PDF named document.pdf of no more than 10 MB, without password protection or existing signatures.

The examples send a real invitation. Use a recipient address you control when testing.

1. Create a signing draft​

SIGNING_ID=$(curl --fail-with-body --silent --show-error --request POST \
"${KREBIT_API}/signings" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"name":"Service agreement","language":"EN","signing_order":"sequential"}' \
| jq -r '.id')

Save SIGNING_ID in your application. You will use it for the remaining steps and for tracking completion.

2. Upload the PDF​

DOCUMENT_ID=$(curl --fail-with-body --silent --show-error --request POST \
"${KREBIT_API}/signings/${SIGNING_ID}/documents" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header 'Accept: application/json' \
--form selected_file=@document.pdf \
| jq -r '.id')

Save DOCUMENT_ID alongside the signing ID. If validation fails, inspect the response before continuing.

3. Add a recipient​

RECIPIENT_ID=$(curl --fail-with-body --silent --show-error --request POST \
"${KREBIT_API}/signings/${SIGNING_ID}/recipients" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"first_name":"Ada","last_name":"Lovelace","email":"ada@example.com","signing_method":"email"}' \
| jq -r '.id')

For additional recipients, BankID, approvals, or ordering, see the signing lifecycle guide.

4. Send​

curl --fail-with-body --silent --show-error --request POST \
"${KREBIT_API}/signings/${SIGNING_ID}/send" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header 'Accept: application/json'

Sending starts the recipient workflow and ends draft editing. If the API refuses to send, check that the signing is still a draft and contains a document or contract and at least one recipient.

5. Track completion​

Read the signing status:

curl --fail-with-body --silent --show-error \
"${KREBIT_API}/signings/${SIGNING_ID}" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header 'Accept: application/json' \
| jq '{id, name, is_draft, is_completed, cancelled_at}'

Use GET /api/1.0/signings/{signing}/documents for document status. A document's completed_at indicates that its signatures are complete. For automated integrations, register a completion webhook before sending rather than repeatedly polling.

6. Download the signed PDF​

After the document is complete:

curl --fail-with-body \
"${KREBIT_API}/signings/${SIGNING_ID}/documents/${DOCUMENT_ID}/download-signed" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--output signed-agreement.pdf

The endpoint returns 404 while the signed file is unavailable.

Next step​

Follow Webhooks and results to automate completion handling. Use the signing lifecycle guide for reminders, cancellation, and multiple recipients, or the API reference for exact request fields.