Users & Groups
Gophish manages recipients for campaigns in groups. Each group can contain one or more recipients. Groups have the following format:
Each recipient in the targets
field has the following format:
Get Groups
GET
https://localhost:3333/api/groups/
Returns a list of groups.
Headers
Authorization
string
A valid API key
Get Group
GET
https://localhost:3333/api/groups/:id
Returns a group with the given ID.
Path Parameters
id
integer
The group ID
Headers
Authorization
string
A valid API key
Returns a 404 error if no group is found with the provided ID.
Get Groups Summary
GET
https://localhost:3333/api/groups/summary
Returns a summary of each group.
Headers
Authorization
string
A valid API key
Get Group Summary
GET
https://localhost:3333/api/groups/:id/summary
Returns a summary for a group.
Path Parameters
id
integer
The group ID
Headers
Authorization
string
A valid API key
It may be the case that you just want the number of members in a group, not necessarily the full member details. This API endpoint returns a summary for a group.
Returns a 404 error if no group is found with the provided ID.
Create Group
POST
https://localhost:3333/api/groups/
Creates a new group.
Headers
Authorization
string
A valid API key
Request Body
Payload
object
The group to create in JSON format.
When creating a new group, you must specify a unique name
, as well as a list of targets
. Here's an example request body:
Modify Group
PUT
https://localhost:3333/api/groups/:id
Modifies a group.
Path Parameters
id
integer
The group ID
Headers
Authorization
string
A valid API key
Request Body
Payload
object
The updated group content. The full group must be provided in JSON format.
This API endpoint allows you to modify an existing group. The request must include the complete group JSON, not just the fields you're wanting to update. This means that you need to include the matching id
field. Here's an example request:
Returns a 404 if no group is found with the provided ID.
Delete Group
DELETE
https://localhost:3333/api/groups/:id
Deletes a group
Path Parameters
id
number
The group ID
Headers
Authorization
string
A valid API key
Returns a 404 error if no group is found with the provided ID.
Import Group
POST
https://localhost:3333/api/import/group
Reads and parses a CSV, returning data that can be used to create a group.
Headers
Authorization
string
A valid API key
Request Body
file
object
A file upload containing the CSV content to parse.
This API endpoint allows you to upload a CSV, returning a list of group targets. For example, you can use the following curl
command to upload the CSV:
The results of this API endpoint can be used as the targets
parameter in a call to the Create Group endpoint.
Last updated