> ## Documentation Index
> Fetch the complete documentation index at: https://docs.range.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Versioning and Compatibility

> The rules that keep v3 responses compatible, and how to write a client that keeps working as Range adds to them.

The v3 response format is versioned by `contract_version`, today `3.0.0`. Within version 3, Range only adds to the format. It never removes a field, renames one, or changes what one means. A change that would break a client gets a new major version and a new path.

Adding to the format is not breaking, so your client must be ready for it. Follow the rules below and it keeps working as v3 grows.

## The rules

**1. Lists of values are open**

Every list of values in a response can grow: `severity`, `data_state`, `status`, `outcome`, `provider`, `delegated`, entity categories, error `code`s and the others. Accept a value you do not know. Never reject the response because of one. Treat an unknown value as "needs review", not as clean.

The API reference marks these lists with `x-extensible-enum`. If you generate a client from the OpenAPI file, make sure it does not turn them into closed enums that fail on a new value.

**2. Every field is always there**

A field is never left out of a response. When a value is not given, the field is `null` (for example `score` or `sanctioned`). `severity` is never `null`: `"unknown"` means no risk tier was given, which is not the same as `none`.

**3. Find results by id, not by position**

Results point at each other by `id`. Use `routing.served_result_id` and `decision.result_ids` to find a result in `results[]`. Do not assume the answer is `results[0]` or the last result, and do not assume how many results there are.

**4. A field's meaning never changes**

Once published, a field keeps its meaning. A new rule arrives as a new field or a new value. For example, `decision.basis` `served` means the decision is the verdict of the one result that answered. When Range also checks its own sanctions lists beside another provider's answer, the decision uses a new value, `served-with-range-lists`, instead of changing what `served` means. A future way of combining several providers would get another new value.

**5. Provider data lives only in results**

What a provider said is only in `results[]`: its verdict, attribution, sanctions listings, exposures, signals and totals. The top level holds the address, your request, the routing and the decision.

**6. Recorded screens never change**

A screen is recorded once, as it was served, and never edited. A correction, a completed pending answer, or a new screen of the same address is a new screen with its own `screen_id`. `previous_screen_id` is reserved for linking a screen to one it replaces, and is always `null` today.

**7. Versions are per result**

`mapping_version` on each result names the table Range used to map that provider's answer into this format. `taxonomy_version` names the version of the category list used for `entity.category`. Either can change without a new `contract_version`.

**8. Prices are not part of the format**

Credit prices can change. `credits_charged` on each result and `meta.credits_charged` report what was actually charged. Read them instead of hard-coding a price. See [Credits](https://docs.range.org/risk-api/risk-v3/credits.md).

## What else to expect

* **New fields.** New fields can appear on any object. Ignore fields you do not use.
* **Deprecated fields keep working.** `screening_provider` on the config endpoints is deprecated in favor of `provider_order`, and is still accepted and returned.
* **Warnings.** `results[].warnings` are fixed strings. Match them as whole strings, and expect new ones.
* **Error messages.** Branch on the error `code`, never on `message`. See [Errors](https://docs.range.org/risk-api/risk-v3/errors.md).
* **Several providers at once.** A screen with several [`providers`](https://docs.range.org/risk-api/risk-v3/screen-address#several-providers-in-one-screen) returns every answer in `results[]` with `decision: null`, because Range does not merge verdicts. A way to combine them may come later as an opt-in with its own `decision.basis`; without it, `decision` stays `null`. Code that reads `decision` must handle `null`.

## Reading recorded screens

[Get a Recorded Screen](https://docs.range.org/risk-api/risk-v3/get-screen.md) returns a body in the shape of the `contract_version` it was served under. Read `result.contract_version` first, and parse by its major version. A future major version will not be read correctly by a client written for `3.x`.

```javascript JavaScript theme={null}
const major = Number(record.result.contract_version.split(".")[0]);
if (major === 3) {
  handleV3(record.result);
} else {
  // A body from another major version: do not parse it as v3.
  flagForReview(record);
}
```

```python Python theme={null}
major = int(record["result"]["contract_version"].split(".")[0])
if major == 3:
    handle_v3(record["result"])
else:
    # A body from another major version: do not parse it as v3.
    flag_for_review(record)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.