GET Campaigns
GET /companies/v1/campaigns
Get a list of campaigns from the authenticated company with date filters and complete statistics.
➤ URL
GET https://back-stg.whalemate.com/api/companies/v1/campaigns
➤ Headers
{
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
➤ Filtering
Filters can be applied to the route using the following structure:
filter[filter_name]=value
Each filter corresponds to a specific field and helps refine the query results. Below is an explanation of the available filters:
| Param | Type | Required | Description | Default Value |
|---|---|---|---|---|
from_date | string (YYYY-MM-DD) | No | Minimum release date | 1 month ago |
to_date | string (YYYY-MM-DD) | No | Latest release date | Today |
status | string | No | Filter by status (draft, sent, completed) |
Example Usage
Multiple filters can be combined in a single request to refine the search results. Example:
filter[from_date]=2025-01-01&filter[status]=sent,completed
This query will return campaigns between January 1, 2025, and today, whose status is "Sent" or "Completed".
➤ Pagination
Pagination parameters allow controlling the number of results per page and navigating through pages.
| Param | Type | Required | Description | Default Value |
|---|---|---|---|---|
page | integer | No | Current page (standard pagination) | |
per_page | integer | No | Amount per page | 20 |
Example Usage
filter[status]=sent&per_page=25&page=2
This query will return the second page of results, with up to 25 campaigns per page, filtered by the "Sent" status.
➤ Types
{
id: integer,
title: string,
launch_date: date,
status: string,
status: string,
statistics: {
sent: integer,
open: integer,
clicked: integer,
reported: integer,
failed: integer
}
}[]
➤ Response
Example of successful response (200 OK)
[
{
id: 1,
title: "Simulación de Phishing 2025",
launch_date: "2025-09-10T10:00:00Z",
status: "completed",
status: "In Progress",
statistics: {
sent: 500,
open: 420,
clicked: 120,
reported: 15,
failed: 5
}
}
]
➤ Common Errors
| Code | Message | Couse |
|---|---|---|
| 401 | Unauthorized | API Key invalid or missing |
| 400 | Bad Request | One or more filters have an invalid format |
| 429 | Too Many Requests | The limit of requests was exceeded |
| 500 | Internal Server Error | Unexpected server error |