# Set up your own trust score

> Build a 0-100 score from your own records, save it per account or in bulk, and keep it in step.

activQC can work out a trust score for each uploading account from what it has seen: releases accepted, rejected and
reviewed (see [Account trust](https://activqc.wavbee.com/docs/account-trust.md)). You know much more about your own accounts than that: how old
they are, whether you have checked who they are, and whether the stores have ever taken their music down. This page shows
how to turn what you know into a score from 0 to 100 and give it to activQC.

## 1. Pick how you send it

You have three ways to do it. You can mix them.

| Way | How | Use it when |
|---|---|---|
| Let activQC work it out | Send only `account.id` with each release | You have no data of your own yet. |
| Save a score per account | `PUT /v1/accounts/{id}` or `POST /v1/accounts/batch` | Your score changes now and then (most tenants). |
| Send it on each release | `account.trust_score` on `POST /v1/qc/runs` | You work the score out at the moment of upload. |

Which score is used, first to last:

1. A pin set by WAVBEE staff.
2. The `trust_score` sent with the release.
3. The score you saved, until it expires.
4. activQC's own score from the account's history.

Your saved score takes the place of activQC's own score; the two are not mixed. To combine them, read
`computed_score` from `GET /v1/accounts/{id}`, blend it into your score, and save the result.

## 2. Use a stable account id

`account.id` is your own id for the uploading account: the one that holds the payout and signs the agreement, not the
artist name on the release. One label account can release many artists.

- Use your database's primary key or a stable public id, such as `acct_8812`. Avoid email addresses and phone numbers.
  activQC needs nothing personal to match accounts.
- Use the same id on every release, every draft and every saved score.
- Your test keys and your live keys see separate accounts. Save scores with the same kind of key you upload with.

## 3. Decide what goes into the score

Start every account at 50, then add and take away points. Use only facts about how the account behaves and what it has
shown you. Never use its country, language, genre or anything else about who the artist is. A score built on those
would hold back artists for who they are, not for what they did.

Good signals, from strongest to weakest:

| Signal | Suggested points |
|---|---|
| A store took a release down for rights (a takedown or a strike) | -30 each |
| An upheld copyright claim on YouTube, Facebook or another fingerprint service | -15 each |
| Artificial streams flagged by a store | -25 |
| A chargeback or payment fraud | -20 |
| Identity checked (KYC), with a payout account in the same name | +15 |
| The account is more than a year old with no strikes | +10 |
| 10 or more releases live at the stores with no complaint | +10 |
| A known label or a contract signed with you | +15 |
| Many releases uploaded in a short time, far more than usual | -10 |
| A new account, under 30 days old | -10 |

Keep the result between 0 and 100. The bands decide what each score does. By default:

| Your score | What activQC does with a clean release |
|---|---|
| 90 and up | It goes out at once. |
| 40 to 89 | It goes out, unless it shows a faint match or an AI signal; then a person checks it. |
| Below 40 | A person always checks it. |

You can move both lines on the **Accounts** page of your console. So set the score to mean what you believe: put an
account you would let release without a check at 90 or above. Put one you would always check by hand below 40.

Keep your own note of why each account has its score. activQC keeps the number, not your reasons. When an artist or a
store asks why a release was held, the answer comes from your records.

## 4. Save the scores

One account, when something about it changes (it passes KYC, or a store sends a strike):

```bash
curl -s -X PUT "$ACTIVQC_BASE_URL/v1/accounts/acct_8812" \
  -H "Authorization: Bearer $ACTIVQC_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "trust_score": 92, "name": "Kayal Beats" }'
```

Many accounts, for a nightly sync of every account that changed since the last one (at most 500 per call):

```bash
curl -s -X POST "$ACTIVQC_BASE_URL/v1/accounts/batch" \
  -H "Authorization: Bearer $ACTIVQC_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "accounts": [
        { "id": "acct_8812", "trust_score": 92 },
        { "id": "acct_9001", "trust_score": 25, "expires_at": "2026-12-31T00:00:00Z" },
        { "id": "acct_7710", "trust_score": null }
      ] }'
```

| Field | What it is |
|---|---|
| `trust_score` | Required. A whole number from 0 to 100, or `null` to clear your score and use activQC's own again. |
| `name` | Optional. A label for your console. |
| `expires_at` | Optional. An ISO 8601 time in the future. After it, your score stops counting. |

Both calls answer with the account as `GET /v1/accounts/{id}` shows it, so you can check `score`, `band` and
`source` (`saved` while your score counts). An account activQC has not seen yet is made. A batch is checked as a whole
first: if one entry is wrong, nothing is saved, and the error names the entry, such as `accounts[3].trust_score`.

Use `expires_at` for a score that should not last, such as a strict score for a new account's first 30 days. When it runs
out, the account falls back to activQC's own score, which by then has a history to go on.

Saving the same score twice is harmless, so a sync job can simply be run again after a failure.

## 5. A sync job, in outline

```python
# Every night: re-score the accounts that changed, and send them 500 at a time.
rows = db.query("""
  SELECT id, created_at, kyc_verified, takedowns, upheld_claims, chargebacks, live_releases
  FROM accounts WHERE updated_at > %s
""", last_sync)

def score(a):
    s = 50
    s -= 30 * a.takedowns + 15 * a.upheld_claims + 20 * a.chargebacks
    s += 15 if a.kyc_verified else 0
    s += 10 if a.age_days > 365 and a.takedowns == 0 else 0
    s += 10 if a.live_releases >= 10 else 0
    s -= 10 if a.age_days < 30 else 0
    return max(0, min(100, s))

for chunk in chunks(rows, 500):
    post("/v1/accounts/batch", {"accounts": [{"id": a.id, "trust_score": score(a)} for a in chunk]})
```

Run it with a sandbox key against test accounts first. Then send a test release for an account under 40, and check
that the run comes back `manual_review` with `trust.source` `saved`.

## 6. Who can change what

- **Your servers** save scores with an API key. Keep that key on your servers, never in a browser.
- **People in your console** can save scores through the API only if they have the "Change the QC rules" permission.
  The same permission moves the bands on the Accounts page.
- **WAVBEE staff** can pin a score or a band for an account. A pin always wins, and you see `override_active: true`.
  Staff keep their reasons to themselves.
- **The artist** never sees a score, a band or a reason, and nothing an artist sends can set one.

## 7. With an AI coding agent

Give your agent this page, [Account trust](https://activqc.wavbee.com/docs/account-trust.md) and the
[API reference](https://activqc.wavbee.com/docs/api-reference.md), then ask:

> Add a nightly job that scores our uploading accounts from 0 to 100 as in /docs/trust-score-setup (start at 50; use
> takedowns, upheld claims, chargebacks, KYC, age and live releases; never country, language or genre). Send only the
> accounts that changed since the last run, 500 at a time, to POST /v1/accounts/batch with our server key. Log each
> account's score and why, and add a test that runs it against a sandbox key.
