API Documentation
Search…
Users & Groups
Gophish manages recipients for campaigns in groups. Each group can contain one or more recipients. Groups have the following format:
{
id : int64
name : string
targets : array(Target)
modified_date : string(datetime)
}
Each recipient in the targets field has the following format:
{
email : string
first_name : string
last_name : string
position : string
}
get
https://localhost:3333
/api/groups/
Get Groups
get
https://localhost:3333
/api/groups/:id
Get Group
Returns a 404 error if no group is found with the provided ID.
get
https://localhost:3333
/api/groups/summary
Get Groups Summary
get
https://localhost:3333
/api/groups/:id/summary
Get Group Summary
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.
post
https://localhost:3333
/api/groups/
Create Group
When creating a new group, you must specify a unique name, as well as a list of targets. Here's an example request body:
{
"name": "Example Group",
"targets": [
{
"email": "[email protected]",
"first_name": "Example",
"last_name": "User",
"position": ""
},
{
"email": "[email protected]",
"first_name": "Foo",
"last_name": "Bar",
"position": ""
}
]
}
put
https://localhost:3333
/api/groups/:id
Modify Group
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:
{
"id": 1,
"name": "Example Modified Go",
"targets": [
{
"email": "[email protected]",
"first_name": "Foo",
"last_name": "Bar",
"position": ""
}
]
}
Returns a 404 if no group is found with the provided ID.
delete
https://localhost:3333
/api/groups/:id
Delete Group
Returns a 404 error if no group is found with the provided ID.
post
https://localhost:3333
/api/import/group
Import Group
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:
curl -k https://localhost:3333/api/import/group -XPOST \
-F "[email protected]_template.csv" \
-H "Authorization: Bearer 0123456789abcdef"
The results of this API endpoint can be used as the targets parameter in a call to the Create Group endpoint.
Copy link
On this page
get
Get Groups
get
Get Group
get
Get Groups Summary
get
Get Group Summary
post
Create Group
put
Modify Group
delete
Delete Group
post
Import Group