Abdul.Brevo.Crm 0.1.0-alpha.4

This is a prerelease version of Abdul.Brevo.Crm.
dotnet add package Abdul.Brevo.Crm --version 0.1.0-alpha.4
                    
NuGet\Install-Package Abdul.Brevo.Crm -Version 0.1.0-alpha.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Abdul.Brevo.Crm" Version="0.1.0-alpha.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Abdul.Brevo.Crm" Version="0.1.0-alpha.4" />
                    
Directory.Packages.props
<PackageReference Include="Abdul.Brevo.Crm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Abdul.Brevo.Crm --version 0.1.0-alpha.4
                    
#r "nuget: Abdul.Brevo.Crm, 0.1.0-alpha.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Abdul.Brevo.Crm@0.1.0-alpha.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Abdul.Brevo.Crm&version=0.1.0-alpha.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Abdul.Brevo.Crm&version=0.1.0-alpha.4&prerelease
                    
Install as a Cake Tool

Abdul.Brevo — .NET SDKs for Brevo

A collection of lightweight .NET SDKs for Brevo APIs, built for developers who want simple, dependency-injection friendly access without manually writing HttpClient code.

Package NuGet Description
Abdul.Brevo.Abstractions NuGet Shared foundational layer for all Brevo SDKs
Abdul.Brevo.Core NuGet Brevo Contacts, Lists, Folders, and Webhooks
Abdul.Brevo.Conversations NuGet Brevo Conversations (live chat) REST API
Abdul.Brevo.Email NuGet Brevo Transactional Email API v3
Abdul.Brevo.Crm NuGet Brevo Sales CRM API v3

Features

Abdul.Brevo.Core

  • Retrieve account details and plan limits
  • Manage contacts (Create, Update, Delete, Import, Export, DOI)
  • Organize contacts with folders and lists
  • Manage marketing and transactional webhooks

Abdul.Brevo.Conversations

  • Send messages as an agent
  • Get, update, and delete agent messages
  • Send automated pushed messages to visitors
  • Get, update, and delete automated messages
  • Set agent online status
  • Assign visitors to groups
  • Strongly typed webhook payload models

Abdul.Brevo.Email

  • Send transactional emails (inline HTML or template)
  • Batch send with message versions
  • Schedule emails for future delivery
  • List and retrieve sent email content
  • Manage scheduled emails
  • Delete hard bounces
  • Strongly typed webhook payload models

Abdul.Brevo.Crm

  • Manage companies and their attributes
  • Manage deals, pipelines, and stages
  • Create, list, and complete CRM tasks
  • Create and retrieve notes associated with entities
  • Upload, download, and manage CRM files
  • Create custom attributes for companies and deals
  • Flexible attribute system via Dictionary access

Abdul.Brevo.Abstractions

  • Shared HTTP plumbing and authentication
  • Rate-limit awareness and header parsing (x-sib-ratelimit-*)
  • Automatic 429 (Too Many Requests) detection with RetryAfter timing
  • Unified exception hierarchy with structured error parsing
  • Standard pagination primitives (limit/offset)
  • Shared dependency injection registration helpers

Shared

  • ASP.NET Core dependency injection support
  • .NET 8 and .NET 10 support
  • Unified versioning across all packages
  • Central NuGet package management

Installation

# Core SDK
dotnet add package Abdul.Brevo.Core

# Conversations SDK
dotnet add package Abdul.Brevo.Conversations

# Email SDK
dotnet add package Abdul.Brevo.Email

# CRM SDK
dotnet add package Abdul.Brevo.Crm

Quick Start

Conversations

builder.Services.AddBrevoConversations(options =>
{
    options.ApiKey = builder.Configuration["Brevo:ApiKey"]!;
});
public class SupportMessageService
{
    private readonly IBrevoConversationMessagesClient _messages;

    public SupportMessageService(IBrevoConversationMessagesClient messages)
    {
        _messages = messages;
    }

    public async Task SendAsync(string visitorId, string message)
    {
        await _messages.SendAgentMessageAsync(new SendBrevoAgentMessageRequest
        {
            VisitorId = visitorId,
            Text = message,
            AgentEmail = "support@example.com",
            AgentName = "Support",
            ReceivedFrom = "Helpdesk"
        });
    }
}

Email

builder.Services.AddBrevoEmail(options =>
{
    options.ApiKey = builder.Configuration["Brevo:ApiKey"]!;
});
public class NotificationService
{
    private readonly IBrevoTransactionalEmailClient _email;

    public NotificationService(IBrevoTransactionalEmailClient email)
    {
        _email = email;
    }

    public async Task SendWelcomeEmailAsync(string recipientEmail, string name)
    {
        var result = await _email.SendAsync(new SendTransactionalEmailRequest
        {
            Sender = new EmailSender { Email = "hello@example.com", Name = "My App" },
            To = [new EmailRecipient { Email = recipientEmail, Name = name }],
            Subject = $"Welcome, {name}!",
            HtmlContent = $"<h1>Welcome aboard, {name}!</h1><p>We're glad to have you.</p>"
        });

        Console.WriteLine($"Sent! MessageId: {result.MessageId}");
    }
}

CRM

builder.Services.AddBrevoCrm(options =>
{
    options.ApiKey = builder.Configuration["Brevo:ApiKey"]!;
});
public class DealService
{
    private readonly IBrevoCrmDealsClient _deals;

    public DealService(IBrevoCrmDealsClient deals)
    {
        _deals = deals;
    }

    public async Task CreateDealAsync(string name, double amount)
    {
        await _deals.CreateAsync(new CreateDealRequest
        {
            Name = name,
            Attributes = new Dictionary<string, object>
            {
                ["amount"] = amount,
                ["deal_status"] = "open"
            }
        });
    }
}

Samples

Complete sample ASP.NET Core Minimal APIs are available:

  • Core: samples/Abdul.Brevo.Core.SampleApi/
  • Conversations: samples/Abdul.Brevo.Conversations.SampleApi/
  • Email: samples/Abdul.Brevo.Email.SampleApi/
  • CRM: samples/Abdul.Brevo.Crm.SampleApi/

To run a sample:

  1. Update the API key in the sample's appsettings.json.
  2. Run:
    dotnet run --project samples/Abdul.Brevo.Email.SampleApi
    
  3. Open the OpenAPI (Swagger) UI to test the endpoints.

Project Structure

├── src/
│   ├── Abdul.Brevo.Abstractions/      # Shared foundation (HTTP, Exceptions, Pagination)
│   ├── Abdul.Brevo.Core/              # Contacts, Lists, Folders, Webhooks SDK
│   ├── Abdul.Brevo.Conversations/     # Conversations SDK
│   ├── Abdul.Brevo.Email/             # Transactional Email SDK
│   └── Abdul.Brevo.Crm/               # Sales CRM SDK
├── samples/
│   ├── Abdul.Brevo.Core.SampleApi/
│   ├── Abdul.Brevo.Conversations.SampleApi/
│   ├── Abdul.Brevo.Email.SampleApi/
│   └── Abdul.Brevo.Crm.SampleApi/
├── tests/
│   ├── Abdul.Brevo.Abstractions.Tests/
│   ├── Abdul.Brevo.Core.Tests/
│   ├── Abdul.Brevo.Conversations.Tests/
│   ├── Abdul.Brevo.Email.Tests/
│   └── Abdul.Brevo.Crm.Tests/
├── Directory.Build.props              # Shared version & metadata
├── Directory.Packages.props           # Central NuGet package management
└── Abdul.Brevo.slnx                   # Solution file

Conversations REST API Access

Brevo may restrict Conversations REST API access depending on your account plan, enabled features, credits, or billing status.

If Brevo returns:

{
  "code": "not_enough_credits",
  "message": "Upgrade your plan to use REST API"
}

Abdul.Brevo.Conversations throws:

BrevoConversationsPaymentRequiredException

This means the SDK request was formed correctly, but the Brevo account does not currently have access to that REST API operation. Catch and handle it like this:

try
{
    var result = await messages.SendAgentMessageAsync(request);
}
catch (BrevoConversationsPaymentRequiredException ex)
{
    // Domain-specific 402 exception
    // ex.BrevoCode  → "not_enough_credits"
    // ex.Message    → "Upgrade your plan to use REST API"
}
catch (BrevoRateLimitException ex)
{
    // Shared 429 exception
    // ex.RetryAfter → Suggests wait duration (e.g. 5 seconds)
}
catch (BrevoApiException ex)
{
    // Base exception for all other errors (400, 401, 403, 404, 5xx)
    // ex.StatusCode → 401
    // ex.BrevoCode  → "unauthorized"
}

Note: This is not a package bug. Some Conversations REST API operations require the appropriate Brevo plan, enabled feature access, or available credits.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.4 90 5/14/2026
0.1.0-alpha.3 75 5/14/2026