Create and send a document from your code

The common Document API calls, in the order you need them.

Open this guide in the help center →

When to use this. Your own system needs to send agreements without anyone opening Formbot.

What you’ll need. API credentials, and a template or source file to send.

  1. Authenticate

    Use an OAuth2 bearer token or an API key header, whichever suits your system. If your token can reach more than one account, pass the account identifier so the call acts on the right one.

  2. Find a template, or bring your own file

    List the document templates to find the one to use, or skip templates entirely and create a document by uploading a file directly.

  3. Create the document

    Create from a template when the fields and roles are already laid out and only the recipients change. Create with a file when each document is different. Assign the actual recipients as part of the call.

  4. Get a signing URL if you are embedding

    Request signing URLs when your own application should present the signing experience rather than relying on Formbot's email. Treat each URL as a credential for that recipient.

  5. Poll status, or better, subscribe

    Status tells you where a document has got to. Prefer subscribing to webhooks over polling — you find out when something happens instead of asking repeatedly, and you will not trip rate limits.

  6. Handle the endings

    Design for declined and voided as much as for completed. Voiding through the API is how you cancel something you sent by mistake.

How to know it worked

Your code creates a document, sends it, and learns when it is signed.

Features covered

Continue learning