---
title: "Logout"
method: POST
path: "/api/{exchange}/logout"
---

# Logout

`POST /api/{exchange}/logout`

Logout and invalidate the current session.

## Path parameters

- `exchange` 'polymarket' | 'kalshi' | 'kalshi-demo' | 'limitless' | 'probable' | 'baozi' | 'myriad' | 'opinion' | 'metaculus' | 'smarkets' | 'polymarket_us' | 'gemini-titan' | 'hyperliquid' | 'suibets' | 'rain' | 'hunch' | 'router', required

## Request body

- object
  - `args` string[]
  - `credentials` ExchangeCredentials — Optional authentication credentials for exchange operations.
    - `apiKey` string
    - `apiSecret` string — Standard API secret for HMAC-authenticated exchanges
    - `passphrase` string — Standard API passphrase for HMAC-authenticated exchanges
    - `apiToken` string — Metaculus: `Authorization: Token <apiToken>` for higher rate limits
    - `privateKey` string — Required for Polymarket L1 auth
    - `signatureType` union — 0 = EOA, 1 = Poly Proxy, 2 = Gnosis Safe (Can also use 'eoa', 'polyproxy', 'gnosis_safe')
      - number
      - string
    - `funderAddress` string — The address funding the trades (defaults to signer address)
    - `walletAddress` string
    - `baseUrl` string

## Response `200`

Logout response

- BaseResponse
  - `success` boolean
  - `error` ErrorDetail — Structured error envelope returned inside `BaseResponse.error` and `ErrorResponse.error`. Hosted-mode endpoints populate `code`, `retryable`, and optionally `exchange` / `detail`; legacy local-mode endpoints may still return only `message`.
    - `message` string — Human-readable error message.
    - `code` 'HOSTED_TRADING_ERROR' | 'INSUFFICIENT_ESCROW_BALANCE' | 'ORDER_SIZE_TOO_SMALL' | 'INVALID_API_KEY' | 'OUTCOME_NOT_FOUND' | 'CATALOG_UNAVAILABLE' | 'BUILT_ORDER_EXPIRED' | 'INVALID_SIGNATURE' | 'NO_LIQUIDITY' | 'MISSING_WALLET_ADDRESS' | 'BAD_REQUEST' | 'AUTHENTICATION_ERROR' | 'PERMISSION_DENIED' | 'NOT_FOUND' | 'ORDER_NOT_FOUND' | 'MARKET_NOT_FOUND' | 'EVENT_NOT_FOUND' | 'RATE_LIMIT_EXCEEDED' | 'INVALID_ORDER' | 'INSUFFICIENT_FUNDS' | 'VALIDATION_ERROR' | 'NETWORK_ERROR' | 'EXCHANGE_NOT_AVAILABLE' | 'NOT_SUPPORTED' — Stable machine-readable error code. Hosted-mode errors use the `HostedTradingError` family (e.g. `INSUFFICIENT_ESCROW_BALANCE`, `BUILT_ORDER_EXPIRED`); pre-hosted local errors use the legacy family (e.g. `BAD_REQUEST`, `NOT_FOUND`).
    - `retryable` boolean — Hint for clients: when `true`, the same request may succeed on retry (e.g. transient network or rate-limit conditions); when `false`, the caller should not retry without modifying the request.
    - `exchange` string, nullable — Venue the error originated from, when known (e.g. 'polymarket', 'kalshi').
    - `detail` object, nullable — Free-form hosted-mode detail blob. Shape depends on `code` — e.g. for `INSUFFICIENT_ESCROW_BALANCE` it may include `{ requested, available }`; for `ORDER_SIZE_TOO_SMALL` it may include `{ min }`; for `BUILT_ORDER_EXPIRED` it may include `{ expiry }`.

---

[API](https://skmtc.net/pmxt-dev/apis/pmxt-hosted-api.md) · [All operations](https://skmtc.net/pmxt-dev/apis/pmxt-hosted-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pmxt-dev/pmxt-hosted-api/versions/da5293255d19/schema)
