E-signature API guide: add e-signing to your app

Updated

An e-signature API lets your software send documents for signature without anyone opening an e-signature app. The usual flow is: upload a PDF and say who signs it, place signature fields (by coordinates or by anchor text in the document), send it by email or embed the signing screen in your own app, then receive a webhook when it's signed and download the sealed PDF. agrmnt's REST API does each of these in one request, and it's included on the Business plan with no per-envelope fees.

Key concepts

  • Envelope: a package of one or more documents, its recipients and their fields.
  • Recipient: someone who signs, approves, views or gets a copy, with a signing order.
  • Field: where a recipient signs, initials, dates or fills in information.
  • Anchor text: a tag in the document, such as {{signature}}, used to position a field without coordinates.
  • Template: a reusable envelope with fields and roles already set.
  • Webhook: an HTTP request your server receives when something happens, such as envelope.completed.
  • Embedded signing: the signing screen shown inside your own app instead of sent by email.

Send a document in one request

This creates an envelope from a PDF, places a signature field on the {{signature}} anchor and sends it:

curl https://agrmnt.io/api/v1/envelopes \
  -H "Authorization: Bearer $AGRMNT_API_KEY" \
  -F file=@agreement.pdf \
  -F 'payload={
    "title": "Services Agreement",
    "recipients": [{ "name": "Dana Rivera", "email": "dana@example.com" }],
    "fields": [{ "recipient": 0, "type": "signature", "anchor": { "text": "{{signature}}" } }],
    "send": true
  }'

The full reference, with an OpenAPI spec, is in the API documentation.

Webhooks

Rather than polling, subscribe to events: envelope.sent, recipient.viewed, recipient.completed, recipient.declined, recipient.email_bounced, envelope.completed, envelope.declined, envelope.voided, envelope.expired, plus the photo ID events recipient.id_check_started, recipient.id_verified, recipient.id_check_failed and recipient.id_check_abandoned. Each request is signed with an HMAC-SHA256 signature in the agrmnt-signature header (with a timestamp to prevent replays), and failed deliveries are retried.

Embedded signing

To keep users in your product, request a signing URL for a recipient and open it in your app. Embedding is limited to the website origins your team allows. The signer still verifies and consents as usual, so the audit trail is the same as an emailed signature.

What to look for in an e-signature API

  • Pricing that scales: per-envelope API fees add up fast. Look for flat plans and a clear fair-use policy.
  • Anchor-text placement, so you don't calculate coordinates for every document.
  • Signed webhooks with retries.
  • Embedded signing with origin restrictions.
  • A sealed, timestamped PDF and certificate you can download through the API.
  • Identity options such as photo ID checks, for risky agreements.

Frequently asked questions

How much does an e-signature API cost?

Many providers charge per envelope or sell API access as a separate plan. agrmnt includes the API, webhooks, embedded signing and public signing links in the Business plan, $29 per user a month, with no per-envelope fees under normal business use.

Can I send documents as my customer's company?

Yes. Teams can use their own logo and colors on emails and the signing page, and name a sender of record, so signers see who the agreement is really from.

Is there an OpenAPI spec?

Yes. The machine-readable OpenAPI 3.1 spec is at /api/v1/openapi.json, so you can import it into Postman, Insomnia or a code generator.

Can I use templates through the API?

Yes. Create templates in the app or via the API, then create envelopes from them by filling in each role's name and email.

Send your first document today.