POST /v1/sniper/configs/batch-resume
批量恢复 Snipe 任务配置
每一项在请求体里各带一个 If-Match(不是走请求头)。单条失败不影响整批——响应里的每一项各自带 status_code/code。
需要 sniper:write scope。
sniper:write 请求体 application/json
| 字段 | 类型 | 必填 | 约束 | 说明 |
|---|---|---|---|---|
items | array<object> | ✓ | minItems: 1, maxItems: 100 | 1 to 100 configs. One failing item does not fail the rest. |
items[].id | string | ✓ | minLength: 1, maxLength: 128 | Config id to pause or resume. |
items[].if_match | string | ✓ | minLength: 1 | Quoted ETag of the version you last read, for example "3". Checked per item, not as a request header. |
items[].close_position | boolean | default: false | batch-pause: also close positions this config opened. batch-resume: true on any item rejects the whole request. Default false. |
响应
200 — OK (see per-item results)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
data | object | ✓ | Response payload. |
data.results | array<object> | ✓ | One entry per requested item, in request order. |
data.results[].id | string | ✓ | Config id this result is for. |
data.results[].status_code | number | ✓ | HTTP status for this item: 200 when it changed or was already in the requested state, or an error status. |
data.results[].code | string | Error code when this item failed. Absent on success. | |
data.results[].version | number | New optimistic-concurrency version. Present on success. | |
data.results[].sync_state | enum ("syncing" | "synced" | "failed") | Engine sync state after the change. Present on success. | |
meta | object | ✓ | Request id, plus paging fields when this operation is a list. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
401 — unauthorized (missing/invalid/revoked/expired Bearer token)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
403 — insufficient_scope / ip_not_allowed
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
429 — rate_limited (Retry-After response header set)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
500 — internal_error
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | ✓ | Why the request failed. |
error.code | string | ✓ | Stable machine-readable error code. |
error.message | string | ✓ | Human-readable explanation of the error. |
error.total | number | Number of distinct blacklisted wallets the account would have on this chain after saving. | |
error.limit | number | Maximum distinct blacklisted wallets per account on this chain. | |
error.details | array<object> | Only present when at least one field-level validation issue exists. | |
error.details[].field | string | ✓ | Request field this issue refers to, or a dotted path such as buy.amount. |
error.details[].reason | string | ✓ | Why that field was rejected. |
error.details[].code | string | Stable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change. | |
meta | object | ✓ | Request id for this failure. |
meta.request_id | string | ✓ | Id of this request. Also sent as the X-Request-Id response header. |
请求示例
curl -X POST "https://api.apm.fun/v1/sniper/configs/batch-resume" \
-H "Authorization: Bearer apm_live_<prefix>.<secret>" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"id": "snp_9c31af02",
"if_match": "\"5\""
},
{
"id": "snp_4d81be77",
"if_match": "\"2\""
}
]
}' 响应示例 200
{
"data": {
"results": [
{
"id": "cfg_8f2a1c9b",
"status_code": 0,
"code": "string",
"version": 0,
"sync_state": "syncing"
}
]
},
"meta": {
"request_id": "cfg_8f2a1c9b"
}
}