Summary
OpenAPI 3.23.0 added an optional request body to an endpoint the SDK already exposes:
- Path:
POST /portfolio/subaccounts (SubaccountsResource.create)
- New schema:
CreateSubaccountRequest — a single optional exchange_index field (defaults to 0).
create() currently posts json={}, which stays functionally compatible (every field is optional), so nothing breaks. But:
create() cannot target a non-zero exchange shard.
- Its docstring/comments are now stale — e.g.
kalshi/resources/subaccounts.py says "empty body (spec takes no request payload)" / "Spec defines no requestBody", which is no longer true as of 3.23.0.
Scope
- Add a
CreateSubaccountRequest model (extra="forbid", optional exchange_index).
- Add an optional
exchange_index param to create() (sync + async); build the body via the request model.
- Fix the stale docstring/comments.
- Register
request_body_schema in METHOD_ENDPOINT_MAP + BODY_MODEL_MAP; add a test.
Provenance
Surfaced during the #463 spec-drift reconciliation (3.22.0 → 3.23.0) as an out-of-scope enhancement. Low urgency (backward-compatible).
Summary
OpenAPI 3.23.0 added an optional request body to an endpoint the SDK already exposes:
POST /portfolio/subaccounts(SubaccountsResource.create)CreateSubaccountRequest— a single optionalexchange_indexfield (defaults to0).create()currently postsjson={}, which stays functionally compatible (every field is optional), so nothing breaks. But:create()cannot target a non-zero exchange shard.kalshi/resources/subaccounts.pysays "empty body (spec takes no request payload)" / "Spec defines no requestBody", which is no longer true as of 3.23.0.Scope
CreateSubaccountRequestmodel (extra="forbid", optionalexchange_index).exchange_indexparam tocreate()(sync + async); build the body via the request model.request_body_schemainMETHOD_ENDPOINT_MAP+BODY_MODEL_MAP; add a test.Provenance
Surfaced during the #463 spec-drift reconciliation (3.22.0 → 3.23.0) as an out-of-scope enhancement. Low urgency (backward-compatible).