PHPackages                             laposta/laposta-api-php - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. laposta/laposta-api-php

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

laposta/laposta-api-php
=======================

Laposta api, free api to laposta.nl

2.4.0(3mo ago)875.8k—2%101MITPHPPHP ^8.1CI passing

Since Oct 9Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/laposta/laposta-api-php)[ Packagist](https://packagist.org/packages/laposta/laposta-api-php)[ Docs](https://laposta.nl)[ RSS](/packages/laposta-laposta-api-php/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (9)Dependencies (27)Versions (12)Used By (1)

Laposta API PHP
===============

[](#laposta-api-php)

[![Build](https://github.com/laposta/laposta-api-php/actions/workflows/tests.yml/badge.svg)](https://github.com/laposta/laposta-api-php/actions)[![Coverage](https://camo.githubusercontent.com/a9138ac10e551a6aa8ba620856ac86a3488a72fcdd321bd57c9e5c56af80c970/68747470733a2f2f636f6465636f762e696f2f67682f6c61706f7374612f6c61706f7374612d6170692d7068702f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/laposta/laposta-api-php)[![Packagist Version](https://camo.githubusercontent.com/e8258d414ed0c68af7bfaab13de8f749d9418e83e1ae654f5ba4f6f56861d891/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61706f7374612f6c61706f7374612d6170692d706870)](https://packagist.org/packages/laposta/laposta-api-php)[![PHP Version](https://camo.githubusercontent.com/ffe4a4c28232006dcc5b488f4bf32027c4b68d1aeab9393990579c290a0614ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c61706f7374612f6c61706f7374612d6170692d706870)](https://packagist.org/packages/laposta/laposta-api-php)[![License](https://camo.githubusercontent.com/4ee2b0691b9304e0e589af88c210f7f6a6516e6ad6c523c401ef1c5df4609c76/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c61706f7374612f6c61706f7374612d6170692d706870)](https://github.com/laposta/laposta-api-php/blob/main/LICENSE)

A PHP library for interacting with the Laposta API, compatible with PSR-18 and PSR-17 standards.

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

[](#requirements)

To use the Laposta API, the following is required:

- PHP &gt;= 8.1
- cURL PHP extension
- JSON PHP extension

Composer Installation
---------------------

[](#composer-installation)

The easiest way to install this library is by requiring it via [Composer](https://getcomposer.org/doc/00-intro.md):

```
composer require laposta/laposta-api-php
```

Manual Installation (Version-Scoped, Recommended)
-------------------------------------------------

[](#manual-installation-version-scoped-recommended)

This is the recommended manual installation path for WordPress and other plugin ecosystems. Multiple plugins may bundle different PSR-7 versions and different releases of `laposta-api-php` in the same runtime. The version-scoped build avoids both kinds of collisions by prefixing vendor dependencies and rewriting the public namespace to a release-specific value.

1. Download the version-scoped zip:
    - Latest release (direct download):
    - Specific version:
2. Extract it into your plugin (or another shared location).
3. Load the version-scoped autoloader:

```
require_once __DIR__ . '/laposta-api-version-scoped/autoload.php';
```

The namespace suffix is derived from the release semantic version by concatenating major, minor, and patch. For example, release `2.3.0` exposes `LapostaApi230\Laposta`.

```
$laposta = new LapostaApi230\Laposta('your_api_key');
```

This build prefixes vendor dependencies under `LapostaApi230\Vendor\*`, so no global `Psr\*` symbols are introduced. The version-scoped build is intended for the default HTTP client; if you need to inject your own PSR-18/17/7 implementations, use the Composer distribution instead.

Manual Installation (Scoped, Compatibility Option)
--------------------------------------------------

[](#manual-installation-scoped-compatibility-option)

This distribution only scopes vendor dependencies and keeps the public `LapostaApi\*` namespace unchanged. It is mainly useful if you need a stable namespace for compatibility and you know only one Laposta library version will be loaded in the runtime.

1. Download the scoped zip:
    - Latest release (direct download):
    - Specific version:
2. Extract it into your plugin (or another shared location).
3. Load the scoped autoloader:

```
require_once __DIR__ . '/laposta-api-scoped/autoload.php';
```

This build prefixes vendor dependencies under `LapostaApi\Vendor\*`, but it does not isolate the public `LapostaApi\*` namespace across plugin versions.

Manual Installation (Unscoped, Not Recommended)
-----------------------------------------------

[](#manual-installation-unscoped-not-recommended)

This path should only be used if you fully control the runtime and do not have other plugins/libraries that might define `Psr\*` symbols. In WordPress and other plugin ecosystems, use the version-scoped build above.

To use the unscoped bundle, include the autoloader:

```
require_once("/path/to/laposta-api-php/standalone/autoload.php");
```

Quick Example
-------------

[](#quick-example)

```
$laposta = new LapostaApi\Laposta('your_api_key');
$member = $laposta->memberApi()->create($listId, ['email' => 'test@example.com', 'ip' => '123.123.123.123']);
```

Examples
--------

[](#examples)

This project includes a set of real, runnable examples organized by API resource (e.g., list, campaign, member).
Each example demonstrates a specific API operation and can be run via PHP CLI.
See [examples/README.md](examples/README.md) for setup instructions and an overview of the available examples.

Extensibility
-------------

[](#extensibility)

This library is built around PHP standards (PSR-18/17) and is designed to be flexible.
You can inject your own HTTP client and factories (e.g. Guzzle, Nyholm, Symfony components) via the constructor:

```
$laposta = new LapostaApi\Laposta(
    'your_api_key',
    httpClient: new \GuzzleHttp\Client(), // implements PSR-18
    requestFactory: ...,
    responseFactory: ...,
    streamFactory: ...,
    uriFactory: ...
);
```

If no client or factories are provided, the library uses its own lightweight implementations by default.

API Documentation
-----------------

[](#api-documentation)

For the full API reference, see .

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for a complete list of changes.

License
-------

[](#license)

This library is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance82

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~351 days

Recently: every ~88 days

Total

11

Last Release

90d ago

Major Versions

v1.8 → 2.0.0-rc.12025-05-27

PHP version history (3 changes)v1.5PHP &gt;=5.2

1.6PHP &gt;=5.6

2.0.0-rc.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2689918376c152f0a257dc7bbc45cff28d4a312b113422638b35a1a61458518?d=identicon)[laposta](/maintainers/laposta)

---

Top Contributors

[![roelleor](https://avatars.githubusercontent.com/u/3116170?v=4)](https://github.com/roelleor "roelleor (16 commits)")

---

Tags

apiemailmarketingemail marketingnewsletter

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/laposta-laposta-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/laposta-laposta-api-php/health.svg)](https://phpackages.com/packages/laposta-laposta-api-php)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[cakephp/cakephp

The CakePHP framework

8.9k20.0M1.9k](/packages/cakephp-cakephp)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[getbrevo/brevo-php

Official PHP SDK for the Brevo API.

1004.1M59](/packages/getbrevo-brevo-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
