> For the complete documentation index, see [llms.txt](https://detected.gitbook.io/detected-api-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-api-docs/api-reference/profiles/portal-users.md).

# Portal Users

Assign onboarding portal users to a profile. Once assigned, the user will be able to access the onboarding portal and complete the onboarding tasks for the profile. Portal users are created and managed in the Onboarding Portal Users section.

## Assign a portal user to a profile

> Assigns a portal user to a profile. Get the list of portal users with \*\*List portal users\*\* (\`GET /portal-users\`), or create a new portal user with \*\*Create a portal user\*\* (\`POST /portal-users\`).\
> \
> A portal user can have one of the following roles:\
> \
> \- \`admin\`: access to the main onboarding portal\
> \
> If you do not send a role, the \`admin\` role is assigned. By default an invitation email is sent. Set \`notify\` to \`false\` to skip it.

```json
{"openapi":"3.0.0","info":{"title":"Detected API","version":"v2"},"tags":[{"name":"Profile Portal Users","description":"Assign onboarding portal users to a profile. Once assigned, the user will be able to access the onboarding portal and complete the onboarding tasks for the profile. Portal users are created and managed in the Onboarding Portal Users section."}],"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 with **Create an access token** (`POST /oauth/token`), sending 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":{"profileUuid":{"name":"uuid","in":"path","description":"UUID of the profile.","required":true,"schema":{"type":"string","format":"uuid","nullable":false}}},"schemas":{"AssignProfileUserRequest":{"title":"Assign Profile User Request","required":["user_id"],"properties":{"user_id":{"description":"ID of the portal user to assign to the profile.","type":"integer","nullable":false},"role":{"description":"Role of the portal user on the profile. Currently only `admin` is supported, and it is the default.","type":"string","enum":["admin"],"nullable":false},"notify":{"description":"Whether to send the portal user an invitation email. The default is `true`.","type":"boolean","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"}}}},"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"},"error":{"description":"Machine-readable details of the error.","type":"object","properties":{"key":{"description":"Error code, for example `error.generic`.","type":"string"},"params":{"description":"Values used in the error message, if any.","type":"array","items":{}}}}},"type":"object"}}}},"422":{"description":"Unprocessable Content. The request was understood but failed validation. `errors` lists each field that failed and why.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"A human-readable description of the first error.","type":"string"},"errors":{"description":"Validation errors, keyed by the name of the field that failed. Each field has a list of messages.","type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}},"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":{"/profiles/{uuid}/portal-users":{"put":{"tags":["Profile Portal Users"],"summary":"Assign a portal user to a profile","description":"Assigns a portal user to a profile. Get the list of portal users with **List portal users** (`GET /portal-users`), or create a new portal user with **Create a portal user** (`POST /portal-users`).\n\nA portal user can have one of the following roles:\n\n- `admin`: access to the main onboarding portal\n\nIf you do not send a role, the `admin` role is assigned. By default an invitation email is sent. Set `notify` to `false` to skip it.","operationId":"14793a9807e457c91b346e65df09d9a0","parameters":[{"$ref":"#/components/parameters/profileUuid"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignProfileUserRequest"}}}},"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"},"422":{"$ref":"#/components/responses/422"},"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-api-docs/api-reference/profiles/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.
