Skip to main content
GET
Get task status

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

taskId
string
required

Task identifier returned by register, run-security-agent or run-vision-agent (for example task_wf_683def5678901abcd1234abc). Opaque — pass it back verbatim, do not parse it.

Response

Current task state.

taskId
string
required

Opaque task identifier. Pass it back verbatim; do not parse it.

Example:

"task_wf_683def5678901abcd1234abc"

type
enum<string>
required

What kind of work this task represents.

Available options:
security-agent,
vision-agent,
registration
Example:

"security-agent"

appId
string
required
Example:

"683abc1234567890abcdef12"

state
enum<string>
required

Shared lifecycle vocabulary for every task. Never FAILED; reason and message on the task say why it is in its state. NEEDS_INPUT means the work has stopped and is waiting for something only you can supply — working test accounts, a credit top-up, a reachable app. A login pause is answered with POST /v1/apps/{appId}/account-setup, after which the task returns to RUNNING. Stop polling on it: nothing will change until you act. COMPLETED_PARTIAL means the work produced results but part of it did not run (reason says why). INTERRUPTED means the work stopped on our side before producing a result — deliberately not folded into COMPLETED, because "completed with zero findings" and "we do not know what it would have found" are different answers. CANCELLED means a user stopped the work before it finished. COMPLETED, COMPLETED_PARTIAL, INTERRUPTED and CANCELLED are terminal.

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

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
required

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
required
updatedAt
string<date-time> | null
required

Null if the task has not changed since it was created.

result
object
required

Type-specific detail; the shape follows type.