# GetGroups

## Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

### Headers

```
GET /api/ss/groups HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Query

#### **allGroups (*****boolean*****)**

Get details for all groups, instead of groups you are a member of. Available to admins only.

Example:

```
GET /api/ss/groups?allGroups=true HTTP/1.1
```

**cf\_key\_allowlist (string) (optional)**

List of custom field keys to include in response. Add multiple for more than one key e.g. `?cf_key_allowlist=key1&cf_key_allowlist=key2` or specify no keys to exclude all fields e.g. `?cf_key_allowlist=`

Example:

```
GET /api/ss/groups?cf_key_allowlist=key1&cf_key_allowlist=key2 HTTP/1.1
```

**cf\_key\_blocklist (string) (optional)**

List of custom field keys to exclude from response. Add multiple for more than one key e.g. `?cf_key_blocklist=key1&cf_key_blocklist=key2`

Example:

```
GET /api/ss/groups?cf_key_blocklist=key1&cf_key_blocklist=key2 HTTP/1.1
```

## Example

The following example is a cURL request to get all groups user is a member of.

### Request

Include API Token instead of stars in 'X-SSAPI-KEY: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*' parameter.\ <br>

```
curl -X GET 'https://demo.attackforge.com/api/ss/groups' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close'
```

### Response

Response contains an array of group objects.

```
{
   "count": 999,
   "groups":[
      {
         "group_name": "...",
         "group_owner": "...",
         "group_primary_contact_name": "...",
         "group_primary_contact_number": "...",
         "group_primary_contact_email": "...",
         "group_id": "...",
         "group_custom_fields": [{ "key": "...", "value": "..." }]
      }
   ]
}
```
