C# · Integration

Add E-Signatures to .NET (C#)

Send documents for legally binding e-signature from your .NET (C#) 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

.NET (C#) example

C#
[ApiController]
[Route("api/[controller]")]
public class ContractController : ControllerBase
{
    private readonly HttpClient _http;

    public ContractController(HttpClient http) => _http = http;

    [HttpPost("send")]
    public async Task<IActionResult> Send([FromBody] ContractRequest req)
    {
        _http.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Bearer",
                Environment.GetEnvironmentVariable("SIGNBEE_API_KEY"));

        var response = await _http.PostAsJsonAsync(
            "https://signb.ee/api/send", req);
        var result = await response.Content.ReadAsStringAsync();
        return Ok(result);
    }
}

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

.NET is Microsoft's enterprise application framework used by millions of developers. Adding e-signatures uses HttpClient with dependency injection — the standard pattern for external API calls in .NET.

HttpClient management: Never create new HttpClient instances per request — this causes socket exhaustion. Use IHttpClientFactory (registered in Program.cs) for connection pooling and lifecycle management. The example shows constructor injection of HttpClient.

Named or typed clients: For production, register a named or typed HttpClient in Program.cs with pre-configured base address and headers. This centralises configuration and avoids repeating authorization headers in every controller.

Minimal API alternative: .NET 6+ supports Minimal APIs for lightweight endpoints. Replace the controller with a single app.MapPost() call for a more concise integration. Both approaches work identically with the Signbee API.

Configuration: Store SIGNBEE_API_KEY in appsettings.json, user-secrets (development), or Azure Key Vault (production). Use the IOptions pattern for type-safe configuration binding. Never hardcode API keys in source files.

Azure deployment: Signbee works seamlessly on Azure App Service, Azure Functions, and Azure Container Apps. Store the API key in Azure Key Vault and reference it in App Configuration for secure, centralised secrets management.

FAQs

How do I add e-signatures to .NET (C#)?

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 .NET (C#) 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 .NET (C#)?

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

Should I create a new HttpClient for each request?

No. Creating new HttpClient instances per request causes socket exhaustion. Use IHttpClientFactory or register a typed/named HttpClient in Program.cs for proper connection pooling and lifecycle management.

Can I use Minimal APIs instead of controllers?

Yes. .NET 6+ supports Minimal APIs. Replace the controller with app.MapPost('/send-contract', async (ContractRequest req, HttpClient http) => { ... }). Both approaches work identically with the Signbee API.

Where should I store the API key in .NET?

Use user-secrets for development, appsettings.json for configuration structure, and Azure Key Vault for production. Use the IOptions pattern for type-safe configuration binding. Never hardcode API keys.

Related resources

Try Signbee — free, no credit card.