POST /v1/strategy-tasks/{id}/resume
恢复策略任务
携带 If-Match,经执行能力和钱包归属校验后恢复交易,无需 Lab 开关。已经运行且未停买的任务原样返回。需要 copytrade:write scope。
所需 Scope:copytrade:write 路径参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | ✓ | Strategy task ID. |
请求头
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
If-Match | string | ✓ | Current ETag from a prior read or write; required for optimistic concurrency. |
响应
200 — Committed
| 字段 | 类型 | 必填 | 约束 | 说明 |
|---|---|---|---|---|
data | object | ✓ | Response payload. | |
data.labels | array<string> | default: [] | The caller's task labels. Empty if none are set. | |
data.task_id | string | ✓ | Strategy task ID. | |
data.name | string | ✓ | Task display name. | |
data.chain | string | ✓ | Execution chain. | |
data.status | enum ("active" | "paused" | "deleted") | ✓ | Requested task state; engine reports synchronization separately. deleted appears only in the DELETE response. | |
data.version | number | ✓ | Current version, also returned as the ETag. | |
data.spec | object | ✓ | Stored apm.task/2 specification, including the server-assigned id. | |
data.engine | object | null | ✓ | Engine synchronization state, or null when absent. | |
data.engine.applied_version | number | null | ✓ | Last acknowledged version, or null before the first acknowledgement. | |
data.engine.sync_state | string | ✓ | Engine synchronization state: syncing, synced or failed. | |
data.engine.error_code | string | Engine rejection code, when present. | ||
data.engine.warning_code | string | The config has taken effect. prior_buyers_unavailable means listed wallet history is still loading. prior_buyers_fast_unavailable means updates for some listed wallets are delayed. The task may miss purchases those wallets make just before the leader buys. This warning does not reject buys. prior_buyers_over_limit means the account exceeds the wallet limit on this chain. Purchases by wallets beyond the limit are not checked. prior_buyers_history_truncated means a listed wallet bought more than 5,000 distinct tokens inside the window. Only its most recent 5,000 are checked. The task keeps running. | ||
data.engine.updated_at | string | ✓ | Engine state update time in RFC 3339 UTC. | |
data.run_state | object | ✓ | Effective task runtime state. | |
data.run_state.state | enum ("running" | "buy_paused" | "stopped") | ✓ | Effective runtime state: running, buy_paused or stopped. | |
data.run_state.reason | string | null | ✓ | Known buy-pause reasons: account, loss_streak, creator_limit, leader_token_limit, follow_count, buy_fail_streak, funding_low. Buys pause while sells and exits continue. For run-bound pauses, reopen to start a new run: follow, loss and creator counts reset; leader distinct-token counts persist, so raise the limit or disable that filter before reopening. Known stop reasons: low_balance, inactivity, loss_streak, creator_limit. Null means no recorded reason or user stop; unknown reasons are preserved. | |
data.buy_paused | object | null | ✓ | Buy pause for this run, or null. | |
data.buy_paused.rule_id | string | ✓ | Rule that paused buying. | |
data.buy_paused.observed | object | ✓ | Observed values that triggered the pause. | |
data.buy_paused.at | string | ✓ | Buy pause time in RFC 3339 UTC. | |
data.funding_low_since | string | null | ✓ | Start of the low-funding interval in RFC 3339 UTC, or null. | |
data.deactivation_close_position | boolean | ✓ | Whether the latest pause or delete requested closing positions. | |
data.created_at | string | ✓ | Creation time in RFC 3339 UTC. | |
data.updated_at | string | ✓ | Last update time in RFC 3339 UTC. | |
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. | |
meta.persistence | enum ("committed") | ✓ | The write has been committed to storage. |
400 — validation_error / unsupported_chain_feature / wallet_unavailable
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
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. |
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. |
404 — not_found
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
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. |
409 — not_paused / invalid_state / idempotency_conflict
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
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. |
412 — version_conflict
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
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. |
428 — precondition_required
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
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/strategy-tasks/cfg_8f2a1c9b/resume" \
-H "Authorization: Bearer apm_live_<prefix>.<secret>" \
-H "If-Match: "3"" 响应示例 200
{
"data": {
"labels": [],
"task_id": "cfg_8f2a1c9b",
"name": "string",
"chain": "string",
"status": "active",
"version": 0,
"spec": {},
"engine": {
"applied_version": null,
"sync_state": "string",
"error_code": "string",
"warning_code": "string",
"updated_at": "string"
},
"run_state": {
"state": "running",
"reason": null
},
"buy_paused": {
"rule_id": "cfg_8f2a1c9b",
"observed": {},
"at": "string"
},
"funding_low_since": null,
"deactivation_close_position": true,
"created_at": "string",
"updated_at": "string"
},
"meta": {
"request_id": "cfg_8f2a1c9b",
"persistence": "committed"
}
}