Ruby · Integration
Add E-Signatures to Ruby on Rails
Send documents for legally binding e-signature from your Ruby on Rails 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
Ruby on Rails example
# app/controllers/contracts_controller.rb
class ContractsController < ApplicationController
def send_contract
response = Net::HTTP.post(
URI("https://signb.ee/api/send"),
{
content: params[:content],
senderName: params[:sender_name],
senderEmail: params[:sender_email],
recipientName: params[:recipient_name],
recipientEmail: params[:recipient_email]
}.to_json,
"Authorization" => "Bearer #{ENV['SIGNBEE_API_KEY']}",
"Content-Type" => "application/json"
)
render json: JSON.parse(response.body)
end
endWhat 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
Ruby on Rails is the framework that popularised convention over configuration. Adding e-signatures to Rails follows the same philosophy — a single controller action, standard Net::HTTP, and Rails conventions for environment variables.
Credentials management: Rails 5.2+ introduced encrypted credentials. Store your SIGNBEE_API_KEY in Rails credentials (rails credentials:edit) rather than environment variables for better security. Access it via Rails.application.credentials.signbee_api_key.
Active Job integration: For background contract sending, create a SendContractJob that wraps the API call. This integrates with any Active Job backend (Sidekiq, Resque, Delayed Job) and provides automatic retries, error handling, and job monitoring.
HTTP client choice: The example uses Net::HTTP (Ruby standard library). For cleaner syntax and better error handling, consider the Faraday gem (standard in many Rails projects) or HTTParty for a simpler API.
Service objects: In a well-structured Rails application, extract the Signbee API call into a service object (app/services/signbee_service.rb). This keeps controllers thin, makes the logic testable in isolation, and allows reuse across multiple controllers.
Webhook handling: Set up a webhook endpoint in your Rails app to receive signing notifications. Use Rails' ActionController to parse the incoming webhook payload and update your models (e.g., marking a contract as signed).
FAQs
How do I add e-signatures to Ruby on Rails?
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 Ruby on Rails 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 Ruby on Rails?
Yes. Signbee is a REST API that works with any language or framework including Ruby on Rails. Send a POST request with your document content, sender and recipient details, and Signbee handles the entire signing ceremony. No SDK required.
Should I use Net::HTTP or a gem for the API call?
Either works. Net::HTTP is Ruby's standard library and requires no additional dependencies. For cleaner syntax, consider Faraday (common in Rails projects) or HTTParty. The API call is a simple POST — any HTTP client works.
How do I send contracts in the background in Rails?
Create a SendContractJob using Active Job. This integrates with Sidekiq, Resque, or any Active Job backend. The job handles the API call asynchronously with automatic retries and error handling.
Where should I store the API key in Rails?
Use Rails encrypted credentials (rails credentials:edit) for the strongest security. Alternatively, use environment variables via dotenv-rails for development and your deployment platform's configuration for production.
Related resources
Try Signbee — free, no credit card.