Skip to content

Docs

Look up a callbefore you send.

Search for a call, or open a page below.

Send the first envelope

One POST creates the envelope and names the signer.

An envelope is the PDF plus the people who sign it. You create it with a single POST.

The quickstart on the home page splits that work into three calls you can copy: create, read the id, then take the signed file.

JavaScript
const res = await fetch("https://api.example.com/v1/envelopes", {  method: "POST",  headers: {    Authorization: `Bearer ${process.env.FORGELINE_KEY}`,    "Content-Type": "application/json",  },  body: JSON.stringify({    file: "service-agreement.pdf",    signers: ["you@example.com"],  }),});

What an envelope holds

A file name, the signer emails, and a status.

You send the file name and a list of signer emails. Forgeline stores that pair as one envelope and returns an id.

The status moves from sent, to signed for each person, to completed when the signed file is ready.

Response
{  "id": "env_1842",  "status": "completed",  "file": "service-agreement.pdf",  "signers": [    {      "email": "you@example.com",      "status": "signed"    }  ]}

Name each signer

A signer is an email address on the envelope.

Put each signer email in the signers list on the create call. Forgeline sends the file to those addresses.

You can read each person's status back on the envelope: sent, signed, or declined.

The PDF you send and the one you get back

You name the PDF on the way out. The completed event names it on the way back.

The create call carries the file name, such as service-agreement.pdf. Forgeline sends that file to the signers.

When every signer has signed, fetch the signed PDF or read the file name from envelope.completed.

cURL
curl -L https://api.example.com/v1/envelopes/env_1842/file \  -H "Authorization: Bearer $FORGELINE_KEY" \  -o service-agreement-signed.pdf

Events Forgeline posts to you

Five events follow an envelope from send to signed file.

Forgeline posts JSON to a URL you host. Check the Forgeline-Signature header before you trust the body.

The events are envelope.sent, envelope.viewed, envelope.signed, envelope.completed, and envelope.declined.

When a call does not go through

Four status codes cover a bad body, a bad key, a missing id, and a burst of calls.

400 means the file name or a signer email is missing. 401 means the API key was missing or not accepted.

404 means no envelope with that id is on this key. 429 means too many calls at once: wait, then send the call again.

Clients for the languages you ship

JavaScript, Python, Go, Ruby, PHP, Java, and C# send the same envelope.

Each client wraps the create call. The package names on this site use the example scope, so you can read the shape before you point them at your own registry.

The home page keeps a sideways row of the seven clients, with the call and the install line in each tile.

JavaScript
// npm install @example/forgelineimport { Forgeline } from "@example/forgeline"; const client = new Forgeline(process.env.FORGELINE_KEY);const envelope = await client.envelopes.create({  file: "service-agreement.pdf",  signers: ["you@example.com"],});