@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api IBKR 3rd Party Web API
@base https://www.interactivebrokers.com/tradingapi/v1
@version 1.0.0
@auth ApiKey portal in header
@endpoints 16
@toc oauth(3), accounts(10), secdef(1), marketdata(2)

@group oauth
@endpoint POST /oauth/request_token
@required {body: map}
@returns(200)
@errors {400, 401, 403, 408}

@endpoint POST /oauth/access_token
@required {body: map}
@returns(200)
@errors {400, 401, 403, 408}

@endpoint POST /oauth/live_session_token
@required {body: map}
@returns(200)
@errors {400, 401, 403, 408}

@endgroup

@group accounts
@endpoint GET /accounts
@required {account: any}
@returns(200)
@returns(202)
@returns(204)
@errors {401, 403, 408}

@endpoint GET /accounts/{account}/positions
@required {account: any}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint GET /accounts/{account}/summary
@required {account: any}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint GET /accounts/{account}/orders
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint POST /accounts/{account}/orders
@required {body: map}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint GET /accounts/{account}/orders/{CustomerOrderId}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint DELETE /accounts/{account}/orders/{CustomerOrderId}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint PUT /accounts/{account}/orders/{CustomerOrderId}
@required {body: map}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint POST /accounts/{account}/order_impact
@required {body: map}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endpoint GET /accounts/{account}/trades
@optional {since: str}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endgroup

@group secdef
@endpoint GET /secdef
@required {body: map}
@returns(200)
@returns(202)
@returns(204)
@errors {400, 401, 403, 408}

@endgroup

@group marketdata
@endpoint GET /marketdata/snapshot
@required {body: [map]}
@returns(200)
@errors {400, 401, 403, 408}

@endpoint GET /marketdata/exchange_components
@returns(200)
@errors {400, 401, 403, 408}

@endgroup

@end
