Download the PHP package getbrevo/brevo-php without Composer

On this page you can find all versions of the php package getbrevo/brevo-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package brevo-php

Brevo PHP Library

fern shield php shield

Official SDK for the Brevo API.

Table of Contents

Documentation

API reference documentation is available here.

Requirements

This SDK requires PHP ^8.1.

Installation

Upgrading from v4.x

v5 is a major release. Most breaking changes come from an internal effort at Brevo to make endpoints, parameters and models more self-descriptive — so names, shapes and required fields convey intent without needing to cross-reference external docs (both for developers and for AI agents working against the Brevo API).

v4.x remains supported. If you need to hold on v4 temporarily, pin it:

View v4 → v5 migration guide ### Breaking changes **Companies — `GetCompaniesRequest::filters` renamed** - `filters` is renamed to `filtersAttributesName` to match the wire format. - Existing code passing `'filters' => ...` does not throw, but the filter is silently ignored server-side and the response is unfiltered. Audit every call site. **Events — `Event::createBatchEvents` payload shape changed** **Balance — `getActiveBalancesApi` response shape changed** - Return type changed from `?BalanceLimit` to `?GetLoyaltyBalanceProgramsPidActiveBalanceResponse`. **Balance — `getContactBalances` requires `balanceDefinitionId`** - `$request` no longer defaults to empty; `balanceDefinitionId` is required. **Balance — `BeginTransactionRequest::eventTime` type tightened** - Changed from `?string` to `?DateTime`. ISO strings now cause `TypeError`. **CRM — `Tasks::getAllTaskTypes` returns an array** (`?array` instead of `?GetCrmTasktypesResponse`). **Email campaigns — `utmIdActive` renamed** - `EmailCampaigns\GetEmailCampaignResponse::utmIdActive` renamed to `utmId` (wire key `utmIDActive` → `utmID`, type `?bool` → `?int`). Same change on `GetEmailCampaignsResponseCampaignsItem`. **Model fields removed**: `GetAccountResponse::dateTimePreferences`, `Webhook::channel`, `GetProcessResponseInfo::export`, `GetProcessResponse::error/createdAt/completedAt`, and several `ExternalFeeds` response fields. **Model field types tightened**: - `Process\GetProcessResponseInfoImport` count fields: `?int` → `?string` (now URLs to CSV reports) — affects `invalidEmails`, `duplicateContactId`, `duplicateExtId`, etc. - `Ecommerce\CreateUpdateProductResponse::id` and `CreateUpdateCategoryResponse::id`: `?int` → `?string`. - Several `string` date fields tightened to `?DateTime` (`Program::*`, `Reward::*`, `BalanceLimit::createdAt`/`updatedAt`). **Model fields renamed**: `ConversationsMessageAttachmentsItem::fileName` → `name`, `::inlineId` → `link`. **Custom objects — associations union flattened**: `UpsertrecordsRequestRecordsItemAssociationsItem` is now a single class with an `action: 'link' | 'unlink'` discriminator. Seven old variant classes have been deleted. ### Added - New optional fields and filters across `contacts->createContact`, `contacts->updateContact`, `emailCampaigns->getEmailCampaigns`, `ecommerce->getProducts`, and several other endpoints. - Tier groups support upgrade and downgrade schedule fields.

Migration from v1.x

Warning: The legacy v1.x SDK will continue to receive critical security updates but no new features. We recommend migrating to v5.x.

View migration guide **Key changes:** - Unified `Brevo` client with namespaced resources - Standardized error handling via `BrevoApiException` - PSR-18 HTTP client support **v1.x:** **v5.x:**

Usage

Instantiate and use the client with the following:

Exception Handling

When the API returns a non-success status code (4xx or 5xx response), an exception will be thrown.

Advanced

Custom Client

This SDK is built to work with any HTTP client that implements the PSR-18 ClientInterface. By default, if no client is provided, the SDK will use php-http/discovery to find an installed HTTP client. However, you can pass your own client that adheres to ClientInterface:

Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).

A request is deemed retryable when any of the following HTTP status codes is returned:

Use the maxRetries request option to configure this behavior.

Timeouts

The SDK does not configure a default timeout. Unless you set one, the underlying HTTP client's default applies (Guzzle, for example, defaults to no timeout). Set an explicit timeout (in seconds) at the client or request level:

Timeout forwarding is supported for Guzzle and Symfony HttpClient. Other PSR-18 clients ignore the timeout option.

Logging

The SDK does not ship a built-in logger. Because the client option accepts any PSR-18 HTTP client, you can plug in any PSR-3 logger (Monolog, Symfony Logger, Laravel's Log facade) by wrapping that client with logging middleware. This keeps the SDK lean and lets you reuse the logger your application already configures.

Logging happens at the HTTP layer, so each SDK call produces one log line per HTTP request — including retries, which the SDK performs internally.

Warning: The api-key header is sent on every request. If your message formatter includes request headers ({req_headers}), redact it before writing to disk or shipping to an external sink.

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!


All versions of brevo-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
psr/http-client Version ^1.0
psr/http-client-implementation Version ^1.0
psr/http-factory Version ^1.0
psr/http-factory-implementation Version ^1.0
psr/http-message Version ^1.1 || ^2.0
php-http/discovery Version ^1.0
php-http/multipart-stream-builder Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package getbrevo/brevo-php contains the following files

Loading the files please wait ...