Watched addresses
Add many addresses
POST /v1/webhook/addresses/bulk adds up to 500 addresses in one all-or-nothing call.
Overview
POST/v1/webhook/addresses/bulk
Adds up to 500 addresses in one call. Each row has the same fields as Add an address. Duplicate rows in the same request are merged. The call is all or nothing: if one row is invalid, nothing is added and the error names the row.
Request
Request
curl -sS -X POST "https://webhooks.gray3.io/v1/webhook/addresses/bulk" \
-H "X-Gray-Project-Id: proj_your_project_id" \
-H "Authorization: Bearer gray_whk_your_webhook_key" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "chainId": "ethereum", "address": "0x8ba1f109551bD432803012645Ac136ddd64DBA72", "label": "user_1842" },
{ "chainId": "base", "address": "0x8ba1f109551bD432803012645Ac136ddd64DBA72", "label": "user_1842" },
{ "chainId": "base", "address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed", "label": "user_1843" }
]
}'Response
HTTP 201 — success envelope wraps the payload in data.
json
{
"data": {
"items": [ … three address objects … ],
"created": 2,
"existing": 1,
"reactivated": 1,
"creditsCharged": 2
}
}Retrying a bulk call is safe: addresses that were already added come back under existing and are not charged again.
More than 500 addresses
Split the list into chunks of 500 and send them one after another. Sending them in parallel works too, but may hit rate limits.
Errors
Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.
| Code | HTTP | When |
|---|---|---|
| invalid_argument | 400 | Malformed address or one from another network, unknown category or one the network does not send, more than 500 rows, or a network not enabled on the webhook. The message names the row. |
| plan_chain_denied | 403 | The network is not on your plan |
| credits_exhausted | 402 | Not enough credits for the new addresses |
| plan_limit_addresses | 403 | The new addresses would go over your plan's watched-address limit. Nothing is added or charged. |
| conflict | 409 | The webhook has not passed a test event yet |
| not_found | 404 | The project has no webhook |
json
{
"error": {
"code": "invalid_argument",
"message": "Human-readable detail (may be sanitized).",
"retryable": false
}
}