# Accounts

The Accounts endpoints.

Paths start at `$ACTIVQC_BASE_URL`, and every call sends `Authorization: Bearer $ACTIVQC_KEY`. Errors use the [error envelope](https://activqc.wavbee.com/docs/errors.md). [All endpoints](https://activqc.wavbee.com/docs/api-reference.md).

## GET /v1/accounts/{id}

Fetch an uploading account's trust.

The trust a release sent now (without a `trust_score`) would be decided with, its band and where it comes from, the history behind it, and whether WAVBEE staff have pinned it. A test key reads test accounts and a live key live ones.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string | **Required.** Your own account id, as sent in `account.id` (URL-encoded). |

#### Example request

```bash
curl -s "$ACTIVQC_BASE_URL/v1/accounts/{id}" \
  -H "Authorization: Bearer $ACTIVQC_KEY"
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | Found. |
| `404` | Unknown, another tenant's, or the other mode's. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `object` | string | **Required.** Always `account`. |
| `id` | string | **Required.** Example `artist-8812`. |
| `name` | string or null |  |
| `livemode` | boolean |  |
| `score` | integer | **Required.** The score a release sent now without a trust_score would be decided with. |
| `band` | string | **Required.** One of `low`, `medium`, `high`. |
| `source` | string | **Required.** override: pinned by WAVBEE staff; saved: the score you saved with PUT /v1/accounts/{id}; computed: from the account's history. One of `override`, `saved`, `computed`. |
| `computed_score` | integer | **Required.** |
| `tenant_score` | integer or null | The last trust_score you sent, for reference. |
| `tenant_score_at` | string (date-time) or null |  |
| `saved_score` | integer or null | The score you saved for this account from your own records. |
| `saved_score_at` | string (date-time) or null |  |
| `saved_score_expires_at` | string (date-time) or null |  |
| `saved_score_active` | boolean | The saved score is set and has not expired. |
| `override_active` | boolean | **Required.** WAVBEE staff have pinned this account's score or band. |
| `override_expires_at` | string (date-time) or null |  |
| `reasons` | array of string |  |
| `bands` | object | **Required.** |
| `bands.low_below` | integer |  |
| `bands.high_at` | integer |  |
| `counts` | object | **Required.** |
| `counts.runs` | integer |  |
| `counts.accepted` | integer |  |
| `counts.rejected` | integer |  |
| `counts.manual_reviews` | integer |  |
| `counts.reviews_upheld` | integer |  |
| `counts.reviews_cleared` | integer |  |
| `counts.match_warnings` | integer |  |
| `counts.ai_warnings` | integer |  |
| `first_seen_at` | string (date-time) | **Required.** |
| `last_seen_at` | string (date-time) | **Required.** |

```json
{
  "object": "account",
  "id": "artist-8812",
  "name": "string",
  "livemode": false,
  "score": 1,
  "band": "low",
  "source": "override",
  "computed_score": 1,
  "tenant_score": 1,
  "tenant_score_at": "2026-11-24T10:00:00Z",
  "saved_score": 1,
  "saved_score_at": "2026-11-24T10:00:00Z",
  "saved_score_expires_at": "2026-11-24T10:00:00Z",
  "saved_score_active": false,
  "override_active": false,
  "override_expires_at": "2026-11-24T10:00:00Z",
  "reasons": [
    "string"
  ],
  "bands": {
    "low_below": 1,
    "high_at": 1
  },
  "counts": {
    "runs": 1,
    "accepted": 1,
    "rejected": 1,
    "manual_reviews": 1,
    "reviews_upheld": 1,
    "reviews_cleared": 1,
    "match_warnings": 1,
    "ai_warnings": 1
  },
  "first_seen_at": "2026-11-24T10:00:00Z",
  "last_seen_at": "2026-11-24T10:00:00Z"
}
```

## PUT /v1/accounts/{id}

Save your own trust score for an account.

Saves a 0-100 score from your own records (account age, identity checks, strikes, chargebacks) for an account, so a release that sends no `trust_score` is decided with it. An account not seen yet is made. `trust_score: null` clears it, and `expires_at` ends it on a date. A staff pin and a `trust_score` sent with a release still come first. Console keys need the "Change the QC rules" permission. See /docs/trust-score-setup.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `id` | path | string | **Required.** Your own account id, as sent in `account.id` (URL-encoded). |

#### Request body

`application/json`.

| Field | Type | Description |
|---|---|---|
| `trust_score` | any or null | Required. A whole number from 0 to 100, or null to clear the saved score. Example `72`. |
| `name` | string or null | Example `Kayal Beats`. |
| `expires_at` | string or null | An ISO 8601 time in the future. Example `2026-12-31T00:00:00Z`. |

#### Example request

```bash
curl -s -X PUT "$ACTIVQC_BASE_URL/v1/accounts/{id}" \
  -H "Authorization: Bearer $ACTIVQC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "trust_score": 72,
  "name": "Kayal Beats",
  "expires_at": "2026-12-31T00:00:00Z"
}'
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | Saved. |
| `422` | Not a score from 0 to 100. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `object` | string | **Required.** Always `account`. |
| `id` | string | **Required.** Example `artist-8812`. |
| `name` | string or null |  |
| `livemode` | boolean |  |
| `score` | integer | **Required.** The score a release sent now without a trust_score would be decided with. |
| `band` | string | **Required.** One of `low`, `medium`, `high`. |
| `source` | string | **Required.** override: pinned by WAVBEE staff; saved: the score you saved with PUT /v1/accounts/{id}; computed: from the account's history. One of `override`, `saved`, `computed`. |
| `computed_score` | integer | **Required.** |
| `tenant_score` | integer or null | The last trust_score you sent, for reference. |
| `tenant_score_at` | string (date-time) or null |  |
| `saved_score` | integer or null | The score you saved for this account from your own records. |
| `saved_score_at` | string (date-time) or null |  |
| `saved_score_expires_at` | string (date-time) or null |  |
| `saved_score_active` | boolean | The saved score is set and has not expired. |
| `override_active` | boolean | **Required.** WAVBEE staff have pinned this account's score or band. |
| `override_expires_at` | string (date-time) or null |  |
| `reasons` | array of string |  |
| `bands` | object | **Required.** |
| `bands.low_below` | integer |  |
| `bands.high_at` | integer |  |
| `counts` | object | **Required.** |
| `counts.runs` | integer |  |
| `counts.accepted` | integer |  |
| `counts.rejected` | integer |  |
| `counts.manual_reviews` | integer |  |
| `counts.reviews_upheld` | integer |  |
| `counts.reviews_cleared` | integer |  |
| `counts.match_warnings` | integer |  |
| `counts.ai_warnings` | integer |  |
| `first_seen_at` | string (date-time) | **Required.** |
| `last_seen_at` | string (date-time) | **Required.** |

```json
{
  "object": "account",
  "id": "artist-8812",
  "name": "string",
  "livemode": false,
  "score": 1,
  "band": "low",
  "source": "override",
  "computed_score": 1,
  "tenant_score": 1,
  "tenant_score_at": "2026-11-24T10:00:00Z",
  "saved_score": 1,
  "saved_score_at": "2026-11-24T10:00:00Z",
  "saved_score_expires_at": "2026-11-24T10:00:00Z",
  "saved_score_active": false,
  "override_active": false,
  "override_expires_at": "2026-11-24T10:00:00Z",
  "reasons": [
    "string"
  ],
  "bands": {
    "low_below": 1,
    "high_at": 1
  },
  "counts": {
    "runs": 1,
    "accepted": 1,
    "rejected": 1,
    "manual_reviews": 1,
    "reviews_upheld": 1,
    "reviews_cleared": 1,
    "match_warnings": 1,
    "ai_warnings": 1
  },
  "first_seen_at": "2026-11-24T10:00:00Z",
  "last_seen_at": "2026-11-24T10:00:00Z"
}
```

## POST /v1/accounts/batch

Save your own trust scores for many accounts.

The same as PUT /v1/accounts/{id} for up to 500 accounts at once, for a nightly sync from your database. Checked whole first: one bad entry saves nothing, and the error names it (`accounts[3].trust_score`).

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

#### Request body

`application/json`.

| Field | Type | Description |
|---|---|---|
| `accounts` | array of object | 1 to 500 entries, each an object with an id and a trust_score. |
| `accounts[].id` | string | Required. Your account id, 1 to 128 characters. Example `artist-8812`. |
| `accounts[].trust_score` | any or null | Required. A whole number from 0 to 100, or null to clear it. Example `72`. |
| `accounts[].name` | string or null |  |
| `accounts[].expires_at` | string or null | An ISO 8601 time in the future. |

#### Example request

```bash
curl -s -X POST "$ACTIVQC_BASE_URL/v1/accounts/batch" \
  -H "Authorization: Bearer $ACTIVQC_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | All saved. |
| `422` | One entry is wrong, and nothing is saved. [Error envelope](https://activqc.wavbee.com/docs/errors.md). |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `object` | string | **Required.** Always `list`. |
| `count` | integer | **Required.** |
| `data` | array of object | **Required.** |
| `data[].object` | string | **Required.** Always `account`. |
| `data[].id` | string | **Required.** Example `artist-8812`. |
| `data[].name` | string or null |  |
| `data[].livemode` | boolean |  |
| `data[].score` | integer | **Required.** The score a release sent now without a trust_score would be decided with. |
| `data[].band` | string | **Required.** One of `low`, `medium`, `high`. |
| `data[].source` | string | **Required.** override: pinned by WAVBEE staff; saved: the score you saved with PUT /v1/accounts/{id}; computed: from the account's history. One of `override`, `saved`, `computed`. |
| `data[].computed_score` | integer | **Required.** |
| `data[].tenant_score` | integer or null | The last trust_score you sent, for reference. |
| `data[].tenant_score_at` | string (date-time) or null |  |
| `data[].saved_score` | integer or null | The score you saved for this account from your own records. |
| `data[].saved_score_at` | string (date-time) or null |  |
| `data[].saved_score_expires_at` | string (date-time) or null |  |
| `data[].saved_score_active` | boolean | The saved score is set and has not expired. |
| `data[].override_active` | boolean | **Required.** WAVBEE staff have pinned this account's score or band. |
| `data[].override_expires_at` | string (date-time) or null |  |
| `data[].reasons` | array of string |  |
| `data[].bands` | object | **Required.** |
| `data[].bands.low_below` | integer |  |
| `data[].bands.high_at` | integer |  |
| `data[].counts` | object | **Required.** |
| `data[].counts.runs` | integer |  |
| `data[].counts.accepted` | integer |  |
| `data[].counts.rejected` | integer |  |
| `data[].counts.manual_reviews` | integer |  |
| `data[].counts.reviews_upheld` | integer |  |
| `data[].counts.reviews_cleared` | integer |  |
| `data[].counts.match_warnings` | integer |  |
| `data[].counts.ai_warnings` | integer |  |
| `data[].first_seen_at` | string (date-time) | **Required.** |
| `data[].last_seen_at` | string (date-time) | **Required.** |

```json
{
  "object": "list",
  "count": 1,
  "data": [
    {
      "object": "account",
      "id": "artist-8812",
      "name": "string",
      "livemode": false,
      "score": 1,
      "band": "low",
      "source": "override",
      "computed_score": 1,
      "tenant_score": 1,
      "tenant_score_at": "2026-11-24T10:00:00Z",
      "saved_score": 1,
      "saved_score_at": "2026-11-24T10:00:00Z",
      "saved_score_expires_at": "2026-11-24T10:00:00Z",
      "saved_score_active": false,
      "override_active": false,
      "override_expires_at": "2026-11-24T10:00:00Z",
      "reasons": [
        "string"
      ],
      "bands": {
        "low_below": 1,
        "high_at": 1
      },
      "counts": {
        "runs": 1,
        "accepted": 1,
        "rejected": 1,
        "manual_reviews": 1,
        "reviews_upheld": 1,
        "reviews_cleared": 1,
        "match_warnings": 1,
        "ai_warnings": 1
      },
      "first_seen_at": "2026-11-24T10:00:00Z",
      "last_seen_at": "2026-11-24T10:00:00Z"
    }
  ]
}
```

