Campaigns
Campaigns have the following structure:
{
"id" : int,
"name" : string,
"created_date" : string(datetime),
"launch_date" : string(datetime),
"send_by_date" : string(datetime),
"completed_date" : string(datetime),
"status" : string,
"results" : []Result,
"groups" : []Group,
"smtp" : {
"id" : int,
"interface_type" : string,
"name" : string,
"host" : string,
"from_address" : string,
"ignore_cert_errors" : bool,
"headers" : []Header,
"modified_date" : string(datetime)
},
"scenarios" : []Scenario,
"customer" : {}Customer,
"customer_id" : int,
"repeat_delay" : string,
"parent_id" : int,
"total_targets" : int,
"sensibilisation_type" : string
}
Campaign Events
Gottaphish keeps track of every event for a campaign in it's timeline. Each event has the following format:
The details field is a string containing JSON which contains the raw data about an event (such as credentials that were submitted, user-agent information, and more). The details field has the following format:
Campaign Results
In addition to this, campaign results are maintained in the results attribute. This has a format similar to the members of a Group, in that they have the following structure:
Get Campaigns
GET /api/campaigns/
Returns a list of campaigns.
Headers
Authorization*
string
A valid API key
Get Campaign
GET /api/campaigns/:id
Returns a campaign given an ID.
Path Parameters
id*
integer
The campaign ID
Headers
Authorization*
string
A valid API key
Returns a 404 error if the specified campaign isn't found.
Create Campaign
POST /api/campaigns/
Creates and launches a new campaign.
Headers
Authorization*
string
A valid API key
Request Body
Payload*
object
The campaign details. See the introduction above for the format of a campaign.
This method expects the campaign to be provided in JSON format. For the various objects in a campaign, such as the scenario, landing page, or sending profile, you need to provide the name attribute. Here's an example of a JSON payload to create a new campaign:
Scheduling a Campaign
You can schedule a campaign to launch at a later time. To do this, simply put the desired time you want the campaign to launch in the launch_date attribute. Gophish expects the date to be provided in ISO8601 format.
Without setting a launch date, Gophish launches the campaign immediately.
Spreading out Emails
By default, Gophish sends all the emails in a campaign as quickly as possible. Instead, you may wish to spread emails out over a period of hours or days. This is possible by setting the send_by_dat, (the "During" attribute) to an ISO8601 formatted datetime. It's important to note that this must be after the launch_date.
Get Campaign Results
GET /api/campaigns/:id/results
Gets the results for a campaign.
Path Parameters
id*
integer
The campaign ID
Headers
Authorization*
string
A valid API key
You may not always want the full campaign details, including the scenarios, landing page, etc. Instead, you may just want to poll the campaign results for updates. This API endpoint only returns information that's relevant to the campaign results.
Returns a 404 error if the specified campaign isn't found.
Get Campaign Summary
GET api/campaigns/:id/summary
Returns summary information about a campaign.
Path Parameters
id*
integer
The campaign ID
Headers
Authorization*
string
A valid API key
Returns a 404 error if the specified campaign isn't found.
There may be cases where you aren't interested in the specific results, but rather want high-level statistics, or a "summary", about a campaign.
The response includes a stats object which has the following format:
Delete Campaign
DELETE /api/campaigns/:id
Deletes a campaign by ID.
Path Parameters
id*
integer
The campaign ID
Headers
Authorization*
string
A valid API key
Returns a 404 error if the specified campaign isn't found.
Complete Campaign
GET /api/campaigns/:id/complete
Marks a campaign as complete.
Path Parameters
id*
integer
The campaign ID
Headers
Authorization*
string
A valid API key
Last updated