Skip to content

Clients

The clients endpoint returns the list of clients your API key is authorised for. For a standard key this is your own account; for a reseller/parent key it also includes your managed sub-clients.

Pagination

This endpoint uses offset-based pagination. Use the limit parameter to control page size and the offset parameter to skip results. The response paging object reports the total number of matching clients so you can iterate until offset + count reaches total.

Endpoint

GET /v1/clients

Parameters

Parameter Type Required Description
clientId string No Return a single client by ID. Must be a client your API key is authorised for.
search string No Free-text, case-insensitive partial match on client ID, name, or parent client name.
active boolean No Filter by account status. true returns only active clients, false only inactive.
limit integer No Maximum number of clients to return per page. Must be from 1 to 500. Defaults to 200.
offset integer No Number of clients to skip before returning results. Must be 0 or greater. Defaults to 0.

Authorisation

Passing a clientId your API key is not authorised for returns 401 with Unauthorized. Please ensure client ID is valid..

Parameter validation

limit and offset must be whole numbers within the ranges above, and active must be true or false. Invalid values return 400 with a message describing the offending parameter.

Request Example

curl -X GET -G 'https://capi.phishfort.com/v1/clients' \
  -H 'accept: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d 'active=true' \
  -d 'limit=50'
import requests

response = requests.get(
    "https://capi.phishfort.com/v1/clients",
    headers={
        "accept": "application/json",
        "x-api-key": "YOUR_API_KEY",
    },
    params={
        "active": "true",
        "limit": 50,
    },
)
print(response.json())
const params = new URLSearchParams({
  active: "true",
  limit: "50",
});

const response = await fetch(
  `https://capi.phishfort.com/v1/clients?${params}`,
  {
    headers: {
      accept: "application/json",
      "x-api-key": "YOUR_API_KEY",
    },
  }
);
const data = await response.json();
console.log(data);

Response Example

The data field is an array of ClientStructure's. The paging object reports the page window and the total number of matching clients.

{
    "message": "success",
    "data": [
        {
            "id": "0Xp5voyA4y5xYNoufOVC",
            "name": "Example Client",
            "active": true
        },
        {
            "id": "7bQ2mLtRz9uKpWnDcExample",
            "name": "Example Sub-Client",
            "active": true
        }
    ],
    "paging": {
        "limit": 50,
        "offset": 0,
        "count": 2,
        "total": 2
    }
}

Fetching the Next Page

To fetch the next page of results, increment the offset by your limit:

curl -X GET -G 'https://capi.phishfort.com/v1/clients' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d 'limit=50' \
  -d 'offset=50'