Campaigns
Create, send, and view statistics for email campaigns.
|
Endpoints
| GET | /api/v1/mail/campaigns | List campaigns |
| POST | /api/v1/mail/campaigns | Create a campaign |
| GET | /api/v1/mail/campaigns/{id} | Get a campaign |
| PATCH | /api/v1/mail/campaigns/{id} | Update a campaign |
| DELETE | /api/v1/mail/campaigns/{id} | Delete a campaign |
| POST | /api/v1/mail/campaigns/{id}/send | Send a campaign |
| GET | /api/v1/mail/campaigns/{id}/stats | Get campaign stats |
GET
/api/v1/mail/campaignsList campaigns
Authentication required— Include session cookie or Bearer token
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
search | string | Optional | Search by campaign name |
status | string | Optional | Filter by status (draft / scheduled / sent) |
limit | integer | Optional | Number of items to return (default: 20, max: 100) |
offset | integer | Optional | Offset for pagination (default: 0) |
Code Examples
curl "https://api.blueai.jp/api/v1/mail/campaigns" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/mail/campaignsCreate a campaign
Authentication required— Include session cookie or Bearer token
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Required | Campaign name |
subject | string | Required | Email subject |
sender_name | string | Optional | Sender name |
sender_email | string | Optional | Sender email address |
reply_to | string | Optional | Reply-to email address |
list_id | string | Required | Target list ID |
html_body | string | Optional | HTML body |
text_body | string | Optional | Text body |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/mail/campaigns" \
-H "Cookie: better-auth.session_token=<token>"GET
/api/v1/mail/campaigns/{id}Get a campaign
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Campaign ID |
Code Examples
curl "https://api.blueai.jp/api/v1/mail/campaigns/camp_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"PATCH
/api/v1/mail/campaigns/{id}Update a campaign
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Campaign ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Optional | Campaign name |
subject | string | Optional | Email subject |
sender_name | string | Optional | Sender name |
sender_email | string | Optional | Sender email address |
reply_to | string | Optional | Reply-to email address |
list_id | string | Optional | Target list ID |
html_body | string | Optional | HTML body |
text_body | string | Optional | Text body |
Code Examples
curl -X PATCH "https://api.blueai.jp/api/v1/mail/campaigns/camp_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"DELETE
/api/v1/mail/campaigns/{id}Delete a campaign
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Campaign ID |
Code Examples
curl -X DELETE "https://api.blueai.jp/api/v1/mail/campaigns/camp_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/mail/campaigns/{id}/sendSend a campaign
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Campaign ID |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/mail/campaigns/camp_123e4567e89b12d3a456426614174000/send" \
-H "Cookie: better-auth.session_token=<token>"GET
/api/v1/mail/campaigns/{id}/statsGet campaign stats
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Campaign ID |
Code Examples
curl "https://api.blueai.jp/api/v1/mail/campaigns/camp_123e4567e89b12d3a456426614174000/stats" \
-H "Cookie: better-auth.session_token=<token>"