Campaigns
Campaigns have the following structure:
{
id : int64
name : string
created_date : string(datetime)
launch_date : string(datetime)
send_by_date : string(datetime)
completed_date : string(datetime)
template : Template
page : Page
status : string
results : []Result
groups : []Group
timeline : []Event
smtp : SMTP
url : string
}
The template, page, groups, and smtp objects are all Gophish objects. Their format can be found at their various API endpoints.

Campaign Events

Gophish keeps track of every event for a campaign in it's timeline. Each event has the following format:
{
email : string
time : string(datetime)
message : string
details : string(JSON)
}
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:
{
payload : object
browser : object
}

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:
{
id : int64
first_name : string
last_name : string
position : string
status : string
ip : string
latitude : float
longitude : float
send_date : string(datetime)
reported : boolean
}
get
https://localhost:3333
/api/campaigns/
Get Campaigns
get
https://localhost:3333
/api/campaigns/:id
Get Campaign
Returns a 404 error if the specified campaign isn't found.
post
https://localhost:3333
/api/campaigns/
Create Campaign
This method expects the campaign to be provided in JSON format. For the various objects in a campaign, such as the template, 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:
{
"name":"CC Example Campaign",
"template":{"name":"Example Template"},
"url":"http://localhost",
"page":{"name":"Example Landing Page"},
"smtp":{"name":"Example Sending Profile"},
"launch_date":"2018-10-08T16:20:00+00:00",
"send_by_date":null,
"groups":[{"name":"Example Group"}]
}

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 minutes, hours, days, or weeks. This is possible by setting the send_by_date to an ISO8601 formatted datetime. It's important to note that this must be after the launch_date.
get
https://localhost:3333
/api/campaigns/:id/results
Get Campaign Results
You may not always want the full campaign details, including the template, 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
https://localhost:3333
/api/campaigns/:id/summary
Get Campaign Summary
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:
{
total : int
sent : int
opened : int
clicked : int
submitted_data : int
email_reported : int
}
delete
https://localhost:3333
/api/campaigns/:id
Delete Campaign
Returns a 404 error if the specified campaign isn't found.
get
https://localhost:3333
/api/campaigns/:id/complete
Complete Campaign
Copy link
On this page
Campaign Events
Campaign Results
get
Get Campaigns
get
Get Campaign
post
Create Campaign
Scheduling a Campaign
Spreading out Emails
get
Get Campaign Results
get
Get Campaign Summary
delete
Delete Campaign
get
Complete Campaign