Change a subscription's settings or status
Last updated:
Request
Synthetic example for the production API. Replace YOUR_API_KEY and the ids. Do not send it against a live account until you mean to.
curl -X PATCH "https://api.fxapis.com/v1/copy/subscriptions/ACCOUNT_ID" \
-H "Authorization: Bearer YOUR_API_KEY"settings is merged into what is there: objects key by key, lists and symbols.map replaced. status is active, paused or close_only; a stopped subscription is brought back with POST …/reset. Changing sizing, limits, reverse or risk limits, or resuming, asks a member to confirm it is them (step-up); pausing and close_only never do. Moving into active or close_only counts against the plan's followers. Moving into active is refused while copy trading is paused on this server (503 COPY_TRADING_PAUSED, GET /v1/copy/status); settings, pausing and close_only still work.
Authorization
apiKey Authorization: Bearer fx_live_<id>_<secret>.
A key is shown once, at creation. We cannot show it again or recover it for you.
Keys carry a label (live or test) in the key itself, so each configuration is easy to tell
apart. Both reach real brokers: test with a broker demo account.
Scopes are per key. A key without accounts:write can read accounts and nothing else.
In: header
Path Parameters
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
1 <= propertiesResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://api.fxapis.com/v1/copy/subscriptions/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "strategyId": "c855e259-15d8-4385-a60f-bdf8f7695ef7", "followerAccountId": "a14041f3-1c82-4713-aa88-52d0145c7220", "status": "active", "stopReason": "risk_limit:day:equity", "stopDetail": null, "stoppedAt": null, "deleting": true, "settings": { "sizing": { "mode": "balance_ratio", "multiplier": 1, "lots": "string", "riskPercent": 0.01 }, "reverse": false, "copySlTp": "off", "symbols": { "allow": [], "block": [], "map": {} }, "limits": { "maxLots": null, "maxOpenPositions": null, "minLots": "skip" }, "late": { "maxDelaySeconds": 30, "maxDeviationPoints": null, "copyExistingOnStart": false }, "risk": { "limits": [] } }, "follower": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "label": null, "login": "string", "server": "string", "state": "string", "equity": null, "todayProfit": null }, "lastExecution": null, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}Archive a strategy DELETE
Only once no subscription copies it (pause or delete them first). Its executions and links stay in the log, and its paused or stopped subscriptions stay, unable to resume; the account can become a strategy again.
Delete a subscription DELETE
`closePositions` is required. - `true`: the subscription stops at once (`stopped`, `stopReason` `deleted`, `deleting` true) and every position it holds on the follower is closed, by ticket — including one whose copied open is still in flight, once it fills. The closes are recorded before any is sent, so they go even if this request is cut off, and a follower that is offline gets them when it is back. The subscription is removed once they are all closed: 200 with `deleted` true when that happens within this request, otherwise 202 with what is still `pending`. A close the broker refuses (`failed`) keeps the subscription until it is closed: delete again to retry, or with `false` to keep the rest. - `false`: the subscription is removed now, and its links with it: the positions stay open on the follower as the account's own, no longer copied, closed or corrected by copy trading (`released` counts them). Either way the executions log is kept, with `subscriptionId` null.