PHPackages                             mautic/api-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mautic/api-library

ActiveLibrary[API Development](/categories/api)

mautic/api-library
==================

Mautic API Connector Library

3.1.0(4y ago)1971.7M↑17.5%127[45 issues](https://github.com/mautic/api-library/issues)[4 PRs](https://github.com/mautic/api-library/pulls)20MITPHPPHP &gt;=7.2.0CI passing

Since Jun 23Pushed 3mo ago37 watchersCompare

[ Source](https://github.com/mautic/api-library)[ Packagist](https://packagist.org/packages/mautic/api-library)[ RSS](/packages/mautic-api-library/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (31)Used By (20)

[![codecov](https://camo.githubusercontent.com/ba34c5d8c42af04de91c8aebd8e7ab37031d9d7582eecb8bad0e94c472f20866/68747470733a2f2f636f6465636f762e696f2f67682f6d61757469632f6170692d6c6962726172792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/mautic/api-library) [![Latest Stable Version](https://camo.githubusercontent.com/f2366c850c5173c0421e9543872e6a2b40254782095b5513dceaf51407cb8158/68747470733a2f2f706f7365722e707567782e6f72672f6d61757469632f6170692d6c6962726172792f76)](//packagist.org/packages/mautic/api-library) [![Total Downloads](https://camo.githubusercontent.com/83ece81aca44a5ba2a534269153b82c5e6e9683d9a94b981f74e1d99b0eaafec/68747470733a2f2f706f7365722e707567782e6f72672f6d61757469632f6170692d6c6962726172792f646f776e6c6f616473)](//packagist.org/packages/mautic/api-library) [![Latest Unstable Version](https://camo.githubusercontent.com/4d213ad9026cfb058caa64e4dae5e899c521e39d2d24b333787f85f1188a659b/68747470733a2f2f706f7365722e707567782e6f72672f6d61757469632f6170692d6c6962726172792f762f756e737461626c65)](//packagist.org/packages/mautic/api-library) [![License](https://camo.githubusercontent.com/e014a79444afc3e9aa77a19b878157eeebd0ed8c412d3706271db09b4969f4cf/68747470733a2f2f706f7365722e707567782e6f72672f6d61757469632f6170692d6c6962726172792f6c6963656e7365)](//packagist.org/packages/mautic/api-library)

[![All Contributors](https://camo.githubusercontent.com/a237d66c7feaed87b0ed19f0e2258b6bfb6d2d6d55dd4c82b665071b284306e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d382d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](#contributors-)

Using the Mautic API Library
============================

[](#using-the-mautic-api-library)

Requirements
------------

[](#requirements)

- PHP 8.2 or newer

Installing the API Library
--------------------------

[](#installing-the-api-library)

You can install the API Library with the following command:

```
composer require mautic/api-library
```

N.B. Make sure you have installed a PSR-18 HTTP Client before you install this package or install one at the same time e.g. `composer require mautic/api-library guzzlehttp/guzzle:^7.3`.

### HTTP Client

[](#http-client)

We are decoupled from any HTTP messaging client with the help of [PSR-18 HTTP Client](https://www.php-fig.org/psr/psr-18/). This requires an extra package providing [psr/http-client-implementation](https://packagist.org/providers/psr/http-client-implementation). To use Guzzle 7, for example, simply require `guzzlehttp/guzzle`:

```
composer require guzzlehttp/guzzle:^7.3
```

The installed HTTP Client is auto-discovered using [php-http/discovery](https://packagist.org/providers/php-http/discovery), but you can also provide your own HTTP Client if you like.

```
