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:

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 https://localhost:3333/api/campaigns/

Returns a list of campaigns.

Headers

Name
Type
Description

Authorization

string

A valid API key

Get Campaign

GET https://localhost:3333/api/campaigns/:id

Returns a campaign given an ID.

Path Parameters

Name
Type
Description

id

integer

The campaign ID

Headers

Name
Type
Description

Authorization

string

A valid API key

Returns a 404 error if the specified campaign isn't found.

Create Campaign

POST https://localhost:3333/api/campaigns/

Creates and launches a new campaign.

Headers

Name
Type
Description

Authorization

string

A valid API key

Request Body

Name
Type
Description

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 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:

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 Campaign Results

GET https://localhost:3333/api/campaigns/:id/results

Gets the results for a campaign.

Path Parameters

Name
Type
Description

id

integer

The campaign ID

Headers

Name
Type
Description

Authorization

string

A valid API key

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 Campaign Summary

GET https://localhost:3333/api/campaigns/:id/summary

Returns summary information about a campaign.

Path Parameters

Name
Type
Description

id

integer

The campaign ID

Headers

Name
Type
Description

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 https://localhost:3333/api/campaigns/:id

Deletes a campaign by ID.

Path Parameters

Name
Type
Description

id

integer

The campaign ID

Headers

Name
Type
Description

Authorization

string

A valid API key

Returns a 404 error if the specified campaign isn't found.

Complete Campaign

GET https://localhost:3333/api/campaigns/:id/complete

Marks a campaign as complete.

Path Parameters

Name
Type
Description

id

integer

The campaign ID

Headers

Name
Type
Description

Authorization

string

A valid API key

Last updated