Java · Integration

Add E-Signatures to Spring Boot

Send documents for legally binding e-signature from your Spring Boot application. One endpoint, no SDK required.

Quick start

  1. Get an API key from signb.ee (free, no credit card)
  2. Set SIGNBEE_API_KEY in your environment
  3. Add the code below to your app

Spring Boot example

Java
@RestController
public class ContractController {
    private final RestTemplate rest = new RestTemplate();

    @PostMapping("/send-contract")
    public ResponseEntity<String> send(@RequestBody Map<String, String> body) {
        HttpHeaders headers = new HttpHeaders();
        headers.set("Authorization", "Bearer " + System.getenv("SIGNBEE_API_KEY"));
        headers.setContentType(MediaType.APPLICATION_JSON);

        HttpEntity<Map<String, String>> entity = new HttpEntity<>(body, headers);
        ResponseEntity<String> response = rest.postForEntity(
            "https://signb.ee/api/send", entity, String.class);
        return response;
    }
}

What happens

  1. Your app sends markdown or a PDF URL to Signbee
  2. Signbee generates a PDF (if markdown) and emails the recipient a signing link
  3. 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

Spring Boot is the dominant Java framework for enterprise applications. Adding e-signatures to Spring Boot uses RestTemplate (shown above) or the newer WebClient for reactive applications.

RestTemplate vs WebClient: RestTemplate (shown above) is Spring's traditional synchronous HTTP client. For Spring WebFlux (reactive) applications, use WebClient instead for non-blocking API calls. Both work identically with the Signbee API.

Configuration properties: Define a @ConfigurationProperties class for Signbee settings. Store the API key in application.yml or application.properties. Use Spring profiles to manage different keys for development, staging, and production environments.

Service layer: Extract the API call into a @Service class (SignbeeService). Inject it into controllers via constructor injection. This follows Spring's layered architecture pattern and makes the service testable with @MockBean in integration tests.

Retry and circuit breaker: Use Spring Retry or Resilience4j to add retry logic and circuit breaker patterns. If the Signbee API is temporarily unavailable, retries with exponential backoff ensure eventual delivery without manual intervention.

Spring Security integration: Protect your contract-sending endpoint with Spring Security. Add @PreAuthorize annotations for role-based access control, ensuring only authorised users can send contracts for signing.

FAQs

How do I add e-signatures to Spring Boot?

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 Spring Boot 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 Spring Boot?

Yes. Signbee is a REST API that works with any language or framework including Spring Boot. 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 RestTemplate or WebClient?

Use RestTemplate for traditional Spring MVC applications (synchronous). Use WebClient for Spring WebFlux applications (reactive/non-blocking). Both work identically with the Signbee API. WebClient is also available in MVC applications for async calls.

How do I configure the API key in Spring Boot?

Store SIGNBEE_API_KEY in application.yml or as an environment variable. Use @ConfigurationProperties for type-safe configuration. Use Spring profiles (application-dev.yml, application-prod.yml) for different keys across environments.

Can I add retry logic for contract sending?

Yes. Use Spring Retry (@Retryable annotation) or Resilience4j for retry logic with exponential backoff and circuit breaker patterns. This ensures contract delivery even during temporary API unavailability.

Related resources

Try Signbee — free, no credit card.