Create a portal user
1 min
POST
https://api.detected.app/api/v2/public/portal-users
Body Parameters
- bodyPortalUserCreateRequest
- emailstringrequiredDescription
Responses
201
- object
- dataPortalUserViewResource
- idintegerrequiredDescription
- namestringDescription
- emailstringrequiredDescription
- profilesobject[]Description
- idstringrequiredDescription
- namestringrequiredDescription
- rolestring<admin | identity>requiredDescriptionAllowedadminidentity
- updated_atstringrequiredDescription
- created_atstringrequiredDescription
Response Headers
- X-RateLimit-Limit
- X-RateLimit-Remaining
401
- object
- messagestringDescription
422
- object
- messagestringDescription
- example_fieldstring[]Description
429
- object
- messagestringDescription
curl
curl --request POST \
--url https://api.detected.app/api/v2/public/portal-users \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"email": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"email": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.detected.app/api/v2/public/portal-users", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.detected.app/api/v2/public/portal-users")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"email": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.detected.app/api/v2/public/portal-users"
payload = json.dumps({
"email": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// Created
{
"data": {
"id": 0,
"name": "",
"email": "",
"profiles": [
{
"id": "",
"name": "",
"role": ""
}
],
"updated_at": "",
"created_at": ""
}
}401
// Unauthorized. The access token is missing, invalid or has expired.
{
"message": ""
}422
// Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.
{
"message": "",
"example_field": [
""
]
}429
// Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the Retry-After header before trying again.
{
"message": ""
}