Skip to main content
Set the insurance data a sandbox verification returns. An insurance scenario pairs a login with the policies you want back, each with drivers, vehicles, and policy documents, and serves them when the user signs in to a carrier in Truv Bridge with that login. Use it when Truv’s built-in carrier logins don’t cover the case you need: a policy that expires next week, two vehicles with different coverage, a renters policy next to an auto policy, or a declarations page PDF with your own numbers. For the shared concepts, read Custom Sandbox Data first.

Create a scenario [Server-side]

Truv’s built-in carrier logins goodlogin and error.user are reserved, whatever the password, and the API refuses them with reserved_credential. Use a distinctive username prefix, such as acme..
This request creates a scenario with one active auto policy, one driver, and one vehicle:
Always send "data_source": "insurance". username and password are supported on payroll, financial accounts, and insurance, so Truv can’t infer the data source from them and refuses the request with data_source_required.

Use it in Bridge

Start a sandbox verification with product_type: insurance. In Truv Bridge, pick any insurance carrier and sign in with acme.auto / s4ndb0x. The task completes with your policies instead of Truv’s built-in test data, and the carrier on every policy is the one the user picked. Read the result from the task webhooks and the insurance report. The scenario above sets no provider_id, so every carrier works. A scenario that sets a carrier’s provider_id answers only connections through that carrier.

Matching fields

products can only be insurance, so leave it empty.

Behavior

An insurance scenario accepts every behavior_status, and each ends the task with that status except not_supported, which ends it with unavailable. behavior_mfa is replayed at login, and a response that doesn’t match a challenge’s answer or answers ends the task with mfa_error. See Behavior for the fields.

How policies are served

  • The carrier comes from the connection. carrier_name and insurance_provider_name are not part of the payload; the policy carries whichever carrier the user picked. One scenario works for every carrier.
  • Ids are stable. Policies, drivers, vehicles, documents, and addresses get ids derived from their position in the payload, so a refresh updates the same records. A carrier_policy_number you leave out is derived from the policy’s id and stays the same across runs.
  • The policyholder is the first named driver. The identity on the report takes its name, and date of birth, from the first driver with both a first and last name. A driver listed on several policies is served once.
  • Documents must be PDFs. A policy document names a document library entry; one that names no entry, or a non-PDF one, is dropped when the task is served. date_added defaults to the policy’s effective_date.
  • Vehicles pass through. vehicles are free-form objects served as authored, so you can supply every field the report renders.

Payload reference

The payload object contains account_email, an addresses array, and a policies array. Every field is optional unless noted: send only what your test needs, and leave the rest out.
Free-form objects. The insurance report renders these keys:

Examples

Each example is a request body for POST /v1/sandbox/scenarios/ and creates a new scenario. Send it with the same curl command as the first scenario.

Auto policy with two vehicles and coverages

Give each vehicle its own coverages to test how your integration renders limits and deductibles per vehicle.

Homeowners and umbrella

Return more than one policy by adding entries to policies. Up to 10 fit in one scenario.

Expired policy

Set status and the dates to author a lapse.

No policies

An account that signs in but holds nothing. Send an empty policies list: the login succeeds, and the task ends with no_data, as it does for a real carrier account with no policies.

Failing login

A failure status needs no payload. Use it to exercise the error paths in your integration.

MFA challenge

behavior_mfa.challenges replays one screen per entry, in order.

Attach policy PDFs

A policy document is served from a document library entry. Upload the PDF once, then reference its id from the document.
The response is the library entry, abbreviated here; the scenario below references its id as the document’s document_id.
Then put that id on the document. Abbreviated: the policy carries whatever other data your test needs.

Limits

These are the default limits for insurance payloads. The account-wide limits are listed on Custom Sandbox Data.

Next steps

Insurance report

The report your policies are rendered into

Test Credentials

Truv’s built-in logins and the universal MFA and error scenarios

Data refresh

How refreshes reach your is_refresh scenarios

Sandbox API reference

Full request and response schemas for every sandbox endpoint