API key creation, logon, session lifecycle, and message retransmission
API Key Setup
FIX API keys use the same key pair as the REST API: Ed25519 (recommended) or 2048-bit RSA. Generate a key pair and register the public key in your account profile, or generate one there. The API Key ID (UUID) is your SenderCompID.
The initiator sends a Logon message. The acceptor responds with either a Logon (success) or Logout (failure).
Do not send SenderSubID<50> on Logon. Kalshi rejects it with a Logout; send operator identity per message instead — on NewOrderSingle, OrderCancelRequest, or OrderCancelReplaceRequest.
Required Fields
Tag
Name
Description
Value
98
EncryptMethod
Method of encryption
None<0>
96
RawData
Client logon message signature
Base64 encoded signature
108
HeartbeatInt
Heartbeat interval (seconds). Values below 3 are rejected with Invalid HeartBtInt.
N >= 3
1137
DefaultApplVerID
Default application version
FIX50SP2<9>
Optional Fields
Tag
Name
Description
Default
141
ResetSeqNumFlag
Reset sequence numbers on logon. Must be Y for KalshiNR and KalshiDC.
N
8013
CancelOrdersOnDisconnect
On any disconnection (including graceful logout), cancel the resting orders placed over FIX with this API key. Orders placed through REST or with another API key are not canceled. See the warning under Logout below.
The SendingTime in the PreHashString must match exactly the value in field 52 of the Logon message. SendingTime must be within 30 seconds of the server’s current time, or the message will be rejected with SessionRejectReason<373>=10.
Set by HeartbeatInt<108> on Logon. Always send it; 30 seconds is a typical value.
Idle timeout
The server ends the session and disconnects when it has received no inbound FIX message of any kind (Heartbeat, TestRequest, other session messages, or application messages) for twice the HeartbeatInt
Sequence number lower than expected
Connection terminated
Sequence number higher than expected
Recoverable with ResendRequest (KalshiRT only)
Message Retransmission
Message retransmission (ResendRequest, SequenceReset) is only supported on KalshiRT. ResetSeqNumFlag<141> must always be Y on KalshiNR and KalshiDC.The drop copy session provides an alternative way to query for missed execution reports. For a real-time streaming feed, see Listener Sessions.
ResendRequest (35=2)
KalshiRT only. Lookback window controlled by MessageRetentionPeriod.
Tag
Name
Description
7
BeginSeqNo
Lower bound (inclusive)
16
EndSeqNo
Upper bound (inclusive)
Logout (35=5)
Either side may initiate a Logout. The counterparty responds with a Logout, and the transport connection is terminated. If CancelOrdersOnDisconnect=Y was set on Logon, the resting orders placed over FIX with this session’s API key are canceled.
CancelOrdersOnDisconnect is not an account-wide kill switch. It cancels only the resting orders that were placed over FIX with this session’s API key. Orders placed through the REST API, or over FIX with a different API key, keep resting. Cancel those separately.A connection that goes silent without closing is only detected by the idle timeout, after twice your HeartbeatInt with no inbound message. Cancellation starts after that detection and takes further time to complete; there is no guaranteed upper bound on when the orders are canceled. A shorter HeartbeatInt (minimum 3 seconds) shortens detection only. Confirm cancellation from the execution reports or by querying your orders, and do not rely on cancel-on-disconnect as your only protection.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"API Documentation","colors":{"primary":"#00B67A","light":"#00DD94","dark":"#00B67A"},"logo":{"light":"https://mintcdn.com/kalshi-b198743e/koRHzlv9fsyF-jSm/logo-light.svg?fit=max\u0026auto=format\u0026n=koRHzlv9fsyF-jSm\u0026q=85\u0026s=bac849e081bbb1881bb945ea3e0464a8","dark":"https://mintcdn.com/kalshi-b198743e/koRHzlv9fsyF-jSm/logo-dark.svg?fit=max\u0026auto=format\u0026n=koRHzlv9fsyF-jSm\u0026q=85\u0026s=a4da341dfa9fb72cf3f2e94566447d0a"},"favicon":"https://mintcdn.com/kalshi-b198743e/koRHzlv9fsyF-jSm/favicon.png?fit=max\u0026auto=format\u0026n=koRHzlv9fsyF-jSm\u0026q=85\u0026s=292b09f2d750fdddf9861e6d016116dd","api":{"playground":{}},"thumbnails":{"appearance":"dark","background":"https://mintcdn.com/kalshi-b198743e/koRHzlv9fsyF-jSm/images/og-background.png?fit=max\u0026auto=format\u0026n=koRHzlv9fsyF-jSm\u0026q=85\u0026s=345c6286bc1878240df49e1dabe7a10f"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"kalshi-b198743e","hasAudioNarration":false,"actualSubdomain":"kalshi-b198743e","customDomains":["docs.kalshi.com"],"gitSource":{"type":"github","owner":"kalshi","repo":"exchange-infra","deployBranch":"dev","contentDirectory":"mintlify","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0e328ed09a38910d34ecdc","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"REST","count":213},{"language":"default","tag":"Predictions APIs","count":158},{"language":"default","tag":"Perps APIs","count":107},{"language":"default","tag":"WebSockets","count":28},{"language":"default","tag":"clearing-members","count":28},{"language":"default","tag":"Concepts","count":25},{"language":"default","tag":"portfolio","count":25},{"language":"default","tag":"FIX","count":20},{"language":"default","tag":"communications","count":20},{"language":"default","tag":"fcm","count":18}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navigation-items li[id=\"/changelog\"]{display:none}.mcp-tool-tables th:first-child,.mcp-tool-tables td:first-child{width:12rem;min-width:12rem}.mcp-tool-tables code{white-space:nowrap}.docs-home-hero{position:relative;width:100%;height:24rem;overflow:hidden;margin-top:-1px;display:flex;align-items:center;justify-content:center}.docs-home-hero-bg{position:absolute;inset:0;height:24rem;background-size:100%;background-position:center;background-repeat:no-repeat}.docs-home-hero-bg-light{background-image:url(\"https://mintlify-assets.b-cdn.net/kalshi-bg.svg\")}.docs-home-hero-bg-dark{display:none;background-image:url(\"https://mintlify-assets.b-cdn.net/kalshi-dark-bg.svg\")}.dark .docs-home-hero-bg-light{display:none}.dark .docs-home-hero-bg-dark{display:block}.docs-home-hero-content{position:absolute;width:min(45rem, calc(100% - 2rem));padding:0 1rem;text-align:center;color:#000}.dark .docs-home-hero-content{color:#fff}.docs-home-hero-title{margin:0;font-family:Inter, sans-serif;font-size:36px;font-weight:500;line-height:44px}.docs-home-hero-subtitle{margin-top:1rem;font-size:18px;font-weight:400;opacity:0.6}.docs-home-hero-agreement{margin-top:0.75rem;font-size:14px;font-weight:400}.docs-home-hero-agreement span{opacity:0.6}.docs-home-hero-link{color:#00B67A;text-decoration:underline}html.dark .docs-home-hero-link{color:#00DD94}.docs-home-content{max-width:70rem;margin:4rem auto 8rem;padding:0 1.25rem}.docs-home-section-title{margin-top:3.25rem;margin-bottom:1.25rem;font-size:1.75rem;font-weight:650;line-height:2.25rem}.docs-home-section-title:first-child{margin-top:0}"}]}
{"page":{"pagePath":"fix-margin/authentication","slug":"/fix-margin/authentication","pageMetadata":{"title":"Authentication \u0026 Sessions","description":"API key creation, logon, session lifecycle, and message retransmission","icon":"key","href":"/fix-margin/authentication"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"API key creation, logon, session lifecycle, and message retransmission\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`api-key-setup`,children:`API Key Setup`}),`\n`,_jsxs(_components.p,{children:[`FIX API keys use the same key pair as the `,_jsx(_components.a,{href:`/getting_started/api_keys`,children:`REST API`}),`: Ed25519 (recommended) or 2048-bit RSA. Generate a key pair and register the public key in your `,_jsx(_components.a,{href:`https://kalshi.com/account/profile`,children:`account profile`}),`, or generate one there. The API Key ID (UUID) is your `,_jsx(_components.code,{children:`SenderCompID`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Ed25519`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openssl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` genpkey`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -algorithm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ed25519`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -out`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` kalshi-fix.key`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openssl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` pkey`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -in`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` kalshi-fix.key`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -pubout`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -out`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` kalshi-fix.pub`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# RSA`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openssl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` genpkey`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -algorithm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` RSA`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -pkeyopt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` rsa_keygen_bits:2048`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -out`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` kalshi-fix.key`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`openssl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` rsa`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -in`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` kalshi-fix.key`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -pubout`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -out`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` kalshi-fix.pub`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`logon-35=a`,children:`Logon (35=A)`}),`\n`,_jsx(_components.p,{children:`The initiator sends a Logon message. The acceptor responds with either a Logon (success) or Logout (failure).`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Do not send `,_jsx(_components.code,{children:`SenderSubID\u003c50>`}),` on Logon. Kalshi rejects it with a Logout; send operator identity per message instead — on NewOrderSingle, OrderCancelRequest, or OrderCancelReplaceRequest.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`required-fields`,children:`Required Fields`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Tag`}),_jsx(_components.th,{children:`Name`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`98`}),_jsx(_components.td,{children:`EncryptMethod`}),_jsx(_components.td,{children:`Method of encryption`}),_jsx(_components.td,{children:`None\u003c0>`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`96`}),_jsx(_components.td,{children:`RawData`}),_jsx(_components.td,{children:`Client logon message signature`}),_jsx(_components.td,{children:`Base64 encoded signature`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`108`}),_jsx(_components.td,{children:`HeartbeatInt`}),_jsxs(_components.td,{children:[`Heartbeat interval (seconds). Values below 3 are rejected with `,_jsx(_components.code,{children:`Invalid HeartBtInt`}),`.`]}),_jsx(_components.td,{children:`N >= 3`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`1137`}),_jsx(_components.td,{children:`DefaultApplVerID`}),_jsx(_components.td,{children:`Default application version`}),_jsx(_components.td,{children:`FIX50SP2\u003c9>`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`optional-fields`,children:`Optional Fields`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Tag`}),_jsx(_components.th,{children:`Name`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{children:`Default`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`141`}),_jsx(_components.td,{children:`ResetSeqNumFlag`}),_jsxs(_components.td,{children:[`Reset sequence numbers on logon. `,_jsx(_components.strong,{children:`Must be Y for KalshiNR and KalshiDC.`})]}),_jsx(_components.td,{children:`N`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`8013`}),_jsx(_components.td,{children:`CancelOrdersOnDisconnect`}),_jsx(_components.td,{children:`On any disconnection (including graceful logout), cancel the resting orders placed over FIX with this API key. Orders placed through REST or with another API key are not canceled. See the warning under Logout below.`}),_jsx(_components.td,{children:`N`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`20126`}),_jsx(_components.td,{children:`ListenerSession`}),_jsxs(_components.td,{children:[`Listen-only session. `,_jsx(_components.strong,{children:`KalshiNR/KalshiRT only, requires SkipPendingExecReports=Y.`})]}),_jsx(_components.td,{children:`N`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`20200`}),_jsx(_components.td,{children:`MessageRetentionPeriod`}),_jsxs(_components.td,{children:[`How long session messages are stored for retransmission, max 72 hours. `,_jsx(_components.strong,{children:`KalshiRT only.`})]}),_jsx(_components.td,{\"data-numeric\":`true`,children:`24`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`21005`}),_jsx(_components.td,{children:`UseDollars`}),_jsx(_components.td,{children:`Fixed-point dollar pricing flag. Margin sessions always use fixed-point dollar pricing; clients should treat this as always enabled.`}),_jsx(_components.td,{children:`Always on`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`21011`}),_jsx(_components.td,{children:`SkipPendingExecReports`}),_jsxs(_components.td,{children:[`Skip `,_jsx(_components.code,{children:`PENDING_NEW`}),` / `,_jsx(_components.code,{children:`PENDING_REPLACE`}),` / `,_jsx(_components.code,{children:`PENDING_CANCEL`}),` execution reports`]}),_jsx(_components.td,{children:`N`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`21012`}),_jsx(_components.td,{children:`UseExpiredOrdStatus`}),_jsxs(_components.td,{children:[`Emit `,_jsx(_components.code,{children:`Expired\u003cC>`}),` for expiry-style system cancellations instead of `,_jsx(_components.code,{children:`Canceled\u003c4>`})]}),_jsx(_components.td,{children:`N`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`21007`}),_jsx(_components.td,{children:`EnableIocCancelReport`}),_jsx(_components.td,{children:`Partially filled IOC orders produce a cancel report`}),_jsx(_components.td,{children:`N`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`21008`}),_jsx(_components.td,{children:`PreserveOriginalOrderQty`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`OrderQty`}),` tag 38 always reflects original order quantity across states`]}),_jsx(_components.td,{children:`N`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`signature-generation`,children:`Signature Generation`}),`\n`,_jsx(_components.p,{children:`The RawData field must contain a base64-encoded signature of the pre-hash string: Ed25519 for Ed25519 keys, RSA-PSS with SHA-256 for RSA keys.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PreHashString = SendingTime + SOH + MsgType + SOH + MsgSeqNum + SOH + SenderCompID + SOH + TargetCompID`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The SendingTime in the PreHashString must match exactly the value in field 52 of the Logon message. SendingTime must be within 30 seconds of the server’s current time, or the message will be rejected with `,_jsx(_components.code,{children:`SessionRejectReason\u003c373>=10`}),`.`]})}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python (Ed25519)`,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` base64 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` b64encode`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cryptography.hazmat.primitives `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` serialization`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`private_key `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` serialization.load_pem_private_key(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'kalshi-fix.key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'rb'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).read(), `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`password`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sending_time, msg_type, msg_seq_num `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"20230809-05:28:18.035\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"A\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sender_comp_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"your-fix-api-key-uuid\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`target_comp_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"KalshiNR\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`msg_string `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` chr`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).join([sending_time, msg_type, msg_seq_num, sender_comp_id, target_comp_id])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`raw_data_value `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` b64encode(private_key.sign(msg_string.encode(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'utf-8'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))).decode(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'utf-8'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python (RSA)`,numberOfLines:`21`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` base64 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` b64encode`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Cryptodome.Signature `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pss`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Cryptodome.Hash `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` SHA256`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Cryptodome.PublicKey `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` RSA`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`private_key `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` RSA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.import_key(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'kalshi-fix.key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).read().encode(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'utf-8'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sending_time `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"20230809-05:28:18.035\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`msg_type `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"A\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`msg_seq_num `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"1\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sender_comp_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"your-fix-api-key-uuid\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`target_comp_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"KalshiNR\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`msg_string `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` chr`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).join([`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sending_time, msg_type, msg_seq_num,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sender_comp_id, target_comp_id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`msg_hash `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` SHA256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.new(msg_string.encode(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'utf-8'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`signature `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pss.new(private_key).sign(msg_hash)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`raw_data_value `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` b64encode(signature).decode(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'utf-8'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`heartbeat-\u0026-sequence-numbers`,children:`Heartbeat \u0026 Sequence Numbers`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Behavior`}),_jsx(_components.th,{children:`Detail`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Heartbeat interval`}),_jsxs(_components.td,{children:[`Set by `,_jsx(_components.code,{children:`HeartbeatInt\u003c108>`}),` on Logon. Always send it; 30 seconds is a typical value.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Idle timeout`}),_jsxs(_components.td,{children:[`The server ends the session and disconnects when it has received no inbound FIX message of any kind (Heartbeat, TestRequest, other session messages, or application messages) for twice the `,_jsx(_components.code,{children:`HeartbeatInt`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Sequence number lower than expected`}),_jsx(_components.td,{children:`Connection terminated`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Sequence number higher than expected`}),_jsx(_components.td,{children:`Recoverable with ResendRequest (KalshiRT only)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`message-retransmission`,children:`Message Retransmission`}),`\n`,_jsxs(_components.p,{children:[`Message retransmission (ResendRequest, SequenceReset) is only supported on `,_jsx(_components.strong,{children:`KalshiRT`}),`. `,_jsx(_components.code,{children:`ResetSeqNumFlag\u003c141>`}),` must always be `,_jsx(_components.code,{children:`Y`}),` on KalshiNR and KalshiDC.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/fix-margin/drop-copy`,children:`drop copy session`}),` provides an alternative way to query for missed execution reports. For a real-time streaming feed, see `,_jsx(_components.a,{href:`/fix-margin/listener-sessions`,children:`Listener Sessions`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`resendrequest-35=2`,children:`ResendRequest (35=2)`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`KalshiRT only.`}),` Lookback window controlled by `,_jsx(_components.code,{children:`MessageRetentionPeriod`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Tag`}),_jsx(_components.th,{children:`Name`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`7`}),_jsx(_components.td,{children:`BeginSeqNo`}),_jsx(_components.td,{children:`Lower bound (inclusive)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`16`}),_jsx(_components.td,{children:`EndSeqNo`}),_jsx(_components.td,{children:`Upper bound (inclusive)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`logout-35=5`,children:`Logout (35=5)`}),`\n`,_jsxs(_components.p,{children:[`Either side may initiate a Logout. The counterparty responds with a Logout, and the transport connection is terminated. If `,_jsx(_components.code,{children:`CancelOrdersOnDisconnect=Y`}),` was set on Logon, the resting orders placed over FIX with this session’s API key are canceled.`]}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`CancelOrdersOnDisconnect is not an account-wide kill switch.`}),` It cancels only the resting orders that were placed over FIX with this session’s API key. Orders placed through the REST API, or over FIX with a different API key, keep resting. Cancel those separately.`]}),_jsxs(_components.p,{children:[`A connection that goes silent without closing is only detected by the idle timeout, after twice your `,_jsx(_components.code,{children:`HeartbeatInt`}),` with no inbound message. Cancellation starts after that detection and takes further time to complete; there is no guaranteed upper bound on when the orders are canceled. A shorter `,_jsx(_components.code,{children:`HeartbeatInt`}),` (minimum 3 seconds) shortens detection only. Confirm cancellation from the execution reports or by querying your orders, and do not rely on cancel-on-disconnect as your only protection.`]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Authentication \u0026 Sessions","description":"API key creation, logon, session lifecycle, and message retransmission","icon":"key","href":"/fix-margin/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"API Key Setup","slug":"api-key-setup","depth":2,"children":[]},{"title":"Logon (35=A)","slug":"logon-35=a","depth":2,"children":[{"title":"Required Fields","slug":"required-fields","depth":3,"children":[]},{"title":"Optional Fields","slug":"optional-fields","depth":3,"children":[]},{"title":"Signature Generation","slug":"signature-generation","depth":3,"children":[]}]},{"title":"Heartbeat \u0026 Sequence Numbers","slug":"heartbeat-\u0026-sequence-numbers","depth":2,"children":[]},{"title":"Message Retransmission","slug":"message-retransmission","depth":2,"children":[{"title":"ResendRequest (35=2)","slug":"resendrequest-35=2","depth":3,"children":[]}]},{"title":"Logout (35=5)","slug":"logout-35=5","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"kalshi-b198743e","siteName":"API Documentation","title":"Authentication \u0026 Sessions - API Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T01:29:35.616Z","originalFileLocation":"fix-margin/authentication.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"API key creation, logon, session lifecycle, and message retransmission\">\u003cmeta data-mint-head name=\"application-name\" content=\"API Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authentication \u0026amp; Sessions - API Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"API key creation, logon, session lifecycle, and message retransmission\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.kalshi.com/fix-margin/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://kalshi-b198743e.mintlify.site/_mintlify/api/og/v2?division=FIX\u0026amp;title=Authentication+%26+Sessions\u0026amp;description=API+key+creation%2C+logon%2C+session+lifecycle%2C+and+message+retransmission\u0026amp;theme=7930e9e5ad96f557800076a6\u0026amp;signature=0a17c9bf68ff46f244cd45a599002f1960e761020721757ba0e584b03de5754d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Authentication \u0026amp; Sessions - API Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"API key creation, logon, session lifecycle, and message retransmission\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kalshi-b198743e.mintlify.site/_mintlify/api/og/v2?division=FIX\u0026amp;title=Authentication+%26+Sessions\u0026amp;description=API+key+creation%2C+logon%2C+session+lifecycle%2C+and+message+retransmission\u0026amp;theme=7930e9e5ad96f557800076a6\u0026amp;signature=0a17c9bf68ff46f244cd45a599002f1960e761020721757ba0e584b03de5754d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/kalshi-b198743e/_UdUeym1J95PnKJ_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#00B67A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.kalshi.com/fix-margin/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/fix-margin/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.kalshi.com/#organization\",\"name\":\"API Documentation\",\"url\":\"https://docs.kalshi.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/kalshi-b198743e/koRHzlv9fsyF-jSm/logo-light.svg?fit=max\u0026auto=format\u0026n=koRHzlv9fsyF-jSm\u0026q=85\u0026s=bac849e081bbb1881bb945ea3e0464a8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.kalshi.com#website\",\"name\":\"API Documentation\",\"url\":\"https://docs.kalshi.com\",\"publisher\":{\"@id\":\"https://docs.kalshi.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.kalshi.com/fix-margin/authentication#webpage\",\"url\":\"https://docs.kalshi.com/fix-margin/authentication\",\"name\":\"Authentication \u0026 Sessions\",\"description\":\"API key creation, logon, session lifecycle, and message retransmission\",\"dateModified\":\"2026-11-13T01:29:35.616Z\",\"isPartOf\":{\"@id\":\"https://docs.kalshi.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.kalshi.com/fix-margin/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.kalshi.com/fix-margin/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"FIX\",\"item\":\"https://docs.kalshi.com/fix-margin/connectivity\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication \u0026 Sessions\",\"item\":\"https://docs.kalshi.com/fix-margin/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.kalshi.com/fix-margin/authentication#article\",\"headline\":\"Authentication \u0026 Sessions\",\"name\":\"Authentication \u0026 Sessions\",\"description\":\"API key creation, logon, session lifecycle, and message retransmission\",\"url\":\"https://docs.kalshi.com/fix-margin/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://docs.kalshi.com/fix-margin/authentication#webpage\"},\"dateModified\":\"2026-11-13T01:29:35.616Z\",\"publisher\":{\"@id\":\"https://docs.kalshi.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.kalshi.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"API Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"API Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/fix-margin/authentication.md","siteName":"API Documentation","nav":{"global":null,"tabs":[{"tab":"Welcome","pages":[{"title":"Welcome","href":"/welcome"}]},{"tab":"Quick Start","pages":[{"title":"Quick Start","href":"/getting_started/api_environments"}]},{"tab":"Concepts","pages":[{"title":"Concepts","href":"/getting_started/making_your_first_request"}]},{"tab":"Predictions APIs","pages":[{"title":"Predictions APIs","href":"/cfbenchmarks/rest-passthrough"}]},{"tab":"Perps APIs","pages":[{"group":"Overview","pages":[{"title":"Perps API","href":"/margin"},{"title":"Perps Decimal Order Entry","href":"/margin/decimal-order-entry"},{"title":"Price Banding","href":"/margin/price-banding"},{"title":"Corporate Actions","href":"/margin/corporate-actions"}]},{"group":"REST","pages":[{"group":"clearing-members","pages":[{"title":"Get Margin Reports","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/reports","href":"/api-reference/get-margin-reports"},{"title":"Get Active Margin Obligations","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/active_obligations","href":"/api-reference/get-active-margin-obligations"},{"title":"Get Obligation History","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/obligation_history","href":"/api-reference/get-obligation-history"},{"title":"Get Obligation Settlement Details","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/obligations/{obligation_id}/settlement_details","href":"/api-reference/get-obligation-settlement-details"},{"title":"Get Obligation Funding Payments","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/obligations/{obligation_id}/funding_payments","href":"/api-reference/get-obligation-funding-payments"},{"title":"Get Obligation Corporate Action Payments","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/obligations/{obligation_id}/corporate_action_payments","href":"/api-reference/get-obligation-corporate-action-payments"},{"title":"Get Obligation Maintenance Margin Details","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/obligations/{obligation_id}/maintenance_margin_details","href":"/api-reference/get-obligation-maintenance-margin-details"},{"title":"Get Member Funding Payments","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/funding_payments","href":"/api-reference/get-member-funding-payments"},{"title":"Get Large Trader Positions","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/large_trader_positions","href":"/api-reference/get-large-trader-positions"},{"title":"Estimate Portfolio Maintenance Margin","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml post /margin/estimate_maintenance_margin","href":"/api-reference/estimate-portfolio-maintenance-margin"},{"title":"Get Maintenance Margin Metadata","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/estimate_maintenance_margin/metadata","href":"/api-reference/get-maintenance-margin-metadata"},{"title":"Get Settlement Estimate By Asset Class","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/settlement_estimate_by_asset_class","href":"/api-reference/get-settlement-estimate-by-asset-class"},{"title":"Get Funding Estimate By Asset Class","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/funding_estimate_by_asset_class","href":"/api-reference/get-funding-estimate-by-asset-class"},{"title":"Get Funding Schedule","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/funding_schedule","href":"/api-reference/get-funding-schedule"},{"title":"Get Settlement Prices","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/settlement_prices","href":"/api-reference/get-settlement-prices"},{"title":"Get Settlement Balance","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/settlement_balance","href":"/api-reference/get-settlement-balance"},{"title":"Get Guaranty Fund Balance","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/guaranty_fund_balance","href":"/api-reference/get-guaranty-fund-balance"},{"title":"Get Settlement Balance History","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/settlement_balance_history","href":"/api-reference/get-settlement-balance-history"},{"title":"Withdraw Settlement Balance","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml post /margin/settlement_balance_withdrawal","href":"/api-reference/withdraw-settlement-balance"},{"title":"Get Settlement Balance Withdrawal","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /margin/settlement_balance_withdrawal","href":"/api-reference/get-settlement-balance-withdrawal"},{"title":"Get Subtrader Groups","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /fcm/margin/subtrader_groups","href":"/api-reference/get-subtrader-groups"},{"title":"Create Subtrader Group","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml post /fcm/margin/subtrader_groups","href":"/api-reference/create-subtrader-group"},{"title":"Update Subtrader Group","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml put /fcm/margin/subtrader_groups/{group_id}","href":"/api-reference/update-subtrader-group"},{"title":"Delete Subtrader Group","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml delete /fcm/margin/subtrader_groups/{group_id}","href":"/api-reference/delete-subtrader-group"},{"title":"Create Subtrader-Bound API Key","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml post /fcm/margin/api_keys","href":"/api-reference/create-subtrader-bound-api-key"},{"title":"List Subtrader-Bound API Keys","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml get /fcm/margin/api_keys","href":"/api-reference/list-subtrader-bound-api-keys"},{"title":"Generate Subtrader-Bound API Key","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml post /fcm/margin/api_keys/generate","href":"/api-reference/generate-subtrader-bound-api-key"},{"title":"Delete Subtrader-Bound API Key","deprecated":null,"version":null,"openapi":"/perps_scm_openapi.yaml delete /fcm/margin/api_keys/{api_key_id}","href":"/api-reference/delete-subtrader-bound-api-key"}]},{"group":"corporate-actions","pages":[{"title":"Get Margin Corporate Actions","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/corporate_actions","href":"/margin-rest/corporate-actions/get-margin-corporate-actions"},{"title":"Get Corporate Action Payment History","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/corporate_action_payment_history","href":"/margin-rest/corporate-actions/get-corporate-action-payment-history"}]},{"group":"fcm","pages":[{"title":"Create Margin FCM Subtrader","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /margin/fcm/subtraders","href":"/margin-rest/fcm/create-margin-fcm-subtrader"},{"title":"Get FCM Subtrader Risk Controls","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/fcm/subtraders/risk_controls","href":"/margin-rest/fcm/get-fcm-subtrader-risk-controls"},{"title":"Update FCM Subtrader Risk Controls","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/fcm/subtraders/risk_controls","href":"/margin-rest/fcm/update-fcm-subtrader-risk-controls"},{"title":"Delete FCM Subtrader Risk Controls","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/fcm/subtraders/risk_controls","href":"/margin-rest/fcm/delete-fcm-subtrader-risk-controls"},{"title":"Create Margin FCM Position Transfer","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /margin/fcm/positions/transfers","href":"/margin-rest/fcm/create-margin-fcm-position-transfer"},{"title":"Update FCM Notional Risk Limit","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/fcm/notional_risk_limit","href":"/margin-rest/fcm/update-fcm-notional-risk-limit"},{"title":"Delete FCM Notional Risk Limit","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/fcm/notional_risk_limit","href":"/margin-rest/fcm/delete-fcm-notional-risk-limit"}]},{"group":"account","pages":[{"title":"Get Perps Account API Limits","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /account/limits/perps","href":"/margin-rest/account/get-perps-account-api-limits"}]},{"group":"exchange","pages":[{"title":"Get Exchange Status","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/exchange/status","href":"/margin-rest/exchange/get-exchange-status"},{"title":"Get Enabled Status","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/enabled","href":"/margin-rest/exchange/get-enabled-status"}]},{"group":"risk","pages":[{"title":"Get Risk Parameters","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/risk_parameters","href":"/margin-rest/risk/get-risk-parameters"},{"title":"Get Notional Risk Limit","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/notional_risk_limit","href":"/margin-rest/risk/get-notional-risk-limit"},{"title":"Get Risk","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/risk","href":"/margin-rest/risk/get-risk"}]},{"group":"orders","pages":[{"title":"Get Orders","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/orders","href":"/margin-rest/orders/get-orders"},{"title":"Create Order","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /margin/orders","href":"/margin-rest/orders/create-order"},{"title":"Cancel All Orders","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/orders","href":"/margin-rest/orders/cancel-all-orders"},{"title":"Get Order","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/orders/{order_id}","href":"/margin-rest/orders/get-order"},{"title":"Cancel Order","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/orders/{order_id}","href":"/margin-rest/orders/cancel-order"},{"title":"Decrease Order","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /margin/orders/{order_id}/decrease","href":"/margin-rest/orders/decrease-order"},{"title":"Amend Order","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /margin/orders/{order_id}/amend","href":"/margin-rest/orders/amend-order"}]},{"group":"market","pages":[{"title":"Get Markets","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/markets","href":"/margin-rest/market/get-markets"},{"title":"Get Market Schedules","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/markets/schedules","href":"/margin-rest/market/get-market-schedules"},{"title":"Get Multiple Market Orderbooks","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/markets/orderbooks","href":"/margin-rest/market/get-multiple-market-orderbooks"},{"title":"Get Market","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/markets/{ticker}","href":"/margin-rest/market/get-market"},{"title":"Get Market Orderbook","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/markets/{ticker}/orderbook","href":"/margin-rest/market/get-market-orderbook"},{"title":"Get Market Candlesticks","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/markets/{ticker}/candlesticks","href":"/margin-rest/market/get-market-candlesticks"},{"title":"Get Trades","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/trades","href":"/margin-rest/market/get-trades"}]},{"group":"portfolio","pages":[{"title":"Get Fills","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/fills","href":"/margin-rest/portfolio/get-fills"},{"title":"Get Positions","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/positions","href":"/margin-rest/portfolio/get-positions"},{"title":"Get Balance","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/balance","href":"/margin-rest/portfolio/get-balance"},{"title":"Intra Account Transfer","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /portfolio/intra_exchange_instance_transfer","href":"/margin-rest/portfolio/intra-account-transfer"},{"title":"Create Subaccount","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /portfolio/margin/subaccounts","href":"/margin-rest/portfolio/create-subaccount"},{"title":"Transfer Between Subaccounts","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /portfolio/margin/subaccounts/transfer","href":"/margin-rest/portfolio/transfer-between-subaccounts"}]},{"group":"fees","pages":[{"title":"Get Fee Tiers","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/fee_tiers","href":"/margin-rest/fees/get-fee-tiers"},{"title":"Get Fee Tier Rates","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/fee_tier_rates","href":"/margin-rest/fees/get-fee-tier-rates"}]},{"group":"funding","pages":[{"title":"Get Funding History","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/funding_history","href":"/margin-rest/funding/get-funding-history"},{"title":"Get Historical Funding Rates","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/funding_rates/historical","href":"/margin-rest/funding/get-historical-funding-rates"},{"title":"Get Funding Rate Estimate","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/funding_rates/estimate","href":"/margin-rest/funding/get-funding-rate-estimate"},{"title":"Get Premium Index","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/funding_rates/premium_index","href":"/margin-rest/funding/get-premium-index"}]},{"group":"order-groups","pages":[{"title":"Get Order Groups","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/order_groups","href":"/margin-rest/order-groups/get-order-groups"},{"title":"Create Order Group","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml post /margin/order_groups/create","href":"/margin-rest/order-groups/create-order-group"},{"title":"Get Order Group","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/order_groups/{order_group_id}","href":"/margin-rest/order-groups/get-order-group"},{"title":"Delete Order Group","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/order_groups/{order_group_id}","href":"/margin-rest/order-groups/delete-order-group"},{"title":"Reset Order Group","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/order_groups/{order_group_id}/reset","href":"/margin-rest/order-groups/reset-order-group"},{"title":"Trigger Order Group","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/order_groups/{order_group_id}/trigger","href":"/margin-rest/order-groups/trigger-order-group"},{"title":"Update Order Group Limit","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/order_groups/{order_group_id}/limit","href":"/margin-rest/order-groups/update-order-group-limit"}]},{"group":"exit-triggers","pages":[{"title":"Get Isolated Exit Triggers","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/isolated/positions/{ticker}/exit_trigger","href":"/margin-rest/exit-triggers/get-isolated-exit-triggers"},{"title":"Set Isolated Exit Trigger","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/isolated/positions/{ticker}/exit_trigger","href":"/margin-rest/exit-triggers/set-isolated-exit-trigger"},{"title":"Cancel Isolated Exit Trigger","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/isolated/positions/{ticker}/exit_trigger","href":"/margin-rest/exit-triggers/cancel-isolated-exit-trigger"},{"title":"Get Cross Exit Triggers","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml get /margin/cross/positions/{ticker}/exit_trigger","href":"/margin-rest/exit-triggers/get-cross-exit-triggers"},{"title":"Set Cross Exit Trigger","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/cross/positions/{ticker}/exit_trigger","href":"/margin-rest/exit-triggers/set-cross-exit-trigger"},{"title":"Cancel Cross Exit Triggers","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/cross/positions/{ticker}/exit_trigger","href":"/margin-rest/exit-triggers/cancel-cross-exit-triggers"},{"title":"Update Cross Exit Trigger","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml put /margin/cross/positions/{ticker}/exit_trigger/{trigger_id}","href":"/margin-rest/exit-triggers/update-cross-exit-trigger"},{"title":"Cancel Cross Exit Trigger by ID","deprecated":null,"version":null,"openapi":"/perps_openapi.yaml delete /margin/cross/positions/{ticker}/exit_trigger/{trigger_id}","href":"/margin-rest/exit-triggers/cancel-cross-exit-trigger-by-id"}]}]},{"group":"WebSockets","pages":[{"title":"Binary Margin WebSocket data","sidebarTitle":"Binary WebSocket data","href":"/margin-ws/websockets/binary-data"},{"title":"WebSocket Connection","asyncapi":"perps_asyncapi.yaml root","href":"/margin-ws/websockets/websocket-connection"},{"title":"Connection Keep-Alive","asyncapi":"perps_asyncapi.yaml control_frames","href":"/margin-ws/websockets/connection-keep-alive"},{"title":"Orderbook Updates","asyncapi":"perps_asyncapi.yaml orderbook_delta","href":"/margin-ws/websockets/orderbook-updates"},{"title":"Market Ticker","asyncapi":"perps_asyncapi.yaml ticker","href":"/margin-ws/websockets/market-ticker"},{"title":"Public Trades","asyncapi":"perps_asyncapi.yaml trade","href":"/margin-ws/websockets/public-trades"},{"title":"User Fills","asyncapi":"perps_asyncapi.yaml fill","href":"/margin-ws/websockets/user-fills"},{"title":"User Orders","asyncapi":"perps_asyncapi.yaml user_orders","href":"/margin-ws/websockets/user-orders"},{"title":"Order Group Updates","asyncapi":"perps_asyncapi.yaml order_group_updates","href":"/margin-ws/websockets/order-group-updates"},{"title":"Market Lifecycle","asyncapi":"perps_asyncapi.yaml market_lifecycle_v2","href":"/margin-ws/websockets/market-lifecycle"},{"title":"Exchange Status","asyncapi":"perps_asyncapi.yaml exchange_status","href":"/margin-ws/websockets/exchange-status"}]},{"group":"FIX","pages":[{"title":"Connectivity","description":"Endpoints, transport configuration, and rate limits for the Kalshi Margin FIX API","icon":"network-wired","href":"/fix-margin/connectivity"},{"title":"Authentication \u0026 Sessions","icon":"key","href":"/fix-margin/authentication"},{"title":"Order Entry","description":"Submit, modify, and cancel margin orders through FIX messages","icon":"cart-plus","href":"/fix-margin/order-entry"},{"title":"Order Groups","icon":"layer-group","href":"/fix-margin/order-groups"},{"title":"Market Data","icon":"chart-line","href":"/fix-margin/market-data"},{"title":"Drop Copy Session","icon":"copy","href":"/fix-margin/drop-copy"},{"title":"Listener Sessions","icon":"headphones","href":"/fix-margin/listener-sessions"},{"title":"Error Handling","icon":"triangle-exclamation","href":"/fix-margin/error-handling"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Authentication \u0026 Sessions - API Documentation","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":[],"chunks":[]}