API v1

Campaign API Reference

Complete API documentation for managing email campaigns programmatically. Create, update, send, and track your campaigns with ease.

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Authorization: Bearer YOUR_API_TOKEN

Campaign Object

Core data structure for campaigns

id readonly
int
name
string
subject
string
content
string
template_id
int
email_service_id
int
from_name
string
from_email
string
is_open_tracking
bool
is_click_tracking
bool
sent_count readonly
int
open_count readonly
int
click_count readonly
int
send_to_all
bool
tags
array
scheduled_at
datetime

List Campaigns

Retrieve a paginated list of campaigns

GET

Endpoint

GET /api/v1/campaigns

Response Code

200 OK

Sample Request

GET /api/v1/campaigns HTTP/1.1
Host: sendportal.local
Authorization: Bearer 9w2fN7d4F3Banyv7gihYOWJEH6MvtYyZ
Accept: application/json

Sample Response

{
  "data": [
    {
      "id": 1,
      "name": "name",
      "subject": "My Campaign Subject",
      "content": "My Email Content",
      "status_id": 1,
      "template_id": 1,
      "email_service_id": 1,
      "from_name": "SendPortal",
      "from_email": "[email protected]",
      "is_open_tracking": true,
      "is_click_tracking": true,
      "sent_count": 0,
      "open_count": 0,
      "click_count": 0,
      "send_to_all": true,
      "tags": [],
      "save_as_draft": false,
      "scheduled_at": "2020-07-24 08:46:54",
      "created_at": "2020-07-24 08:23:38",
      "updated_at": "2020-07-24 09:43:42"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 25,
    "total": 1
  }
}

Show Campaign

Get details of a single campaign

GET

Endpoint

GET /api/v1/campaigns/{campaignId}

Response Code

200 OK

Create Campaign

Create a new campaign

POST

Endpoint

POST /api/v1/campaigns

Response Code

201 Created

Request Fields

name - string (required)
subject - string (required)
content - string (required)
template_id - int (required)
is_open_tracking - bool (optional)
tags - array (optional)

Send Campaign

Trigger campaign delivery

POST

Endpoint

POST /api/v1/campaigns/{campaignId}/send

Response Code

200 OK

Important

Once a campaign is sent, it cannot be recalled. Ensure all content and recipient lists are correct before sending.

Need Help?

Check out our complete documentation or reach out to our support team for assistance with your integration.

Our Software Ecosystem

A suite of powerful, developer-centric tools designed to accelerate your workflow and enhance your Laravel applications.

Laravel Mail

Laravel Mail

Advanced email marketing and automation platform. Send campaigns, manage subscribers, and track performance with powerful analytics.

Explore Product
Laravel SEO

Laravel SEO

Comprehensive SEO toolkit for Laravel applications. Optimize meta tags, sitemaps, schema markup, and improve search rankings effortlessly.

Explore Product
Laravel GPT

Laravel GPT

AI-powered Laravel application with GPT integration. Intelligent content generation, automated responses, and smart chatbot capabilities.

Explore Product
Laravel UI

Laravel UI

Premium UI components designed for easy use with Laravel. High-quality Marketing and Application UI blocks built for conversion.

Explore Product