The official PHP SDK for Reloop, providing a convenient, PSR-4 compliant wrapper around the Reloop REST API.
- PHP 8.1 or higher
- Composer
Install the package via Composer:
composer require reloop/reloop-emailInitialize the client with your API key. You can find or generate your API key in the Reloop Dashboard.
require_once 'vendor/autoload.php';
use Reloop\Reloop;
$reloop = new Reloop('rl_your_api_key_here');The SDK supports full CRUD and lifecycle management operations for API Keys.
$response = $reloop->apiKeys->list(['page' => 1, 'limit' => 10]);
print_r($response['apiKeys']); // Array of API keys
print_r($response['total']); // Total count$newKey = $reloop->apiKeys->create(['name' => 'Production Key']);
echo $newKey['key']; // The actual secret key (only returned on creation or rotation)$key = $reloop->apiKeys->get('api_key_id_here');$updatedKey = $reloop->apiKeys->update('api_key_id_here', ['name' => 'New Name']);$reloop->apiKeys->delete('api_key_id_here');// Rotate the secret of an API key while keeping the same ID
$rotatedKey = $reloop->apiKeys->rotate('api_key_id_here');
// Temporarily disable an API key
$reloop->apiKeys->disable('api_key_id_here');
// Re-enable an API key
$reloop->apiKeys->enable('api_key_id_here');ISC