Skip to main content

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:

ParamTypeRequiredDescriptionDefault Value
from_datestring (YYYY-MM-DD)NoMinimum release date1 month ago
to_datestring (YYYY-MM-DD)NoLatest release dateToday
statusstringNoFilter 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.

ParamTypeRequiredDescriptionDefault Value
pageintegerNoCurrent page (standard pagination)
per_pageintegerNoAmount per page20

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

CodeMessageCouse
401UnauthorizedAPI Key invalid or missing
400Bad RequestOne or more filters have an invalid format
429Too Many RequestsThe limit of requests was exceeded
500Internal Server ErrorUnexpected server error

Test Request