PHP code example of jeffersongoncalves / laravel-instantly

1. Go to this page and download the library: Download jeffersongoncalves/laravel-instantly library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeffersongoncalves / laravel-instantly example snippets


// config/instantly.php
return [
    'api_key' => env('INSTANTLY_API_KEY'),
    'base_url' => env('INSTANTLY_BASE_URL', 'https://api.instantly.ai/api/v1'),
];

use JeffersonGoncalves\Instantly\Facades\Instantly;
use JeffersonGoncalves\Instantly\Exceptions\InstantlyException;

Instantly::campaigns()->list(limit: 10, skip: 0);
Instantly::campaigns()->get('campaign-id');
Instantly::campaigns()->status('campaign-id');
Instantly::campaigns()->launch('campaign-id');
Instantly::campaigns()->pause('campaign-id');

Instantly::leads()->list('campaign-id', limit: 10);
Instantly::leads()->add('campaign-id', [
    'email' => '[email protected]',
    'first_name' => 'Jane',
    'last_name' => 'Doe',
    'company_name' => 'Acme',
]);
Instantly::leads()->delete('campaign-id', '[email protected]');
Instantly::leads()->status('campaign-id', '[email protected]');

Instantly::accounts()->list(limit: 10);
Instantly::accounts()->status('[email protected]');
Instantly::accounts()->warmupStatus('[email protected]');

Instantly::analytics()->campaignSummary('campaign-id', start_date: '2026-01-01', end_date: '2026-01-31');
Instantly::analytics()->campaignSteps('campaign-id');
Instantly::analytics()->accountCount('2026-01-01', '2026-01-31');

Instantly::blocklist()->list();
Instantly::blocklist()->add(['spam.com', '[email protected]']);

try {
    $result = Instantly::campaigns()->launch('campaign-id');
} catch (InstantlyException $e) {
    // $e->getMessage() — the API's error message, or the raw response body
    // $e->errorBody()   — the full decoded JSON error response
} catch (InvalidArgumentException $e) {
    // a 
bash
php artisan vendor:publish --tag="instantly-config"
bash
composer analyse