Skip to content

Developers

Send for signature from your code, or your AI.

A REST API with signed webhooks for your app, and an MCP server for Claude, ChatGPT and other assistants. Both run the same signing flow, audit trail and sealed PDF as the app.

MCP on every plan; REST API on Pro. Base URL https://rapidagree.com/api/v1

# 1. Check the key
curl https://rapidagree.com/api/v1/me \
  -H "Authorization: Bearer $RAPIDAGREE_API_KEY"

# 2. Upload a PDF, place two fields and send it, in one call
curl https://rapidagree.com/api/v1/envelopes \
  -H "Authorization: Bearer $RAPIDAGREE_API_KEY" \
  -H "Idempotency-Key: order-1042" \
  -F file=@agreement.pdf \
  -F 'data={
    "title": "Service agreement",
    "signers": [{ "ref": "client", "name": "Casey Client", "email": "casey@example.com" }],
    "fields": [
      { "signer": "client", "type": "signature", "page": 1, "x": 0.1, "y": 0.8, "width": 0.3, "height": 0.05 },
      { "signer": "client", "type": "date", "page": 1, "x": 0.5, "y": 0.8, "width": 0.2, "height": 0.03 }
    ],
    "send": { "expiresInDays": 14, "permittedUseConfirmed": true }
  }'

# 3. Follow it, then download the sealed PDF once completed
curl https://rapidagree.com/api/v1/envelopes/ENVELOPE_ID -H "Authorization: Bearer $RAPIDAGREE_API_KEY"
curl -o signed.pdf https://rapidagree.com/api/v1/envelopes/ENVELOPE_ID/files/signed \
  -H "Authorization: Bearer $RAPIDAGREE_API_KEY"
import { readFile } from "node:fs/promises";

const api = "https://rapidagree.com/api/v1";
const headers = { Authorization: `Bearer ${process.env.RAPIDAGREE_API_KEY}` };

const form = new FormData();
form.append("file", new Blob([await readFile("agreement.pdf")], { type: "application/pdf" }), "agreement.pdf");
form.append("data", JSON.stringify({
  title: "Service agreement",
  signers: [{ ref: "client", name: "Casey Client", email: "casey@example.com" }],
  fields: [
    { signer: "client", type: "signature", page: 1, x: 0.1, y: 0.8, width: 0.3, height: 0.05 },
    { signer: "client", type: "date", page: 1, x: 0.5, y: 0.8, width: 0.2, height: 0.03 },
  ],
  send: { expiresInDays: 14, permittedUseConfirmed: true },
}));

const response = await fetch(`${api}/envelopes`, {
  method: "POST",
  headers: { ...headers, "Idempotency-Key": "order-1042" },
  body: form,
});
const envelope = await response.json();

console.log(envelope.id, envelope.status); // "sent"
import json, os, requests

api = "https://rapidagree.com/api/v1"
headers = {"Authorization": f"Bearer {os.environ['RAPIDAGREE_API_KEY']}"}

data = {
    "title": "Service agreement",
    "signers": [{"ref": "client", "name": "Casey Client", "email": "casey@example.com"}],
    "fields": [
        {"signer": "client", "type": "signature", "page": 1, "x": 0.1, "y": 0.8, "width": 0.3, "height": 0.05},
        {"signer": "client", "type": "date", "page": 1, "x": 0.5, "y": 0.8, "width": 0.2, "height": 0.03},
    ],
    "send": {"expiresInDays": 14, "permittedUseConfirmed": True},
}

with open("agreement.pdf", "rb") as pdf:
    response = requests.post(
        f"{api}/envelopes",
        headers={**headers, "Idempotency-Key": "order-1042"},
        files={"file": ("agreement.pdf", pdf, "application/pdf")},
        data={"data": json.dumps(data)},
    )

envelope = response.json()
print(envelope["id"], envelope["status"])  # "sent"

Two ways in, one signing flow.

Pro

REST API

For your own app or backend. API keys, JSON over HTTPS, signed webhooks, embedded signing and idempotent sends. OpenAPI 3.1 description and a Postman collection.

Every plan

MCP server

For AI assistants. Remote Streamable HTTP at rapidagree.com/mcp, OAuth 2.1 sign-in, 28 tools with preview before send. Works in Claude, ChatGPT, Cursor, VS Code and any MCP client.

Claude, ChatGPT, Cursor, VS Code and Windsurf are trademarks of their owners. RapidAgree works with them through the open Model Context Protocol and isn’t affiliated with or endorsed by them.

Quickstart.

From an API key to a signed PDF in four steps.

  1. 01

    Get a key

    An owner or admin makes a key in Settings, Developers (Pro). It starts with sdk_ and is shown once.

  2. 02

    Create and send

    POST /envelopes with the PDF, the signers and the fields. Add send to send it in the same call.

  3. 03

    Hear what happens

    Webhooks tell you when a signer views, signs or declines. Or GET /envelopes/{id}.

  4. 04

    Download

    GET /envelopes/{id}/files/signed for the sealed PDF, /certificate for the audit trail.

Authentication

Send the key as a Bearer token on every request. A key belongs to one workspace and acts as the admin who made it, read-only or read and write. Keys skip two-step sign-in, so keep them on your server, never in a browser.

Check a key
curl https://rapidagree.com/api/v1/me \
  -H "Authorization: Bearer sdk_…"

AI assistants sign in with OAuth 2.1 instead (PKCE, dynamic client registration, Client ID Metadata Documents), picking one workspace on RapidAgree’s consent screen. A Pro API key also works as the Bearer token on /mcp for clients without OAuth.

Rate limits

Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Over a limit, the answer is 429 with Retry-After. A replayed idempotent request counts against nothing.

Requests per key
600 / 10 min
Envelopes created per key
60 / 10 min
Envelopes sent per key
100 / hour
Embedded signing links per key
300 / 10 min

Idempotency

Add Idempotency-Key (1 to 255 characters) to create, send and template calls. Within 24 hours the same key and body get the first answer back, marked Idempotent-Replayed: true; a different body with the same key gets 422.

Errors you can act on.

Every error is {"error": {"code": "…", "message": "…"}}. Codes never change within version 1; messages say what to fix.

StatusCodeMeaning
400invalid_requestSomething is missing or not allowed. The message says what.
401unauthorizedNo key, or an unknown, revoked or expired one.
402plan_requiredThe key's workspace is on Free; the REST API needs Pro.
402plan_limit_reachedFree's 3 documents this month are used. Has limit and resetsAt.
403forbiddenThe key may not do this, such as a read-only key sending.
404not_foundNo such thing, or the key's owner cannot see it.
409wrong_stateNot possible in the envelope's state, such as sending it twice.
413payload_too_largeThe file is over 20 MB, or the JSON is too big.
422idempotency_key_reusedThe Idempotency-Key was used with a different request.
429rate_limitedToo many requests. Wait for Retry-After seconds.
500internal_errorSomething went wrong on our side. Try again.

Signed webhooks.

Add an https endpoint in Settings, Developers (Pro). Each delivery is a JSON POST signed in the Standard Webhooks format: webhook-id, webhook-timestamp and an HMAC-SHA256 webhook-signature.

  • envelope.sentThe envelope was sent; data.signer is the first signer invited.
  • signer.viewedA signer opened it for the first time.
  • signer.signedA signer signed, or an approver approved.
  • envelope.completedEveryone signed; the signed PDF and certificate are ready.
  • envelope.declinedA signer declined, or an approver rejected; data.reason if given.
  • envelope.voidedThe sender voided it; data.reason if given.
  • envelope.expiredIts deadline passed before everyone signed.

Answer any 2xx within 10 seconds. Anything else is retried after 1 minute, 5 and 30 minutes, 2, 8, 24 and 24 hours (about two and a half days in all). Missed some? GET /webhook-deliveries?since= lists them with the same payloads.

import { createHmac, timingSafeEqual } from "node:crypto";

// headers: the request's headers; rawBody: the body as received, before parsing.
export function isFromRapidAgree(headers, rawBody, secret) {
  const id = headers["webhook-id"];
  const timestamp = headers["webhook-timestamp"];
  const signatures = headers["webhook-signature"];

  if (!id || !timestamp || !signatures) return false;
  if (!(Math.abs(Date.now() / 1000 - Number(timestamp)) <= 300)) return false;

  const key = Buffer.from(secret.slice("whsec_".length), "base64");
  const expected = Buffer.from(
    "v1," + createHmac("sha256", key).update(`${id}.${timestamp}.${rawBody}`).digest("base64"),
  );

  // During a secret rotation there are two signatures, space separated.
  return signatures.split(" ").some((signature) => {
    const given = Buffer.from(signature);
    return given.length === expected.length && timingSafeEqual(given, expected);
  });
}
import base64, hashlib, hmac, time

def is_from_rapidagree(headers, raw_body: bytes, secret: str) -> bool:
    msg_id = headers.get("webhook-id")
    timestamp = headers.get("webhook-timestamp")
    signatures = headers.get("webhook-signature")
    if not (msg_id and timestamp and signatures):
        return False
    if not timestamp.isdigit() or abs(time.time() - int(timestamp)) > 300:
        return False

    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{msg_id}.{timestamp}.".encode() + raw_body
    expected = "v1," + base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()

    # During a secret rotation there are two signatures, space separated.
    return any(hmac.compare_digest(expected, given) for given in signatures.split(" "))
// Or any Standard Webhooks library (standardwebhooks.com):
import { Webhook } from "standardwebhooks";

const event = new Webhook(secret.slice("whsec_".length)).verify(rawBody, headers);

Also in the API.

  • Pro

    Embedded signing

    Signing pages inside your own site, in a frame, for signers your app has already identified. Links last up to 4 hours once opened.
  • Templates

    Send from a saved template: one person per role, in order. Template permissions are the workspace’s own.
  • Signing order and checks

    Up to 25 signers in order, at once, or in mixed steps; approvers; access codes and emailed one-time codes.
  • Stable within v1

    Version 1 only ever adds endpoints, fields and codes. Nothing is renamed or removed within a version.

Embedded signing: list your site’s origin under Settings, Developers, send with "delivery": "embedded", then ask POST /envelopes/{id}/signers/{signerId}/embed-link for a link when it is a signer’s turn and show it in an iframe. The frame posts rapidagree:signed to your page when they finish.

Changelog.

Updated 2026-11-30.

    • Remote MCP server at /mcp for Claude, ChatGPT, Cursor, VS Code and any MCP client, with OAuth 2.1 sign-in, on every plan.
    • OpenAPI description gains operation ids, tags and examples; a Postman collection is published.
    • Public developer docs and API reference at rapidagree.com/developers.
    • API keys and webhooks belong to one workspace and act in it alone.
    • 402 plan_required and plan_limit_reached errors for the Pro plan and the Free limit.
    • Version 1 of the REST API: envelopes, templates, uploads, embedded signing, comments and webhook deliveries.
    • Signed webhooks in the Standard Webhooks format, with retries for about two and a half days.
    • Idempotency-Key on create, send and template calls.

Developer questions.

Stuck? support@rapidagree.com

Which plan includes the API?

The REST API, API keys, signed webhooks and embedded signing are on Pro, which is $14.99 a month or $149.90 a year for unlimited documents and users. The MCP server for AI assistants is on every plan, Free included. In short: MCP on every plan; REST API on Pro.

Is there a sandbox?

There is no separate sandbox. Every plan can send 5 test documents a month to your own address, which do not count against the plan, and a Free workspace sends 3 real documents a month. Envelopes from the API are ordinary envelopes, so you can follow and void them in the app.

How are API keys scoped?

A key belongs to one workspace and acts as the owner or admin who made it, with read or read-and-write access. It stops working when it is revoked, expires, or its maker stops being an admin there. Only a hash of each key is stored.

Can I retry a request safely?

Yes. Send an Idempotency-Key header on create, send and template calls. A retry with the same key and body within 24 hours gets the first answer again, marked Idempotent-Replayed, instead of a second envelope. The same key with a different body is refused with 422.

Is there an official SDK?

Not yet. The API is plain JSON over HTTPS with an OpenAPI 3.1 description, so any OpenAPI generator can make a client, and the Postman collection is ready to import. The examples here use fetch in Node.js and requests in Python.

Build it into your product.

Make a key on Pro ($14.99 a month), or connect an AI assistant on any plan, Free included.

No credit card neededUnlimited users on every plan