PHPackages                             bluerocktel/atera-api-php-client - 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. bluerocktel/atera-api-php-client

ActiveLibrary[API Development](/categories/api)

bluerocktel/atera-api-php-client
================================

A light PHP client for the Atera CRM API

v1.1.0(1mo ago)1186↓50%MITPHPPHP ^8.3

Since Sep 17Pushed 1mo ago2 watchersCompare

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

READMEChangelogDependencies (12)Versions (5)Used By (0)

php-sdk
=======

[](#php-sdk)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Latest Version on Packagist](https://camo.githubusercontent.com/6f160f24d4b04acb2ca038446bfc03ad0d5d42e24cba7cf948e3f285d014c152/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626c7565726f636b74656c2f61746572612d6170692d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bluerocktel/atera-api-php-client)[![Total Downloads](https://camo.githubusercontent.com/3a3a6c62363785387a0600951506998e084b6d7eb8a018dac9274ff0c661274e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626c7565726f636b74656c2f61746572612d6170692d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bluerocktel/atera-api-php-client)

This package is a light PHP Client / SDK for the [Atera](https://atera.com/) API.

- [Installation](#installation)
- [Authentication](#authentication)
- [Usage](#usage)
    - [Requests](#usage-requests)
    - [Resources](#usage-resources)
    - [Responses](#usage-responses)
    - [Entities](#usage-entities)
    - [Pagination](#usage-pagination)
    - [Extending the SDK](#usage-extends)

Installation
------------

[](#installation)

This library requires PHP `>=8.1`.

You can install the package via composer:

```
composer require bluerocktel/atera-api-php-client

```

Authentication
--------------

[](#authentication)

The autentication with the Atera API is made using an Api token you can retreive from the Atera admin panel. Read more in the [Atera documentation](https://support.atera.com/hc/fr/articles/219083397-API).

```
use BlueRockTEL\AteraClient\AteraConnector;

$api = new AteraConnector(
    apiToken: 'secret_token',
    apiUrl: 'https://app.atera.com/api', // optional
);
```

After instancianting the `AteraConnector` class, you can start querying the API.

```
$response = $api->agent()->index();

var_dump(
  $response->failed(), // true is the request returned 4xx or 5xx code.
  $response->json(),   // json response as an array
);
```

Usage
-----

[](#usage)

To query the API, you can either call each API [Endpoints requests](https://github.com/bluerocktel/atera-api-php-client/tree/main/src/Endpoints) individually, or make use of provided [Resources classes](https://github.com/bluerocktel/atera-api-php-client/tree/main/src/Resources) which groups the requests into clusters.

### Using Requests

[](#using-requests)

Using single requests is pretty straightforward. You can use the `call()` method of the `AteraConnector` class to send the desired request to the instance :

```
use BlueRockTEL\AteraClient\AteraConnector;
use BlueRockTEL\AteraClient\Endpoints;

$api = new AteraConnector('secret_token');

$response = $api->call(
  new Endpoints\Contacts\GetContactRequest(id: $contactId)
);
```

### Using Resources

[](#using-resources)

Using resources is a more convenient way to query the API. Each Resource class groups requests by specific API namespaces (Customer, Agent, Contact...).

```
use BlueRockTEL\AteraClient\AteraConnector;

$api = new AteraConnector('secret_token');

$query = [
    'searchOptions.email' => 'test@example.com',
];

$response = $api->contact()->index(
    query: $query,
    perPage: 20,
    page: 1,
);
```

Resources classes usually provide (but are not limited to) the following methods :

```
class NamespaceResource
{
    public function index(array $params = [], int $perPage = 20, int $page = 1): Response;
    public function show(int $id): Response;
    public function store(Entity $entity): Response;
    public function update(Entity $entity): Response;
    public function upsert(Entity $entity): Response;
    public function delete(int $id): Response;
}
```

> 👉 The `upsert()` method is a simple alias : it will call the `update()` method if the given entity has an id, or the `store()` method otherwise.

Each of those namespace resources can be accessed using the `AteraConnector` instance :

```
$connector = new AteraConnector(...);

$connector->agent(): Resources\AgentResource
$connector->customer(): Resources\CustomerResource
$connector->contact(): Resources\ContactResource
...
```

If needed, it is also possible to create the desired resource instance manually.

```
use BlueRockTEL\AteraClient\AteraConnector;
use BlueRockTEL\AteraClient\Resources\AgentResource;

$api = new AteraConnector();
$resource = new AgentResource($api);

$agent = $resource->show($agentId);
$resource->upsert($agent);
```

### Responses

[](#responses)

Weither you are using Requests or Resources, the response is always an instance of `Saloon\Http\Response` class. It provides some useful methods to check the response status and get the response data.

```
// Check response status
$response->ok();
$response->failed();
$response->status();
$response->headers();

// Get response data
$response->json(); # as an array
$response->body(); # as an raw string
$response->dtoOrFail(); # as a Data Transfer Object
```

You can learn more about responses by reading the [Saloon documentation](https://docs.saloon.dev/the-basics/responses#useful-methods), which this SDK uses underneath.

### Entities (DTO)

[](#entities-dto)

When working with APIs, dealing with a raw or JSON response can be tedious and unpredictable.

To make it easier, this SDK provides a way to transform the response data into a Data Transfer Object (DTO) (later called Entities). This way, you are aware of the structure of the data you are working with, and you can access the data using object typed properties instead of untyped array keys.

```
$response = $api->agent()->show(id: 92);

/** @var \BlueRockTEL\AteraClient\Entities\Agent */
$agent = $response->dtoOrFail();
```

Although you can use the `dto()` method to transform the response data into an entity, it is recommended to use the `dtoOrFail()` method instead. This method will throw an exception if the response status is not 2xx, instead of returning an empty DTO.

It is still possible to access the underlying response object using the `getResponse()` method of the DTO :

```
$entity = $response->dtoOrFail();   // \BlueRockTEL\AteraClient\Contracts\Entity
$entity->getResponse();             // \Saloon\Http\Response
```

> Learn more about working with Data tranfert objects on the [Saloon documentation](https://docs.saloon.dev/digging-deeper/data-transfer-objects).

The create/update/upsert routes will often ask for a DTO as first parameter :

```
use BlueRockTEL\AteraClient\Entities\Customer;

// create
$response = $api->customer()->store(
    customer: new Customer(
        CustomerName: 'Acme Enterprise',
        City: 'Paris',
    ),
);

$customer = $response->dtoOrFail();

// update
$customer->CustomerName = 'Acme Enterprise Inc.';
$api->customer()->update($customer);
```

### Pagination

[](#pagination)

On some index/search routes, the Atera API will use a pagination. If you need to iterate on all pages of the endpoint, you may find handy to use the connector's `paginate()` method :

```
# Create a PagedPaginator instance
$paginator = $api->paginate(new GetCustomersRequest());

# Iterate on all pages entities, using lazy loading for performance
foreach ($paginator->items() as $customer) {
    $name = $customer->CustomerName;
    $city = $customer->City;
}
```

Read more about lazy paginations on the [Saloon documentation](https://docs.saloon.dev/installable-plugins/pagination#using-the-paginator).

### Extending the SDK

[](#extending-the-sdk)

You may easily extend the SDK by creating your own Resources, Requests, and Entities.

Then, by extending the `AteraConnector` class, add you new resources to the connector :

```
use BlueRockTEL\AteraClient\AteraConnector;

class MyCustomConnector extends AteraConnector
{
    public function defaultConfig(): array
    {
        return [
            'timeout' => 120,
        ];
    }

    public function customResource(): \App\Resources\CustomResource
    {
        return new \App\Resources\CustomResource($this);
    }
}

$api = new MyCustomConnector('secret_token');
$api->customResource()->index();
```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance89

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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 ~184 days

Total

4

Last Release

54d ago

Major Versions

v0.1.1 → v1.0.02026-03-09

PHP version history (3 changes)v0.1.0PHP &gt;=8.1

v1.0.0PHP ^8.2

v1.1.0PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![tgeorgel](https://avatars.githubusercontent.com/u/11785727?v=4)](https://github.com/tgeorgel "tgeorgel (5 commits)")

### Embed Badge

![Health badge](/badges/bluerocktel-atera-api-php-client/health.svg)

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

###  Alternatives

[sandorian/moneybird-api-php

Moneybird API client for PHP

127.3k](/packages/sandorian-moneybird-api-php)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[myoutdeskllc/salesforce-php

salesforce library for php8+

1560.8k](/packages/myoutdeskllc-salesforce-php)

PHPackages © 2026

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