Skip to main content
Packagist Total Downloads

Installation

Install the package using Composer:
composer require loops-so/loops
You can install Loops skills to help your coding agents use the Loops CLI, API and SDKs to create campaigns, manage contacts, send events, and send transactional emails.
You will need a Loops API key to use the SDK. In your Loops account, go to the API Settings page and click Generate key. Copy this key and save it in your application code (for example in an environment variable).

Usage

use Loops\LoopsClient;
use Loops\Exceptions\APIError;

$loops = new LoopsClient(env('LOOPS_API_KEY'));

try {
    $result = $loops->contacts->create('test@example.com', [
        'firstName' => 'John',
    ]);
} catch (APIError $e) {
    echo $e->getMessage();
    $returnedJson = $e->getJson();
    $statusCode = $e->getStatusCode();
}
Use RateLimitExceededError to handle rate limits. See the SDK docs for every method, namespaces, and error handling. See the API documentation to learn more about rate limiting and error handling.

Packagist

View the full documentation on Packagist.

GitHub

View the source code and release notes.

Loops API

Read the Loops API reference.
Last modified on June 2, 2026