Skip to main content
POST
/
v1
/
beneficiaries
/
{id}
/
rescore
Rescore a beneficiary
curl --request POST \
  --url https://api.antonpayments.com/v1/beneficiaries/{id}/rescore \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'DPoP: <api-key>' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '{}'
{
  "pillar": "payee",
  "resource_id": "ben_01HX8Z9K0M2N3P4Q5R6S7T8UA1",
  "new_evaluation_id": "eval_01HXA1B2C3D4E5F6G7H8J9K0",
  "new_score": 423,
  "new_trust_score": 0.577,
  "new_tier": "MEDIUM",
  "previous_evaluation_id": "eval_01HX9Z0Y8X7W6V5U4T3S2R1Q",
  "previous_score": 720,
  "previous_trust_score": 0.28,
  "previous_tier": "HIGH"
}

Documentation Index

Fetch the complete documentation index at: https://docs.antonpayments.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

OAuth 2.0 client_credentials grant (RFC 6749 §4.4) bound to a DPoP keypair (RFC 9449).

Flow (every authenticated /v1 call requires both an access token AND a fresh per-request DPoP proof):

  1. Register a credential via the merchant portal. Anton issues a client_id (ant_oc_<env>_<32hex>) and a client_secret (ant_ocs_<env>_<48hex>, shown ONCE). The portal generates an ES256 or Ed25519 DPoP keypair in your browser; you store the private half.
  2. Mint an access token: POST /oauth/token with Authorization: Basic <client_id:client_secret> and Content-Type: application/x-www-form-urlencoded. Body: grant_type=client_credentials. A DPoP header carrying a proof signed for the token endpoint is required (no ath claim on this proof).
  3. Use the token: send Authorization: DPoP <access_token> plus a fresh DPoP: <proof> header on every /v1 request. The proof JWT MUST carry htm (request method), htu (request URL, no query/fragment), iat (within ±60s), jti (unique within 5 min), and ath (SHA-256 of the access token, base64url).

Tokens expire in 1 hour in production / staging and 8 hours in sandbox. There are no refresh tokens — call /oauth/token again with your secret. Anton's public signing key is published at /v1/.well-known/jwks.json.

OpenAPI 3.0 has no native DPoP scheme; this declaration plus dpopHeader together convey both the access-token Authorization and the per-request proof header.

DPoP
string
header
required

Per-request DPoP proof JWT (RFC 9449). MUST accompany the Authorization: DPoP <access_token> header on every protected operation. The proof is signed by the merchant's private DPoP key and carries htm, htu, iat, jti, and ath claims.

Headers

Idempotency-Key
string
required

Unique key identifying this operation. Sending the same key twice returns the original response instead of creating a duplicate. Keys are retained for 24 hours.

Maximum string length: 255

Path Parameters

id
string
required
Pattern: ^ben_[a-zA-Z0-9]+$

Body

application/json

No request body is required. Any body is ignored.

Response

Rescore completed. The body is the engine's verdict.

Verdict returned by a successful POST /v1/beneficiaries/{id}/rescore. Carries both the new evaluation and, when available, the previous one so clients can render old-vs-new score comparisons.

Scale. The new_trust_score / previous_trust_score fields use the same 0.01.0 trust-score convention as GET /v1/beneficiaries/{id}.trust_score — higher is more trustworthy. Prefer these fields on merchant-facing surfaces. new_score / previous_score are the engine's raw 0–1000 Payee-pillar risk integers and are deprecated — they remain on the response for backward compatibility and ops-audit use and will be removed in a future release.

pillar
enum<string>
required

The engine scoring pillar that was recomputed. Merchant rescores are always Payee-pillar.

Available options:
payee
resource_id
string
required

The beneficiary ID this verdict applies to.

Pattern: ^ben_[a-zA-Z0-9]+$
new_evaluation_id
string
required

Engine evaluation ID for the rescore run. Persistent — can be used to correlate with the engine's audit trail.

new_trust_score
number<float>
required

Normalized trust score for the rescore run, on the same 0.01.0 scale as GET /v1/beneficiaries/{id}.trust_score. Higher is more trustworthy. Derived from the raw Payee-pillar risk integer as trust = (1000 - raw_risk) / 1000. Always present on a successful rescore response.

Required range: 0 <= x <= 1
new_score
integer
required
deprecated

Deprecated. The engine's raw 0–1000 Payee-pillar risk integer for the rescore run (lower is more trustworthy — the inverse of the merchant trust score). Use new_trust_score instead; this field will be removed in a future release.

Required range: 0 <= x <= 1000
new_tier
enum<string>
required

Bucketed tier for the rescore (see trust_tier on the beneficiary resource).

Available options:
CRITICAL,
HIGH,
MEDIUM,
LOW
previous_evaluation_id
string

Engine evaluation ID of the prior evaluation, if any. Omitted when this is the first evaluation for the beneficiary.

previous_trust_score
number<float>

Normalized trust score from the prior evaluation, on the same 0.01.0 scale as new_trust_score. Omitted when there was no prior evaluation (distinguishable from a legitimate prior of exactly 0.0 or 1.0).

Required range: 0 <= x <= 1
previous_score
integer | null
deprecated

Deprecated. Prior engine raw 0–1000 Payee-pillar risk integer, if any. Nullable (not omitted) so a legitimate prior score of 0 is distinguishable from "no previous evaluation." Use previous_trust_score instead; this field will be removed in a future release.

Required range: 0 <= x <= 1000
previous_tier
enum<string>

Prior tier, if any. Omitted when there was no prior evaluation.

Available options:
CRITICAL,
HIGH,
MEDIUM,
LOW