> For the complete documentation index, see [llms.txt](https://detected.gitbook.io/detected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://detected.gitbook.io/detected-docs/portal-users.md).

# Portal Users

Users of the customer portal: create portal users, assign them to profiles, generate login links and review their activity.

## List portal user activity

> 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 \`profile\_id\`.\
> \
> The supported activity types (\`types\`) are:\
> \
> \- \`access\_log\`: login events, including IP address, location, browser and session information\
> \
> More activity types may be added in future.\
> \
> This endpoint is paginated. Use the \`page\` parameter to request further pages. The \`meta\` and \`links\` objects in the response describe the current page and link to the others.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Portal Users","description":"Users of the customer portal: create portal users, assign them to profiles, generate login links and review their activity."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token from `POST /oauth/token` with the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"parameters":{"order_by":{"name":"order_by","in":"query","description":"Direction to sort the results in: `asc` for ascending or `desc` for descending. Use it together with `sort_by`; it has no effect if `sort_by` is omitted. The default is `asc`.","schema":{"type":"string","enum":["desc","asc"]}},"page":{"name":"page","in":"query","description":"Page number of the results to return, starting from 1. The number of items per page is returned in `meta.per_page`.","schema":{"type":"integer","minimum":1}}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"schemas":{"ProfilePortalUserActivityResponse":{"title":"Profile Portal User Activity Resource","required":["id","type","ip","updated_at","created_at"],"properties":{"id":{"description":"Activity ID.","type":"number","nullable":false},"type":{"description":"Type of activity.","type":"string","enum":["access_log"],"nullable":false},"user":{"description":"The portal user the activity belongs to.","required":["id","email"],"properties":{"id":{"description":"Portal user ID.","type":"number","nullable":false},"name":{"description":"Name of the portal user.","type":"string","nullable":true},"email":{"description":"Email address of the portal user.","type":"string","nullable":false}},"type":"object","nullable":true},"ip":{"description":"User IP address.","type":"string","nullable":false},"browser_agent":{"description":"Browser user agent string.","type":"string","nullable":true},"session_information":{"description":"Portal user session information.","properties":{"city":{"description":"City the session was started from.","type":"string","nullable":true},"region":{"description":"Region the session was started from.","type":"string","nullable":true},"country_code":{"description":"Country the session was started from, ISO 3166-1 alpha-2 country code.","type":"string","nullable":true},"latitude":{"description":"Approximate latitude of the session location.","type":"string","nullable":true},"longitude":{"description":"Approximate longitude of the session location.","type":"string","nullable":true},"time_zone":{"description":"Time zone of the session location.","type":"string","nullable":true},"privacy_node":{"description":"Session privacy information.","properties":{"tor":{"description":"Whether the session uses the Tor browser.","type":"boolean","nullable":false},"vpn":{"description":"Whether the portal user is using a VPN.","type":"boolean","nullable":false},"proxy":{"description":"Whether the session uses a proxy.","type":"boolean","nullable":false},"relay":{"description":"Whether the session uses a relay.","type":"boolean","nullable":false},"hosting":{"description":"Whether the session comes from a hosting provider.","type":"boolean","nullable":false},"service":{"description":"Name of the privacy service used, for example a VPN or proxy service.","type":"string","nullable":true}},"type":"object","nullable":true}},"type":"object","nullable":true},"updated_at":{"description":"Date and time the activity record was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the activity record was created.","type":"string","nullable":false}},"type":"object"},"LinksResource":{"title":"Links Resource","properties":{"first":{"description":"URL of the first page of results.","type":"string","nullable":false},"last":{"description":"URL of the last page of results.","type":"string","nullable":false},"prev":{"description":"URL of the previous page of results, or null if there is none.","type":"string","nullable":false},"next":{"description":"URL of the next page of results, or null if there is none.","type":"string","nullable":false}},"type":"object"},"MetaResource":{"title":"Meta Resource","properties":{"current_page":{"description":"Number of the current page.","type":"number","nullable":false},"from":{"description":"Position of the first item on this page, counted across all pages.","type":"number","nullable":false},"last_page":{"description":"Number of the last page.","type":"number","nullable":false},"links":{"description":"Pagination links, including links to the previous and next pages.","type":"array","items":{"properties":{"url":{"description":"URL of the page, or `null` if there is no such page.","type":"string","nullable":false},"label":{"description":"Text to display for the link, for example a page number or \"Previous\".","type":"string","nullable":false},"active":{"description":"Whether this link is for the current page.","type":"boolean","nullable":false}},"type":"object"},"nullable":false},"path":{"description":"Base URL of the endpoint, without query parameters.","type":"string","nullable":false},"per_page":{"description":"Number of items per page.","type":"number","nullable":false},"to":{"description":"Position of the last item on this page, counted across all pages.","type":"number","nullable":false},"total":{"description":"Total number of items across all pages.","type":"number","nullable":false}},"type":"object"}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"404":{"description":"Not Found. The requested resource does not exist, or is not available to your account.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"422":{"description":"Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"},"example_field":{"description":"Validation errors for one field of the request body. The property name is the name of the field that failed validation (`example_field` is a placeholder).","type":"array","items":{"type":"string"}}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/portal-users/activity":{"get":{"tags":["Portal Users"],"summary":"List portal user activity","description":"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 `profile_id`.\n\nThe supported activity types (`types`) are:\n\n- `access_log`: login events, including IP address, location, browser and session information\n\nMore activity types may be added in future.\n\nThis endpoint is paginated. Use the `page` parameter to request further pages. The `meta` and `links` objects in the response describe the current page and link to the others.","operationId":"ecca5ca24afe66b27788e5d6cdbac052","parameters":[{"name":"id","in":"query","description":"ID of the portal activity.","required":false,"schema":{"type":"integer","nullable":false}},{"name":"user_id","in":"query","description":"Filter by portal user ID.","required":false,"schema":{"type":"integer","nullable":false}},{"name":"profile_id","in":"query","description":"Filter results by profile ID.","required":false,"schema":{"type":"string","format":"uuid","nullable":false}},{"name":"email","in":"query","description":"Filter by portal user email address.","required":false,"schema":{"type":"string","nullable":false}},{"name":"ip","in":"query","description":"Filter by IP address.","required":false,"schema":{"type":"string","nullable":false}},{"name":"types","in":"query","description":"Filter by activity type. Currently only `access_log` is supported.","required":false,"schema":{"type":"string","nullable":false}},{"name":"name","in":"query","description":"Filter by portal user name.","required":false,"schema":{"type":"string","nullable":false}},{"$ref":"#/components/parameters/order_by"},{"name":"sort_by","in":"query","description":"The field to sort the results by. Use it together with `order_by` to choose the direction; if `order_by` is omitted, results are sorted in ascending order (`asc`). If `sort_by` is omitted, results are returned in no guaranteed order.\n\nSupported fields:\n- `id`\n- `created_at`\n- `updated_at`\n","schema":{"type":"string"}},{"$ref":"#/components/parameters/page"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"properties":{"data":{"description":"The activity records for portal users.","type":"array","items":{"$ref":"#/components/schemas/ProfilePortalUserActivityResponse"}},"links":{"$ref":"#/components/schemas/LinksResource"},"meta":{"$ref":"#/components/schemas/MetaResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## List portal users

> Returns the portal users in your account. Use the query parameters to filter the results.\
> \
> This endpoint is paginated. Use the \`page\` parameter to request further pages. The \`meta\` and \`links\` objects in the response describe the current page and link to the others.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Portal Users","description":"Users of the customer portal: create portal users, assign them to profiles, generate login links and review their activity."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token from `POST /oauth/token` with the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"parameters":{"order_by":{"name":"order_by","in":"query","description":"Direction to sort the results in: `asc` for ascending or `desc` for descending. Use it together with `sort_by`; it has no effect if `sort_by` is omitted. The default is `asc`.","schema":{"type":"string","enum":["desc","asc"]}},"page":{"name":"page","in":"query","description":"Page number of the results to return, starting from 1. The number of items per page is returned in `meta.per_page`.","schema":{"type":"integer","minimum":1}}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"schemas":{"PortalUserViewResource":{"title":"Portal User View Resource","required":["id","email","updated_at","created_at"],"properties":{"id":{"description":"Portal user ID.","type":"integer","nullable":false},"name":{"description":"Name of the portal user.","type":"string","nullable":true},"email":{"description":"Email address of the portal user.","type":"string","nullable":false},"profiles":{"description":"Profiles the portal user is assigned to.","type":"array","items":{"required":["id","name","role"],"properties":{"id":{"description":"Profile ID.","type":"string","nullable":false},"name":{"description":"Name of the profile.","type":"string","nullable":false},"role":{"description":"Role of the portal user on the profile.","type":"string","enum":["admin","identity"],"nullable":false}},"type":"object"},"nullable":true},"updated_at":{"description":"Date and time the portal user was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the portal user was created.","type":"string","nullable":false}},"type":"object"},"LinksResource":{"title":"Links Resource","properties":{"first":{"description":"URL of the first page of results.","type":"string","nullable":false},"last":{"description":"URL of the last page of results.","type":"string","nullable":false},"prev":{"description":"URL of the previous page of results, or null if there is none.","type":"string","nullable":false},"next":{"description":"URL of the next page of results, or null if there is none.","type":"string","nullable":false}},"type":"object"},"MetaResource":{"title":"Meta Resource","properties":{"current_page":{"description":"Number of the current page.","type":"number","nullable":false},"from":{"description":"Position of the first item on this page, counted across all pages.","type":"number","nullable":false},"last_page":{"description":"Number of the last page.","type":"number","nullable":false},"links":{"description":"Pagination links, including links to the previous and next pages.","type":"array","items":{"properties":{"url":{"description":"URL of the page, or `null` if there is no such page.","type":"string","nullable":false},"label":{"description":"Text to display for the link, for example a page number or \"Previous\".","type":"string","nullable":false},"active":{"description":"Whether this link is for the current page.","type":"boolean","nullable":false}},"type":"object"},"nullable":false},"path":{"description":"Base URL of the endpoint, without query parameters.","type":"string","nullable":false},"per_page":{"description":"Number of items per page.","type":"number","nullable":false},"to":{"description":"Position of the last item on this page, counted across all pages.","type":"number","nullable":false},"total":{"description":"Total number of items across all pages.","type":"number","nullable":false}},"type":"object"}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/portal-users":{"get":{"tags":["Portal Users"],"summary":"List portal users","description":"Returns the portal users in your account. Use the query parameters to filter the results.\n\nThis endpoint is paginated. Use the `page` parameter to request further pages. The `meta` and `links` objects in the response describe the current page and link to the others.","operationId":"311f444bb9a31777ae784b6b72746514","parameters":[{"$ref":"#/components/parameters/order_by"},{"name":"sort_by","in":"query","description":"The field to sort the results by. Use it together with `order_by` to choose the direction; if `order_by` is omitted, results are sorted in ascending order (`asc`). If `sort_by` is omitted, results are returned in no guaranteed order.\n\nSupported fields:\n- `email`\n- `name`\n- `id`\n- `profile_id`\n","schema":{"type":"string"}},{"$ref":"#/components/parameters/page"},{"name":"id","in":"query","description":"Filter by portal user ID. If a match is found, only that portal user is returned.","schema":{"type":"integer"}},{"name":"name","in":"query","description":"Filter by portal user name.","schema":{"type":"string"}},{"name":"email","in":"query","description":"Filter by portal user email address.","schema":{"type":"string"}},{"name":"profile_id","in":"query","description":"Filter by the ID of a profile the portal user is assigned to.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"properties":{"data":{"description":"List of users","type":"array","items":{"$ref":"#/components/schemas/PortalUserViewResource"}},"links":{"$ref":"#/components/schemas/LinksResource"},"meta":{"$ref":"#/components/schemas/MetaResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Create a portal user

> Creates a portal user with the given email address. You can then assign the user to a profile with \`PUT /profiles/{uuid}/portal-users\`.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Portal Users","description":"Users of the customer portal: create portal users, assign them to profiles, generate login links and review their activity."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token from `POST /oauth/token` with the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"schemas":{"PortalUserCreateRequest":{"title":"Portal User Create Request","required":["email"],"properties":{"email":{"description":"Email address of the portal user.","type":"string","nullable":false}},"type":"object"},"PortalUserViewResource":{"title":"Portal User View Resource","required":["id","email","updated_at","created_at"],"properties":{"id":{"description":"Portal user ID.","type":"integer","nullable":false},"name":{"description":"Name of the portal user.","type":"string","nullable":true},"email":{"description":"Email address of the portal user.","type":"string","nullable":false},"profiles":{"description":"Profiles the portal user is assigned to.","type":"array","items":{"required":["id","name","role"],"properties":{"id":{"description":"Profile ID.","type":"string","nullable":false},"name":{"description":"Name of the profile.","type":"string","nullable":false},"role":{"description":"Role of the portal user on the profile.","type":"string","enum":["admin","identity"],"nullable":false}},"type":"object"},"nullable":true},"updated_at":{"description":"Date and time the portal user was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the portal user was created.","type":"string","nullable":false}},"type":"object"}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"422":{"description":"Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"},"example_field":{"description":"Validation errors for one field of the request body. The property name is the name of the field that failed validation (`example_field` is a placeholder).","type":"array","items":{"type":"string"}}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/portal-users":{"post":{"tags":["Portal Users"],"summary":"Create a portal user","description":"Creates a portal user with the given email address. You can then assign the user to a profile with `PUT /profiles/{uuid}/portal-users`.","operationId":"create-portal-user-endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalUserCreateRequest"}}}},"responses":{"201":{"description":"Created","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PortalUserViewResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Create a portal user login link

> Creates a login link for a portal user, for a specific profile. The portal user uses the link to sign in to the portal. Currently the only supported purpose is \`onboarding\`.\
> \
> The response includes the time at which the link expires (\`expires\_at\`).

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Portal Users","description":"Users of the customer portal: create portal users, assign them to profiles, generate login links and review their activity."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token from `POST /oauth/token` with the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"parameters":{"portalUserId":{"name":"userId","in":"path","description":"ID of the portal user named in the path.","required":true,"schema":{"type":"integer","nullable":false}}},"schemas":{"PortalUserLoginLinkCreateRequest":{"title":"Portal User Login Link Create Request","required":["profile_id","purpose"],"properties":{"profile_id":{"description":"ID of the profile the login link is for.","type":"string","nullable":false},"purpose":{"description":"Purpose of the login link. Currently only `onboarding` is supported.","type":"string","enum":["onboarding"],"nullable":false}},"type":"object"},"PortalUserLinkLoginResourceResponse":{"title":"Portal User Login Link Resource","required":["purpose","link","expires_at"],"properties":{"purpose":{"description":"Purpose the login link was created for.","type":"string","enum":["onboarding"],"nullable":false},"link":{"description":"URL the portal user uses to sign in.","type":"string","nullable":false},"expires_at":{"description":"Date and time at which the link expires.","type":"string","nullable":false}},"type":"object"}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"404":{"description":"Not Found. The requested resource does not exist, or is not available to your account.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/portal-users/{userId}/login-links":{"post":{"tags":["Portal Users"],"summary":"Create a portal user login link","description":"Creates a login link for a portal user, for a specific profile. The portal user uses the link to sign in to the portal. Currently the only supported purpose is `onboarding`.\n\nThe response includes the time at which the link expires (`expires_at`).","operationId":"2bdbe1931347e3112774fa366fc97cf1","parameters":[{"$ref":"#/components/parameters/portalUserId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalUserLoginLinkCreateRequest"}}}},"responses":{"201":{"description":"Created","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PortalUserLinkLoginResourceResponse"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```

## Retrieve a portal user

> Returns a single portal user, including the profiles they are assigned to and their role on each.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Portal Users","description":"Users of the customer portal: create portal users, assign them to profiles, generate login links and review their activity."}],"servers":[{"url":"https://api.detected.app/api/v2/public","description":"Production"}],"security":[{"AccessToken":[]}],"components":{"securitySchemes":{"AccessToken":{"type":"http","description":"The API uses OAuth 2.0. Request an access token from `POST /oauth/token` with the client ID and client secret of your integration client, and your account slug. Send the access token in the `Authorization` header of every request, in the format `Authorization: Bearer <access_token>`. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.","bearerFormat":"OAuth 2.0 access token","scheme":"bearer"}},"parameters":{"portalUserId":{"name":"userId","in":"path","description":"ID of the portal user named in the path.","required":true,"schema":{"type":"integer","nullable":false}}},"headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the rate limit window.","schema":{"type":"number","nullable":false}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate limit window.","schema":{"type":"number","nullable":false}},"Retry-After":{"description":"Number of seconds to wait before making another request. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}},"X-RateLimit-Reset":{"description":"Unix timestamp (in seconds) at which the rate limit resets. Returned when the rate limit has been reached.","schema":{"type":"number","nullable":false}}},"schemas":{"PortalUserViewResource":{"title":"Portal User View Resource","required":["id","email","updated_at","created_at"],"properties":{"id":{"description":"Portal user ID.","type":"integer","nullable":false},"name":{"description":"Name of the portal user.","type":"string","nullable":true},"email":{"description":"Email address of the portal user.","type":"string","nullable":false},"profiles":{"description":"Profiles the portal user is assigned to.","type":"array","items":{"required":["id","name","role"],"properties":{"id":{"description":"Profile ID.","type":"string","nullable":false},"name":{"description":"Name of the profile.","type":"string","nullable":false},"role":{"description":"Role of the portal user on the profile.","type":"string","enum":["admin","identity"],"nullable":false}},"type":"object"},"nullable":true},"updated_at":{"description":"Date and time the portal user was last updated.","type":"string","nullable":false},"created_at":{"description":"Date and time the portal user was created.","type":"string","nullable":false}},"type":"object"}},"responses":{"401":{"description":"Unauthorized. The access token is missing, invalid or has expired.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"404":{"description":"Not Found. The requested resource does not exist, or is not available to your account.","content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}},"429":{"description":"Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the `Retry-After` header before trying again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"Retry-After":{"$ref":"#/components/headers/Retry-After"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"properties":{"message":{"description":"A human-readable description of the error.","type":"string"}},"type":"object"}}}}}},"paths":{"/portal-users/{userId}":{"get":{"tags":["Portal Users"],"summary":"Retrieve a portal user","description":"Returns a single portal user, including the profiles they are assigned to and their role on each.","operationId":"get-portal-users-endpoint","parameters":[{"$ref":"#/components/parameters/portalUserId"}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/PortalUserViewResource"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://detected.gitbook.io/detected-docs/portal-users.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
