Python · Integration
Add E-Signatures to Flask
Send documents for legally binding e-signature from your Flask application. One endpoint, no SDK required.
Quick start
- Get an API key from signb.ee (free, no credit card)
- Set
SIGNBEE_API_KEYin your environment - Add the code below to your app
Flask example
from flask import Flask, request, jsonify
import requests
app = Flask(__name__)
@app.route("/send-contract", methods=["POST"])
def send_contract():
data = request.get_json()
response = requests.post(
"https://signb.ee/api/send",
headers={
"Authorization": f"Bearer {os.environ['SIGNBEE_API_KEY']}",
"Content-Type": "application/json",
},
json=data,
)
return jsonify(response.json())What happens
- Your app sends markdown or a PDF URL to Signbee
- Signbee generates a PDF (if markdown) and emails the recipient a signing link
- Recipient signs — both parties receive the signed PDF with SHA-256 certificate
Also works with AI agents
Install the MCP server to let Claude, Cursor, or Windsurf send documents directly:
npx -y signbee-mcp
Integration details
Flask is Python's lightweight web framework — minimal, flexible, and ideal for microservices and APIs. Adding e-signatures to Flask requires just a single route and the requests library.
Flask vs Django for e-signatures: Flask is better suited for microservices that handle specific tasks (like contract signing) independently. If e-signing is a small part of a larger application, Flask lets you build a focused signing service without the overhead of a full framework.
Blueprints: For larger Flask applications, organise your contract-related routes in a Blueprint. This keeps your signing logic separate from other application concerns and makes it easy to reuse across projects.
Flask-RESTful: If you're building a REST API with Flask, use Flask-RESTful or flask-smorest for structured API development. These libraries add request parsing, input validation, and automatic documentation generation.
Environment variables: Use python-dotenv to load SIGNBEE_API_KEY from a .env file during development. In production, set it via your deployment platform's environment configuration. Flask doesn't load environment variables automatically — you need python-dotenv or os.environ.
Gunicorn deployment: In production, run Flask behind Gunicorn with multiple workers. The Signbee API call is I/O-bound, so Gunicorn's async workers (gevent or eventlet) can handle many concurrent signing requests efficiently.
FAQs
How do I add e-signatures to Flask?
Get an API key from signb.ee (free, no credit card), set SIGNBEE_API_KEY in your environment, and add a single POST request to your Flask application. The recipient receives a signing link by email, signs on any device, and both parties get a SHA-256 certified PDF.
Does Signbee work with Flask?
Yes. Signbee is a REST API that works with any language or framework including Flask. Send a POST request with your document content, sender and recipient details, and Signbee handles the entire signing ceremony. No SDK required.
Is Flask suitable for e-signature integration?
Yes. Flask's lightweight design makes it ideal for focused microservices like a contract signing service. Add a single route, make an HTTP POST to the Signbee API, and you have a fully functional e-signature endpoint with minimal code.
How do I load the API key in Flask?
Use python-dotenv to load SIGNBEE_API_KEY from a .env file during development. In production, set it via your deployment platform's environment variables. Access it with os.environ['SIGNBEE_API_KEY'] in your Flask routes.
Can Flask handle high-volume contract signing?
Yes. Run Flask behind Gunicorn with async workers (gevent or eventlet) for concurrent request handling. For very high volumes, offload API calls to a task queue like Celery or RQ.
Related resources
Try Signbee — free, no credit card.