Sample - Plaid API
POST/protect/compute

Compute Protect Trust Index scores

Computes a Protect Trust Index score and related fraud attributes for a user. Provide model and a user identifier, and include model_inputs when the selected model requires link-session or device data. Cash-advance models require the user to have a successfully linked Item with Transactions enabled or an Assets Report before scoring.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

5 body fields

Request object specifying the Trust Index model, user, and any model-specific inputs.

client_idstringoptional
Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.
secretstringoptional
Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.
modelstringrequired
The name of the Trust Index model to use for scoring, with a major.minor version suffix. Examples: `ti-link-session-3` (link-session fraud), `ti-identity-3` (identity fraud), `cash-advance-onboarding-<client>-1.0` (first cash advance), and `cash-advance-ongoing-<client>-1.0` (subsequent cash advances). Cash-advance models are client-scoped; use the model name issued for your client. The model specified may require certain fields within `model_inputs`; for example, `ti-link-session-2` requires the `link` field. Cash-advance models do not use `model_inputs`.
userobjectrequired
Represents an end user for `/protect/compute` requests.
model_inputsobjectoptional
Inputs required by certain Trust Index models. The `link` field is required for link-session models. Other model families (including cash-advance) are identified by `user` alone and do not use this object.

1 status code
200Returns the Trust Index score when available, the model used, model-specific fraud attributes and subscores, computation timestamp, and request identifier.
scoreintegeroptional
The Trust Index score, on a 0-100 scale where higher values indicate lower risk.
modelstringoptional
The versioned name of the Trust Index model used for scoring.
attributesobjectoptional
Event fraud attributes as an arbitrary set of key-value pairs. The set of attributes returned varies by model.
subscoresobjectoptional
Per-bucket subscores returned alongside the overall Trust Index score. For cash-advance models, each key maps to an amount-bucket subscore (0-100); higher values indicate lower fraud risk. Only buckets that were scored are included in the response.
timestampstringoptional
The timestamp when the Trust Index score and fraud attributes were computed, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format, e.g. `"2017-09-14T14:42:19.350Z"`
request_idstringrequired
A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Error handling

model and user are required, and model must not exceed 128 characters. Provide either user.user_id or user.client_user_id, but not both; link-session models require model_inputs.link.link_session_id, and device models require model_inputs.device.device_session_id.