WorkOS PHP SDK

Radar
in package

Table of Contents

Properties

$client  : HttpClient

Methods

__construct()  : mixed
addListEntry()  : RadarListEntryAlreadyPresentResponse
Add an entry to a Radar list
createAttempt()  : RadarStandaloneResponse
Create an attempt
removeListEntry()  : void
Remove an entry from a Radar list
updateAttempt()  : mixed
Update a Radar attempt

Properties

Methods

addListEntry()

Add an entry to a Radar list

public addListEntry(RadarType $type, RadarAction $action, string $entry[, RequestOptions|null $options = null ]) : RadarListEntryAlreadyPresentResponse

Add an entry to a Radar list.

Parameters
$type : RadarType

The type of the Radar list (e.g. ip_address, domain, email).

$action : RadarAction

The list action indicating whether to add the entry to the allow or block list.

$entry : string

The value to add to the list. Must match the format of the list type (e.g. a valid IP address for ip_address, a valid email for email).

$options : RequestOptions|null = null
Tags
throws
WorkOSException
Return values
RadarListEntryAlreadyPresentResponse

createAttempt()

Create an attempt

public createAttempt(string $ipAddress, string $userAgent, string $email, RadarStandaloneAssessRequestAuthMethod $authMethod, RadarStandaloneAssessRequestAction $action[, string|null $deviceFingerprint = null ][, string|null $botScore = null ][, RequestOptions|null $options = null ]) : RadarStandaloneResponse

Assess a request for risk using the Radar engine and receive a verdict.

Parameters
$ipAddress : string

The IP address of the request to assess.

$userAgent : string

The user agent string of the request to assess.

$email : string

The email address of the user making the request.

$authMethod : RadarStandaloneAssessRequestAuthMethod

The authentication method being used.

$action : RadarStandaloneAssessRequestAction

The action being performed.

$deviceFingerprint : string|null = null

An optional device fingerprint for the request.

$botScore : string|null = null

An optional bot detection score for the request.

$options : RequestOptions|null = null
Tags
throws
WorkOSException
Return values
RadarStandaloneResponse

removeListEntry()

Remove an entry from a Radar list

public removeListEntry(RadarType $type, RadarAction $action, string $entry[, RequestOptions|null $options = null ]) : void

Remove an entry from a Radar list.

Parameters
$type : RadarType

The type of the Radar list (e.g. ip_address, domain, email).

$action : RadarAction

The list action indicating whether to remove the entry from the allow or block list.

$entry : string

The value to remove from the list. Must match an existing entry.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

updateAttempt()

Update a Radar attempt

public updateAttempt(string $id[, string|null $challengeStatus = null ][, string|null $attemptStatus = null ][, RequestOptions|null $options = null ]) : mixed

You may optionally inform Radar that an authentication attempt or challenge was successful using this endpoint. Some Radar controls depend on tracking recent successful attempts, such as impossible travel.

Parameters
$id : string

The unique identifier of the Radar attempt to update.

$challengeStatus : string|null = null

Set to "success" to mark the challenge as completed.

$attemptStatus : string|null = null

Set to "success" to mark the authentication attempt as successful.

$options : RequestOptions|null = null
Tags
throws
WorkOSException

        
On this page

Search results