Skip to main content
POST
Run Security Agent

Authorizations

Authorization
string
header
required

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

appId
string
required

MongoDB ObjectId of the app (from GET /apps or POST /apps).

Body

application/json

No request body — it runs all available test categories for the app identified by the appId path segment.

Response

Run scheduled.

taskId
string
appId
string
state
enum<string>

Same vocabulary as TaskState. Never FAILED.

Available options:
QUEUED,
RUNNING,
NEEDS_INPUT,
COMPLETED,
COMPLETED_PARTIAL,
INTERRUPTED,
CANCELLED
reason
enum<string> | null

Why a task or app is in its state. Null when the state needs no explanation. New values may be added; show message for any you do not recognise.

Available options:
needs_login,
needs_roles,
needs_access,
needs_app_url,
needs_spec,
app_unreachable,
out_of_credits,
no_response,
paused,
partial_coverage,
our_side_error,
dependency_lost,
null
message
string

One sentence for the user — the same wording the console shows for this state.

Example:

"We hit a snag — we're on it. Your results so far are saved."

createdAt
string<date-time> | null
updatedAt
string<date-time> | null
statusUrl
string
runNumber
integer

Monotonically increasing counter per app (status endpoint only).