API Documentation

This is the documentation for the available API endpoints, which are built around the REST architecture. All the API endpoints will return a JSON response with the standard HTTP response codes and need a Bearer Authentication via an API Key.

Authentication

All the API endpoints require an API key sent by the Bearer Authentication method.

curl --request GET \
--url 'https://app.watchthem.live/api/{endpoint}' \
--header 'Authorization: Bearer {api_key}' \

User

GET https://app.watchthem.live/api/user
curl --request GET \
--url 'https://app.watchthem.live/api/user' \
--header 'Authorization: Bearer {api_key}' \
{
    "data": {
        "id":"1",
        "type":"users",
        "email":"[email protected]",
        "billing":{
            "type":"personal",
            "name":"John Doe",
            "address":"Lorem Ipsum",
            "city":"Dolor Sit",
            "county":"Amet",
            "zip":"5000",
            "country":"",
            "phone":"",
            "tax_id":""
        },
        "is_enabled":true,
        "plan_id":"custom",
        "plan_expiration_date":"2025-12-12 00:00:00",
        "plan_settings":{
            ...
        },
        "plan_trial_done":false,
        "language":"english",
        "timezone":"UTC",
        "country":null,
        "date":"2020-01-01 00:00:00",
        "last_activity":"2020-01-01 00:00:00",
        "total_logins":10
    }
}

Website statistics

GET https://app.watchthem.live/api/statistics/{website_id}
curl --request GET \
--url 'https://app.watchthem.live/api/statistics/{website_id}?start_date=2020-01-01&end_date=2021-01-01' \
--header 'Authorization: Bearer {api_key}' \
Parameters Details Description
start_date Required Start date in Y-m-d format.
end_date Required End date in Y-m-d format.
type Optional Type of data to be returned. Allowed values are: overview, paths, referrers, referrer_paths, countries, cities, operating_systems, device_types, browser_names, utms_source, utms_medium_campaign, screen_resolutions, browser_languages, goals. Defaults to overview.
country_code Optional Parameter only available for the cities type.
utm_source Optional Parameter only available for the utms_medium_campaign type.
{
    "data": [
        {
          "path": "/dashboard",
          "pageviews": 500,
          "bounces": 10
        },
        {
          "path": "/websites",
          "pageviews": 250,
          "bounces": 0
        },
        {
          "path": "/",
          "pageviews": 200,
          "bounces": 36
        },
        {
          "path": "/register",
          "pageviews": 100,
          "bounces": 25
        },
        {
          "path": "login",
          "pageviews": 50,
          "bounces": 10
        },
    ]
}

Websites

GET https://app.watchthem.live/api/websites/
curl --request GET \
--url 'https://app.watchthem.live/api/websites/' \
--header 'Authorization: Bearer {api_key}' \
Parameters Details Description
page Optional The page number that you want results from. Defaults to 1.
results_per_page Optional How many results you want per page. Allowed values are: 10 , 25 , 50 , 100 , 250. Defaults to 25.
{
    "data": [
        {
            "id": 1,
            "pixel_key": "1234567890123456",
            "name": "Localhost",
            "scheme": "https://",
            "host": "example.com",
            "path": "/",
            "tracking_type": "normal",
            "excluded_ips": "",
            "events_children_is_enabled": false,
            "sessions_replays_is_enabled": false,
            "email_reports_is_enabled": false,
            "email_reports_last_date": "2020-06-23 19:01:22",
            "is_enabled": true,
            "date": "2019-11-01 12:00:30"
        },
    ],
    "meta": {
        "page": 1,
        "results_per_page": 25,
        "total": 1,
        "total_pages": 1
    },
    "links": {
        "first": "https://app.watchthem.live/api/websites?&page=1",
        "last": "https://app.watchthem.live/api/websites?&page=1",
        "next": null,
        "prev": null,
        "self": "https://app.watchthem.live/api/websites?&page=1"
    }
}
GET https://app.watchthem.live/api/websites/{website_id}
curl --request GET \
--url 'https://app.watchthem.live/api/websites/{website_id}' \
--header 'Authorization: Bearer {api_key}' \
{
    "data": {
        "id": 1,
        "pixel_key": "1234567890123456",
        "name": "Localhost",
        "scheme": "https://",
        "host": "example.com",
        "path": "/",
        "tracking_type": "normal",
        "excluded_ips": "",
        "events_children_is_enabled": false,
        "sessions_replays_is_enabled": false,
        "email_reports_is_enabled": false,
        "email_reports_last_date": "2020-06-23 19:01:22",
        "is_enabled": true,
        "date": "2019-11-01 12:00:30"
    }
}
POST https://app.watchthem.live/api/websites
Parameters Details Description
name Required -
scheme Optional Allowed values are: http:// and https://.
host Required Website Host & Path. Example: https://example.com/path.
tracking_type Optional Allowed values are: lightweight and normal.
excluded_ips Optional Exclude IPs from tracking. Enter comma separated values.
events_children_is_enabled Optional Track visitor events (mouse clicks, resizes, scrolls, form submissions). Allowed values are: 0 or 1. Only available for normal tracking type.
sessions_replays_is_enabled Optional Session replays. Allowed values are: 0 or 1. Only available for normal tracking type.
email_reports_is_enabled Optional Email reports. Allowed values are: 0 or 1.
curl --request POST \
--url 'https://app.watchthem.live/api/websites' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'host=website.com' \
--form 'name=Example' \
{
    "data": {
        "id": 1
    }
}
POST https://app.watchthem.live/api/websites/{website_id}
Parameters Details Description
name Optional -
scheme Optional Allowed values are: http:// and https://.
host Optional Website Host & Path. Example: https://example.com/path.
excluded_ips Optional Exclude IPs from tracking. Enter comma separated values.
events_children_is_enabled Optional Track visitor events (mouse clicks, resizes, scrolls, form submissions). Allowed values are: 0 or 1. Only available for normal tracking type.
sessions_replays_is_enabled Optional Session replays. Allowed values are: 0 or 1. Only available for normal tracking type.
email_reports_is_enabled Optional Email reports. Allowed values are: 0 or 1.
is_enabled Optional Website tracking status. Allowed values are: 0 or 1.
curl --request POST \
--url 'https://app.watchthem.live/api/websites/{website_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'is_enabled=0' \
{
    "data": {
        "id": 1
    }
}
DELETE https://app.watchthem.live/api/websites/{website_id}
curl --request DELETE \
--url 'https://app.watchthem.live/api/websites/{website_id}' \
--header 'Authorization: Bearer {api_key}' \

Payments

GET https://app.watchthem.live/api/payments/
curl --request GET \
--url 'https://app.watchthem.live/api/payments/' \
--header 'Authorization: Bearer {api_key}' \
Parameters Details Description
page Optional The page number that you want results from. Defaults to 1.
results_per_page Optional How many results you want per page. Allowed values are: 10 , 25 , 50 , 100 , 250. Defaults to 25.
{
    "data": [
        {
            "id": 1,
            "plan_id": 1,
            "processor": "stripe",
            "type": "one_time",
            "frequency": "monthly",
            "email": "[email protected]",
            "name": null,
            "total_amount": "4.99",
            "currency": "USD",
            "status": true,
            "date": "2021-03-25 15:08:58"
        },
    ],
    "meta": {
        "page": 1,
        "results_per_page": 25,
        "total": 1,
        "total_pages": 1
    },
    "links": {
        "first": "https://app.watchthem.live/api/payments?&page=1",
        "last": "https://app.watchthem.live/api/payments?&page=1",
        "next": null,
        "prev": null,
        "self": "https://app.watchthem.live/api/payments?&page=1"
    }
}
GET https://app.watchthem.live/api/payments/{payment_id}
curl --request GET \
--url 'https://app.watchthem.live/api/payments/{payment_id}' \
--header 'Authorization: Bearer {api_key}' \
{
    "data": {
        "id": 1,
        "plan_id": 1,
        "processor": "stripe",
        "type": "one_time",
        "frequency": "monthly",
        "email": "[email protected]",
        "name": null,
        "total_amount": "4.99",
        "currency": "USD",
        "status": true,
        "date": "2021-03-25 15:08:58"
    }
}

Logs

GET https://app.watchthem.live/api/logs/
curl --request GET \
--url 'https://app.watchthem.live/api/logs/' \
--header 'Authorization: Bearer {api_key}' \
Parameters Details Description
page Optional The page number that you want results from. Defaults to 1.
results_per_page Optional How many results you want per page. Allowed values are: 10 , 25 , 50 , 100 , 250. Defaults to 25.
{
    "data": [
        {
            "type": "login.success",
            "ip": "127.0.0.1",
            "date": "2021-02-03 12:21:40"
        },
        {
            "type": "login.success",
            "ip": "127.0.0.1",
            "date": "2021-02-03 12:23:26"
        }
    ],
    "meta": {
        "page": 1,
        "results_per_page": 25,
        "total": 1,
        "total_pages": 1
    },
    "links": {
        "first": "https://app.watchthem.live/api/payments?&page=1",
        "last": "https://app.watchthem.live/api/payments?&page=1",
        "next": null,
        "prev": null,
        "self": "https://app.watchthem.live/api/payments?&page=1"
    }
}