API ReferenceRules

Confirm the rules that were read back

POST
/console/api/rules/confirm

Signs and applies the rules last returned by proposeRules for the role. The hash must match the pending proposal; otherwise the call is refused with 409 and nothing changes.

Authorization

consoleSession csrfToken
clearwake_console<token>

Set by GET /console/api/session. HttpOnly, SameSite=Strict, 8 hours.

In: cookie

X-Clearwake-CSRF<token>

The csrf value from GET /console/api/session, an HMAC of the session id. Required on every POST.

In: header

Request Body

application/json

The role and the rules_hash from the read back.

The rules to confirm.

role?string

Whose rules.

Default"merchant"

Value in

  • "merchant"
  • "buyer"
rules_hash*string

The hash returned by proposeRules.

Match^[0-9a-f]{64}$

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/console/api/rules/confirm" \  -H "Content-Type: application/json" \  -d '{    "role": "merchant",    "rules_hash": "60904ab97652ddc3692a557879844ae9cd949010d18372baa83ec7bcda755d7d"  }'
{  "role": "merchant",  "rules_hash": "60904ab97652ddc3692a557879844ae9cd949010d18372baa83ec7bcda755d7d",  "policy_hash": "7889498f53fe2a84409a9030733cb326fb9f8b662e9c243f9bf6b0c3489581ec",  "previous_kept": true,  "source": "typed"}