Run Account Setup
Supplies test-account credentials for an app that cannot sign itself up — one with no public sign-up page, or behind a CAPTCHA, SSO wall or invite-only flow. Onboarding pauses in that situation rather than degrading to an unauthenticated test; submitting credentials here resumes it. Uses the same tenantOneCredentials / tenantTwoCredentials shape as register. Poll the returned taskId.
curl --request POST \
--url https://api.perfai.ai/v1/apps/{appId}/account-setup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantOneCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
],
"tenantTwoCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
]
}
'import requests
url = "https://api.perfai.ai/v1/apps/{appId}/account-setup"
payload = {
"tenantOneCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
],
"tenantTwoCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantOneCredentials: [
{
role: '<string>',
username: '<string>',
password: '<string>',
loginUrl: '<string>'
}
],
tenantTwoCredentials: [
{
role: '<string>',
username: '<string>',
password: '<string>',
loginUrl: '<string>'
}
]
})
};
fetch('https://api.perfai.ai/v1/apps/{appId}/account-setup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perfai.ai/v1/apps/{appId}/account-setup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tenantOneCredentials' => [
[
'role' => '<string>',
'username' => '<string>',
'password' => '<string>',
'loginUrl' => '<string>'
]
],
'tenantTwoCredentials' => [
[
'role' => '<string>',
'username' => '<string>',
'password' => '<string>',
'loginUrl' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.perfai.ai/v1/apps/{appId}/account-setup"
payload := strings.NewReader("{\n \"tenantOneCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ],\n \"tenantTwoCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.perfai.ai/v1/apps/{appId}/account-setup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantOneCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ],\n \"tenantTwoCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perfai.ai/v1/apps/{appId}/account-setup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantOneCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ],\n \"tenantTwoCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"appId": "<string>",
"taskId": "task_reg_683abc1234567890abcdef12",
"accountsSaved": 2,
"onboardingResumed": true,
"statusUrl": "<string>"
}{
"type": "<string>",
"title": "<string>"
}{
"type": "<string>",
"title": "<string>"
}{
"type": "<string>",
"title": "<string>"
}{
"type": "<string>",
"title": "<string>"
}Authorizations
JWT login token tied to your Perfai user (not a separate API key). Obtain it via POST /api/v1/auth/token with your username and password (use the returned id_token) — the same login the web console performs. Carries org, user, and role; short-lived.
Path Parameters
MongoDB ObjectId of the app (from GET /apps or POST /apps).
Body
Credentials for the primary tenant, one entry per role. At least one is required — without a usable account the app cannot be tested authenticated.
1 - 20 elementsShow child attributes
Show child attributes
Credentials for a second tenant. Supply these to enable cross-tenant (BOLA) testing; without a second tenant those checks cannot run.
20Show child attributes
Show child attributes
Response
Credentials stored; onboarding resumed if it was waiting on them.
Registration task handle — poll GET /v1/tasks/{taskId}.
"task_reg_683abc1234567890abcdef12"
How many tenant credential sets were stored.
2
True when onboarding was paused waiting for these credentials and has now resumed. False means they are stored but nothing was waiting on them.
true
curl --request POST \
--url https://api.perfai.ai/v1/apps/{appId}/account-setup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantOneCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
],
"tenantTwoCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
]
}
'import requests
url = "https://api.perfai.ai/v1/apps/{appId}/account-setup"
payload = {
"tenantOneCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
],
"tenantTwoCredentials": [
{
"role": "<string>",
"username": "<string>",
"password": "<string>",
"loginUrl": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantOneCredentials: [
{
role: '<string>',
username: '<string>',
password: '<string>',
loginUrl: '<string>'
}
],
tenantTwoCredentials: [
{
role: '<string>',
username: '<string>',
password: '<string>',
loginUrl: '<string>'
}
]
})
};
fetch('https://api.perfai.ai/v1/apps/{appId}/account-setup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perfai.ai/v1/apps/{appId}/account-setup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tenantOneCredentials' => [
[
'role' => '<string>',
'username' => '<string>',
'password' => '<string>',
'loginUrl' => '<string>'
]
],
'tenantTwoCredentials' => [
[
'role' => '<string>',
'username' => '<string>',
'password' => '<string>',
'loginUrl' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.perfai.ai/v1/apps/{appId}/account-setup"
payload := strings.NewReader("{\n \"tenantOneCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ],\n \"tenantTwoCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.perfai.ai/v1/apps/{appId}/account-setup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantOneCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ],\n \"tenantTwoCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perfai.ai/v1/apps/{appId}/account-setup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantOneCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ],\n \"tenantTwoCredentials\": [\n {\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"loginUrl\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"appId": "<string>",
"taskId": "task_reg_683abc1234567890abcdef12",
"accountsSaved": 2,
"onboardingResumed": true,
"statusUrl": "<string>"
}{
"type": "<string>",
"title": "<string>"
}{
"type": "<string>",
"title": "<string>"
}{
"type": "<string>",
"title": "<string>"
}{
"type": "<string>",
"title": "<string>"
}
