# Retrieve the calibration (/docs/api-reference/risk/get-risk-calibration)

How often each reason and rule was right over the last 90 days, by the outcomes you reported with feedback, and the reason weights that supports. Nothing changes until you apply them with `reason_weights` in the settings.

`GET https://api.coss.com/v1/risk/calibration`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.risk.calibration();
```

HTTP:

```sh
curl -X GET "https://api.coss.com/v1/risk/calibration" \
  -H "Authorization: Bearer $COSS_API_KEY"
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.risk.calibration()
```

Go:

```go
import (
	"context"

	cossclient "github.com/cosscom/coss-go/client"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

client.Risk.Calibration(
    context.TODO(),
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.risk.calibration
```

PHP:

```php
<?php

use Coss\Coss;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->risk->calibration();
```

Java:

```java
import com.coss.Coss;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.risk().calibration();
```

.NET:

```csharp
using Coss;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.Risk.CalibrationAsync();
```

## Response 200

The calibration.

- `object` ("risk_calibration", required)
- `window_days` (integer, required): How many days back it looks.
- `assessments` (integer, required): Assessments in the window.
- `labeled` (integer, required): Of those, with feedback.
- `reasons` (object[], required): How each reason did against your feedback.
  - `code` (string, required, one of "email.invalid", "email.disposable", "email.undeliverable", "email.role_account", "email.typo", "email.domain_new", "ip.tor", "ip.vpn_network", "ip.hosting_provider", "ip.vpn", "ip.proxy", "ip.relay", "ip.private", "velocity.signups_per_ip_1h", "velocity.signups_per_ip_24h", "velocity.signups_per_subnet_1h", "velocity.signups_per_email_domain_1h", "velocity.signups_per_mailbox_24h", "velocity.signups_per_device_24h", "velocity.checkouts_per_ip_1h", "velocity.checkouts_per_user_1h", "velocity.checkouts_per_card_24h", "velocity.logins_per_ip_1h", "velocity.logins_per_user_1h", "velocity.events_per_ip_1h", "velocity.events_per_user_1h", "duplicate.canonical_mailbox", "duplicate.device", "history.fraud_mailbox", "history.fraud_user", "history.fraud_ip", "history.fraud_subnet", "history.fraud_card", "history.fraud_device", "checkout.card_country_mismatch", "checkout.billing_country_mismatch", "checkout.prepaid_card", "device.automation", "device.invalid", "login.new_country", "login.new_network", "captcha.failed", "captcha.missing", "content.spam", "content.phishing", "content.malware", "content.fraud"): The reason's code.
  - `fired` (integer, required): Assessments it fired in.
  - `fraud` (integer, required): With feedback `fraud` or `abuse`.
  - `legitimate` (integer, required): With feedback `legitimate`.
  - `precision` (number | null, required): `fraud / (fraud + legitimate)`: how often it was right when you told coss.com. `null` without feedback.
  - `default_weight` (number, required): Its weight unless this environment changes it.
  - `weight` (number, required): Its weight in this environment now.
  - `suggested_weight` (number | null, required): The weight feedback supports: its precision, pulled toward the default while there is little feedback. `null` below 20 assessments with feedback.
- `rules` (object[], required): How each rule did against your feedback.
  - `rule` (string, required): The rule's id.
  - `name` (string, required): The rule's name.
  - `matched` (integer, required): Assessments it decided.
  - `fraud` (integer, required): With feedback `fraud` or `abuse`.
  - `legitimate` (integer, required): With feedback `legitimate`.
  - `precision` (number | null, required): `fraud / (fraud + legitimate)`: how often it was right when you told coss.com. `null` without feedback.

Example:

```json
{
  "object": "risk_calibration",
  "window_days": 90,
  "assessments": 1840,
  "labeled": 212,
  "reasons": [
    {
      "code": "ip.hosting_provider",
      "fired": 96,
      "fraud": 4,
      "legitimate": 38,
      "precision": 0.095,
      "default_weight": 0.25,
      "weight": 0.25,
      "suggested_weight": 0.16
    }
  ],
  "rules": [
    {
      "rule": "rskrule_01k7c8m4q2f3e9v6t5r1n0p8yz",
      "name": "Disposable email from a data center",
      "matched": 31,
      "fraud": 12,
      "legitimate": 1,
      "precision": 0.923
    }
  ]
}
```

## Errors

- `400`: The `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).