---
title: List portal user activity
slug: andrei/list-portal-user-activity
createdAt: 2026-10-05T10:36:01.732Z
---

{
  "id": "gZzEa2ayDt4nodWxgTJWF",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.detected.app/api/v2/public/portal-users/activity",
    "servers": [
      {
        "url": "https://api.detected.app/api/v2/public/portal-users/activity",
        "description": "Production"
      }
    ],
    "name": "List portal user activity",
    "description": "<p>Returns activity recorded for portal users, such as login events. By default it returns all activity for all portal users in your account. Narrow the results with filters such as <code>profile_id</code>.</p>\n<p>The supported activity types (<code>types</code>) are:</p>\n<ul>\n<li><code>access_log</code>: login events, including IP address, location, browser and session information</li>\n</ul>\n<p>More activity types may be added in future.</p>\n<p>This endpoint is paginated. Use the <code>page</code> parameter to request further pages. The <code>meta</code> and <code>links</code> objects in the response describe the current page and link to the others.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "id",
          "type": "string",
          "description": "ID of the portal activity."
        },
        {
          "kind": "optional",
          "name": "user_id",
          "type": "string",
          "description": "Filter by portal user ID."
        },
        {
          "kind": "optional",
          "name": "profile_id",
          "type": "string",
          "description": "Filter results by profile ID."
        },
        {
          "kind": "optional",
          "name": "email",
          "type": "string",
          "description": "Filter by portal user email address."
        },
        {
          "kind": "optional",
          "name": "ip",
          "type": "string",
          "description": "Filter by IP address."
        },
        {
          "kind": "optional",
          "name": "types",
          "type": "string",
          "description": "<p>Filter by activity type. Currently only <code>access_log</code> is supported.</p>"
        },
        {
          "kind": "optional",
          "name": "name",
          "type": "string",
          "description": "Filter by portal user name."
        },
        {
          "kind": "optional",
          "name": "order_by",
          "type": "string",
          "description": "<p>Direction to sort the results in: <code>asc</code> for ascending or <code>desc</code> for descending. Use it together with <code>sort_by</code>; it has no effect if <code>sort_by</code> is omitted. The default is <code>asc</code>.</p>",
          "enum": [
            "desc",
            "asc"
          ]
        },
        {
          "kind": "optional",
          "name": "sort_by",
          "type": "string",
          "description": "<p>The field to sort the results by. Use it together with <code>order_by</code> to choose the direction; if <code>order_by</code> is omitted, results are sorted in ascending order (<code>asc</code>). If <code>sort_by</code> is omitted, results are returned in no guaranteed order.</p>\n<p>Supported fields:</p>\n<ul>\n<li><code>id</code></li>\n<li><code>created_at</code></li>\n<li><code>updated_at</code></li>\n</ul>"
        },
        {
          "kind": "optional",
          "name": "page",
          "type": "string",
          "description": "<p>Page number of the results to return, starting from 1. The number of items per page is returned in <code>meta.per_page</code>.</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "AccessToken",
          "name": "AccessToken",
          "kind": "optional",
          "type": "http",
          "description": "<p>The API uses OAuth 2.0. Request an access token from <code>POST /oauth/token</code> with the client ID and client secret of your integration client, and your account slug. Send the access token in the <code>Authorization</code> header of every request, in the format <code>Authorization: Bearer &#x3C;access_token></code>. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.</p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "X-RateLimit-Limit",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "X-RateLimit-Remaining",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/ProfilePortalUserActivityResponse",
                "customType": "ProfilePortalUserActivityResponse",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "number",
                    "description": "Activity ID."
                  },
                  {
                    "name": "type",
                    "kind": "required",
                    "type": "string<access_log>",
                    "description": "Type of activity.",
                    "enum": [
                      "access_log"
                    ]
                  },
                  {
                    "name": "user",
                    "kind": "optional",
                    "type": "object",
                    "description": "The portal user the activity belongs to.",
                    "example": "",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "number",
                        "description": "Portal user ID."
                      },
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "description": "Name of the portal user."
                      },
                      {
                        "name": "email",
                        "kind": "required",
                        "type": "string",
                        "description": "Email address of the portal user."
                      }
                    ]
                  },
                  {
                    "name": "ip",
                    "kind": "required",
                    "type": "string",
                    "description": "User IP address."
                  },
                  {
                    "name": "browser_agent",
                    "kind": "optional",
                    "type": "string",
                    "description": "Browser user agent string."
                  },
                  {
                    "name": "session_information",
                    "kind": "optional",
                    "type": "object",
                    "description": "Portal user session information.",
                    "example": "",
                    "schema": [
                      {
                        "name": "city",
                        "kind": "optional",
                        "type": "string",
                        "description": "City the session was started from."
                      },
                      {
                        "name": "region",
                        "kind": "optional",
                        "type": "string",
                        "description": "Region the session was started from."
                      },
                      {
                        "name": "country_code",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Country the session was started from, ISO 3166-1 alpha-2 country code.</p>"
                      },
                      {
                        "name": "latitude",
                        "kind": "optional",
                        "type": "string",
                        "description": "Approximate latitude of the session location."
                      },
                      {
                        "name": "longitude",
                        "kind": "optional",
                        "type": "string",
                        "description": "Approximate longitude of the session location."
                      },
                      {
                        "name": "time_zone",
                        "kind": "optional",
                        "type": "string",
                        "description": "Time zone of the session location."
                      },
                      {
                        "name": "privacy_node",
                        "kind": "optional",
                        "type": "object",
                        "description": "Session privacy information.",
                        "example": "",
                        "schema": [
                          {
                            "name": "tor",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "Whether the session uses the Tor browser."
                          },
                          {
                            "name": "vpn",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "Whether the portal user is using a VPN."
                          },
                          {
                            "name": "proxy",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "Whether the session uses a proxy."
                          },
                          {
                            "name": "relay",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "Whether the session uses a relay."
                          },
                          {
                            "name": "hosting",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "Whether the session comes from a hosting provider."
                          },
                          {
                            "name": "service",
                            "kind": "optional",
                            "type": "string",
                            "description": "<p>Name of the privacy service used, for example a VPN or proxy service.</p>"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "updated_at",
                    "kind": "required",
                    "type": "string",
                    "description": "Date and time the activity record was last updated."
                  },
                  {
                    "name": "created_at",
                    "kind": "required",
                    "type": "string",
                    "description": "Date and time the activity record was created."
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized. The access token is missing, invalid or has expired.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "<p>Not Found. The requested resource does not exist, or is not available to your account.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              },
              {
                "name": "example_field",
                "kind": "optional",
                "type": "array",
                "description": "<p>Validation errors for one field of the request body. The property name is the name of the field that failed validation (<code>example_field</code> is a placeholder).</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "429",
        "description": "<p>Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the <code>Retry-After</code> header before trying again.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.detected.app/api/v2/public/portal-users/activity \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.detected.app/api/v2/public/portal-users/activity\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.detected.app/api/v2/public/portal-users/activity\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.detected.app/api/v2/public/portal-users/activity\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"data\": {\n    \"id\": 0,\n    \"type\": \"\",\n    \"user\": {\n      \"id\": 0,\n      \"name\": \"\",\n      \"email\": \"\"\n    },\n    \"ip\": \"\",\n    \"browser_agent\": \"\",\n    \"session_information\": {\n      \"city\": \"\",\n      \"region\": \"\",\n      \"country_code\": \"\",\n      \"latitude\": \"\",\n      \"longitude\": \"\",\n      \"time_zone\": \"\",\n      \"privacy_node\": {\n        \"tor\": false,\n        \"vpn\": false,\n        \"proxy\": false,\n        \"relay\": false,\n        \"hosting\": false,\n        \"service\": \"\"\n      }\n    },\n    \"updated_at\": \"\",\n    \"created_at\": \"\"\n  }\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Unauthorized. The access token is missing, invalid or has expired.\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Not Found. The requested resource does not exist, or is not available to your account.\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "response-3-422",
          "language": "422",
          "code": "// Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.\n{\n  \"message\": \"\",\n  \"example_field\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "response-4-429",
          "language": "429",
          "code": "// Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the Retry-After header before trying again.\n{\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}