Import risk address entries in bulk
const url = 'https://pay.example.com/v1/risk/addresses/import';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"list":"crm","mode":"replace","default_level":"block","entries":["0x098B716B8Aaf21512996dC57EB0615e2383E2f96",{"address":"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","level":"review","category":"mixer","chain_id":[1,8453]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://pay.example.com/v1/risk/addresses/import \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "list": "crm", "mode": "replace", "default_level": "block", "entries": [ "0x098B716B8Aaf21512996dC57EB0615e2383E2f96", { "address": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", "level": "review", "category": "mixer", "chain_id": [ 1, 8453 ] } ] }'Writes up to 10,000 entries in one transaction to the merchant’s list or the named list list (created
on first use): all valid or none (400 invalid_entries lists the faulty items by index). append adds
the entries (replacing those already there for the same address and chain scope); replace makes the
list hold exactly these entries, removing the others (a test key’s replacement touches only entries on
testnet chains). An address appearing twice for the same chain scope counts once (duplicates). The body
may be up to 4 MiB. Audited as api:<key name>. Idempotent (see the introduction). Requires risk:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Any unique string per logical request (a UUID); see the introduction.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Address strings, or objects with address and optional level, category, chain_id (an id, a list
of ids — one entry each — or all), reason (or labels, joined) and expires_at. Field aliases are
accepted (wallet, action, type, chain/chains, note/description, expires/expiry);
other fields are ignored.
object
A named list; default the merchant’s list.
Chain of the entries that name none; default all chains.
Example
{ "list": "crm", "mode": "replace", "default_level": "block", "entries": [ "0x098B716B8Aaf21512996dC57EB0615e2383E2f96", { "address": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", "level": "review", "category": "mixer", "chain_id": [ 1, 8453 ] } ]}Responses
Section titled “Responses”What the import changed (or the replayed first answer)
object
manual or the named list.
Entries written (duplicates once).
Entries new to the list.
Entries a replacement removed.
Items repeating an earlier address and chain scope.
Example
{ "source": "manual", "mode": "append"}invalid_entries: nothing was imported (params: invalid, errors[{index, message}] — the first 20,
index 0-based). invalid_request with params.field for the other fields: entries (1-10,000 items,
min / max), mode, default_level, chain_id, list; without params for a body that is not
JSON, has an unknown field or a wrong type, and a missing Idempotency-Key.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "invalid_request" }}unauthorized: no Authorization: Bearer header, or an unknown or revoked key.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "unauthorized" }}insufficient_scope; testnet_only: a test key writing an entry not scoped to a testnet chain
(params: chain_id, testnets).
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "insufficient_scope" }}list_is_feed (params.list); request_in_progress.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "list_is_feed" }}payload_too_large: the body is over 64 KiB (the bulk import: 4 MiB).
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "payload_too_large" }}idempotency_key_reused: the Idempotency-Key was used with another request body.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "idempotency_key_reused" }}