> For the complete documentation index, see [llms.txt](https://docs.forepaas.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.forepaas.org/v2/resources/changelog.md).

# Changelog

This page will contain a history of all changes and updates to the ForeGate PaaS API.

## \[2.6.0] — 2026-08-31

* **Corrected public price history:** aligned `GET https://openapiws.foregate.com/prices-history` with Polymarket's historical-price operation. The route now documents required `market`, optional `startTs`, `endTs`, `interval`, and `fidelity` filters and returns `{history:[{t,p}]}`.
* **Removed the best-price mismatch:** deleted the unrelated `token_id` / `side` request and `{price}` response contract, which belongs to Polymarket's distinct `/price` operation.
* **Cross-reference parity:** updated the public market-data page and WebSocket guide to use the same CLOB token ID and historical-price examples.

## \[2.5.0] — 2026-08-28

* **Complete V1.1 success contracts:** replaced every remaining generic OpenAPI success response with endpoint-specific schemas for user profiles, market detail and holders, live volume, category trees, search, CLOB quotes, MFA, withdrawals, and trades.
* **Exact request constraints:** documented non-empty registration values and enforced the V1.1 pagination range (`page >= 1`, `1 <= pageSize <= 100`) across every paginated operation, including open orders.
* **Rendered-reference parity:** added concrete user, market, holder, search, and trade payloads to the same-document reference pages and removed the remaining “upstream response unchanged” placeholders.
* **WebSocket verification:** re-audited all five signed `/socket/*` channels and the complete public `openapiws.foregate.com` event catalog, retaining their distinct authentication and timestamp contracts.

## \[2.4.0] — 2026-08-28

* **V1.1 endpoint alignment:** normalized registration, deposit, withdrawal, account, market-list, order-book, price-history, ordering, and open-order request/response contracts against the V1.1 reference.
* **Typed OpenAPI responses:** added endpoint-specific schemas for the corrected public DTOs, string IDs, status enums, pagination layouts, and fixed withdrawal limits.
* **Discoverability:** added the category-tree guide and a dedicated MFA page covering all seven `/user/mfa/*` operations.
* **Errors and time:** corrected gateway business codes and prefixes, documented plain-text query-deserialization errors, and standardized known downstream WebSocket business times to ISO 8601 UTC at second precision.

## \[2.3.0] — 2026-08-28

* **Public market WebSocket:** added `wss://openapiws.foregate.com/ws/market`, including initial and dynamic subscriptions, `PING`/`PONG` heartbeats, and complete schemas for `book`, `price_change`, `last_trade_price`, `tick_size_change`, `best_bid_ask`, `new_market`, and `market_resolved` events.
* **Public market price:** added unauthenticated `GET https://openapiws.foregate.com/prices-history`, which returns the current best bid for `BUY` or best ask for `SELL` for a CLOB token ID.
* **Machine-readable event contract:** added `asyncapi.yaml` and linked it from the OpenAPI specification and WebSocket guide.

## \[2.2.0] — 2026-08-23

* **Synced with the latest Lark API reference:** refreshed REST and WebSocket examples for the current API contract; signing `date` values use UTC (UTC+0), while response timestamps remain ISO 8601 UTC.
* **USDT currency contract clarified:** public monetary endpoints fix upstream `coinId` to the string `"2"`; clients no longer send `coinId` in deposit, withdrawal, account-history, position, or trade requests.
* **Response and filter details corrected:** documented the standard `code` / `message` / `data` envelope, corrected deposit-status and account-history pagination, added account-position filters, and documented `searchBy=Creator`.

## \[2.1.0] — 2026-08-19

* **OpenAPI specification synced with the current Lark API reference:** updated the shared response contract to use `code` / `message` / `data`, with `code: 0` for gateway-generated successes; normalized IDs as strings; and refreshed response, error, and pagination examples across existing endpoints.
* **New market category-tree endpoint:** added `GET /markets/category-tree`, including language negotiation and localized category-tree response details.
* **New MFA API surface:** added TOTP setup and removal, email OTP sending and removal, MFA-code verification, and MFA-status operations under `/user/mfa/*`, with shared validation (`1001`), authentication (`1401`), and unsupported-media-type (`1415`) responses.
* **Published OpenAPI reference:** added a repository-backed GitBook page that renders every REST operation from `openapi.yaml` through Swagger blocks.

## 2026-07-18

* **Signing `date` header timezone changed:** the gateway `date` header is now UTC (UTC+0); previously Beijing time (UTC+8). Format is unchanged (`YYYY-MM-DD HH:mm:ss`).
* **Breaking — claim endpoints request body changed:** `POST /ordering/claim` now takes `positionId` (was `orderId`), and `POST /ordering/claim_all` now takes `positionIdList` (was `orderIdList`). Validation error messages reference the new field names.

## 2026-07-16

* **Development base URL changed:** `api-dev.foregate.com` → `openapi.foregate.com` (REST and WebSocket).
* **Full per-endpoint documentation** for all 30 REST endpoints: wire-level cURL examples, Node.js/Python tabs, verbatim success and error payloads, and gateway-behavior notes (upstream mapping, parameter handling, GET→POST conversion, extracted fields).
* **Expanded WebSocket docs:** per-channel handshake signing (including the signed-cookie rules for user channels), push-message field tables with examples, and the required local order-book construction guide for the delta-only CLOB stream (including the double-buffer flow for strong consistency).
* **Reference clients** in Node.js and Python (`ForeGateClient`) with automatic HMAC signing, `content-md5` handling, session-cookie capture, and a signed WebSocket connection helper.
* **Authentication guide** rewritten with the complete string-to-sign specification, a worked `POST /user/register` signing example, and a signature-debugging guide built around `x-ca-error-message`.
* **OpenAPI specification** regenerated for the full surface with security schemes (gateway signature, API key, session cookie) so every reference page's interactive block resolves.
* Refreshed error-handling (layered gateway vs service errors, prefixed `1001`/`1401` claim codes) and common-pitfalls (18 field-tested traps) guides.

## 2026-07-08

* Replaced the outdated ForeGate documentation with the current ForeGate PaaS API (source: the third-party embedded integration API spec, Lark wiki). `openapi.yaml` and all Markdown guides rewritten.
* New base URL `https://api-dev.foregate.com`; authentication changed to Aliyun API Gateway HMAC-SHA256 signing (`x-ca-key` / `x-ca-signature`) plus `x-api-key` and a session Cookie issued by `POST /user/register`.
* New modules: User, Deposit, Withdraw, Account, Markets, Search, Orderbook (CLOB), Ordering, Trades, and 5 WebSocket channels under `/socket/*`.
* Removed pages no longer covered by the current API documentation: Rate Limits, SDKs, Support, and the old Basic Information / Creator / Market / Order references.

## 2025-12-18

* Initial release of the API documentation.
