---
title: "Compute Protect Trust Index scores and subscores"
method: POST
path: "/protect/compute"
tags: ["plaid"]
---

# Compute Protect Trust Index scores and subscores

`POST /protect/compute`

Compute a Protect Trust Index score for a user. The model selected determines what is scored and what additional fields the response contains. For example, `ti-link-session-2.0` scores a completed Link session for fraud risk; `cash-advance-onboarding-1.0` scores repayment risk for a first-time cash advance and additionally populates per-amount-bucket subscores. Cash-advance models require that the user have a Plaid Item with Transactions enabled, or an Assets Report, before scoring.

The endpoint returns HTTP 400 with `error_type` = `INVALID_REQUEST` and `error_code` = `FAILED_PRECONDITION` when a required precondition is not met: for link-session models, when the Link session has not completed; for cash-advance models, when the user has not successfully linked any Item.

## Request body

- ProtectComputeRequest — Request object for /protect/compute
  - `client_id` string — 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.
  - `secret` string — 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.
  - `model` string, required — The name of the Trust Index model to use for scoring, with a major.minor version suffix. Examples: `ti-link-session-2.0` (link-session fraud), `ti-identity-2.0` (identity fraud), `cash-advance-onboarding-1.0` (first cash advance), and `cash-advance-ongoing-1.0` (subsequent cash advances). The model specified may require certain fields within `model_inputs`; for example, `ti-link-session-2.0` requires the `link` field. Cash-advance models do not use `model_inputs`.
  - `user` ProtectUser, required — Represents an end user for `/protect/compute` requests.
    - `user_id` string — The Plaid User ID returned from a previous call to `/user/create`. This or `client_user_id` can be provided, not both.
    - `client_user_id` string — A unique ID representing the end user, previously passed to `/user/create`. Maximum of 128 characters. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`.
  - `model_inputs` ProtectModelInputs, nullable — 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.
    - `link` ProtectLinkModelInputs, nullable — Inputs for link session Trust Index models.
      - `link_session_id` string, required — A unique identifier for the Link session, used to compute a Trust Index score and fraud attributes.
      - `require_extracted_data` boolean — Controls whether transaction extraction must be complete before scoring. If `false` (default), returns a score whether or not transaction extraction is complete, as long as the link session is finished; if data has been extracted it will still be included in the score computation. If `true`, returns HTTP 400 with `error_type` = `INVALID_REQUEST` and `error_code` = `FAILED_PRECONDITION` if extraction is still in progress; once data is ready a score will be returned normally.
    - `sdk` ProtectSDKModelInputs, nullable — Inputs for Protect SDK Trust Index models.
      - `sdk_session_id` string, required — A unique identifier for the Protect SDK session, used to compute a Trust Index score and fraud attributes.

## Response `200`

OK

- ProtectComputeResponse — Response object for /protect/compute
  - `score` integer, nullable — The Trust Index score, on a 0-100 scale where higher values indicate lower risk.
  - `model` string — The versioned name of the Trust Index model used for scoring.
  - `attributes` FraudAttributes, nullable — Event fraud attributes as an arbitrary set of key-value pairs. The set of attributes returned varies by model.
  - `subscores` ProtectComputeSubscores, nullable — 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.
    - `cash_advance_bucket_0_25` integer, nullable — Subscore for cash advance amounts in the range $0-$25.
    - `cash_advance_bucket_25_50` integer, nullable — Subscore for cash advance amounts in the range $25-$50.
    - `cash_advance_bucket_50_100` integer, nullable — Subscore for cash advance amounts in the range $50-$100.
    - `cash_advance_bucket_100_200` integer, nullable — Subscore for cash advance amounts in the range $100-$200.
    - `cash_advance_bucket_200_300` integer, nullable — Subscore for cash advance amounts in the range $200-$300.
    - `cash_advance_bucket_300_400` integer, nullable — Subscore for cash advance amounts in the range $300-$400.
    - `cash_advance_bucket_400_500` integer, nullable — Subscore for cash advance amounts in the range $400-$500.
  - `timestamp` string, date-time, nullable — 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_id` string, required — A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

---

[API](https://skmtc.net/plaid/apis/the-plaid-api.md) · [All operations](https://skmtc.net/plaid/apis/the-plaid-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/plaid/the-plaid-api/versions/64c4514ea59b/schema)
