Go · Integration

Add E-Signatures to Go

Send documents for legally binding e-signature from your Go 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

Go example

Go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
    "os"
)

func sendContract(w http.ResponseWriter, r *http.Request) {
    var body map[string]string
    json.NewDecoder(r.Body).Decode(&body)

    payload, _ := json.Marshal(body)
    req, _ := http.NewRequest("POST", "https://signb.ee/api/send",
        bytes.NewBuffer(payload))
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SIGNBEE_API_KEY"))
    req.Header.Set("Content-Type", "application/json")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    w.Header().Set("Content-Type", "application/json")
    io.Copy(w, resp.Body)
}

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

Go is the language of choice for high-performance backend services. Adding e-signatures to Go uses only the standard library — no external dependencies required.

Standard library only: The example uses net/http, encoding/json, bytes, and os — all from Go's standard library. No third-party HTTP client or SDK is needed. This keeps your binary small and dependency-free.

Error handling: The example omits error handling for brevity. In production, check every error return — json.NewDecoder errors (malformed JSON), http.NewRequest errors (invalid URL), http.DefaultClient.Do errors (network failures), and response status codes (4xx/5xx).

Context propagation: Use r.Context() to propagate request context through the API call. This enables request cancellation and timeout propagation. Set a context.WithTimeout to prevent long-running API calls from blocking your server.

HTTP client reuse: Don't use http.DefaultClient in production. Create a shared *http.Client with appropriate timeouts and connection pool settings. This reuses TCP connections across requests, reducing latency.

Goroutine-based concurrency: Go's goroutines make it trivial to send contracts concurrently. For batch operations, launch goroutines for each API call with a semaphore (buffered channel) to control concurrency and prevent overwhelming the API.

Gin/Fiber frameworks: If you're using Gin or Fiber, the API call is identical — only the request/response handling syntax changes. The core HTTP POST to Signbee works the same regardless of framework.

FAQs

How do I add e-signatures to Go?

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 Go 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 Go?

Yes. Signbee is a REST API that works with any language or framework including Go. Send a POST request with your document content, sender and recipient details, and Signbee handles the entire signing ceremony. No SDK required.

Do I need any external Go packages for Signbee?

No. The integration uses Go's standard library only (net/http, encoding/json). No SDK or third-party HTTP client is required. This keeps your binary small and your dependency tree clean.

How do I handle timeouts in Go when calling the API?

Create a context.WithTimeout and pass it to http.NewRequestWithContext. Set a reasonable timeout (10-30 seconds) to prevent long-running API calls from blocking your server. Also configure timeouts on your shared http.Client.

Does Signbee work with Gin, Fiber, or other Go frameworks?

Yes. The core API call (HTTP POST with JSON body and Authorization header) is identical regardless of framework. Only the request/response handling syntax changes between net/http, Gin, Fiber, Echo, or Chi.

Related resources

Try Signbee — free, no credit card.