FUTURESCME contracts
Featured Firm VestVest 5% OFF all plans · from $10 · NQ 50x · no swap fee · USDC payouts on-chain 5% Off Code JMU

VERSION HISTORY

Atomically update position TP/SL orders

My Funded Perpetuals·1 version·Read the live article ↗·Rule Radar


CompareA: Version -againstB: Version 1Pick A and B on any two versions below.
Track a rule
Fetches the article and compares it with Version 1.
▸Version 1November 11, 2026, 6:04 PM

First archived version.

Atomically update position TP/SL orders
Applies a stale-snapshot-guarded batch of place, modify, and cancel operations. New opposite-group legs can be paired as OCO orders.
OpenAPI
yaml /openapi.yaml put /v1/positions/{position_id}/exit-orders
openapi: 3.1.0
info:
title: MyFundedPerps API (Beta)
version: 1.0.0
description: >-
The developer API is in beta. Breaking changes may be introduced at any
time. Programmatic access to MyFundedPerps paper-trading challenge accounts.
API trades use the same real order books and simulated execution engine as
the web trading interface. Every response carries an X-Request-Id header
for support and log correlation.
contact:
url: https://myfundedperpetuals.com/contact
servers:
- url: https://developers.myfundedperpetuals.com
description: Live
- url: https://sandbox.myfundedperpetuals.com
description: Sandbox (test keys and sandbox accounts only)
security:
- bearerAuth: []
- bearerAuth: []
partnerKey: []
tags:
- name: General
- name: Authentication
- name: Accounts
- name: Markets
- name: Positions
- name: Orders
- name: Fills
- name: Strategy Orders
- name: Price Alerts
- name: Affiliate
paths:
/v1/positions/{position_id}/exit-orders:
put:
tags:
- Positions
summary: Atomically update position TP/SL orders
description: >-
Applies a stale-snapshot-guarded batch of place, modify, and cancel
operations. New opposite-group legs can be paired as OCO orders.
operationId: replacePositionExitOrders
parameters:
- $ref: '#/components/parameters/PositionId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExitOrderBatchRequest'
responses:
'200':
description: Exit orders updated.
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/Position'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'422':
$ref: '#/components/responses/TradeRejected'
'429':
$ref: '#/components/responses/RateLimited'
components:
parameters:
PositionId:
name: position_id
in: path
required: true
schema:
type: string
schemas:
ExitOrderBatchRequest:
type: object
additionalProperties: false
required:
- expected_position_size
- expected_orders
- operations
properties:
expected_position_size:
type: number
exclusiveMinimum: 0
expected_orders:
type: array
items:
type: object
additionalProperties: false
required:
- order_id
- price
- size
properties:
order_id:
type: string
execution_type:
type: string
enum:
- market
- limit
price:
type: number
exclusiveMinimum: 0
size:
type: number
exclusiveMinimum: 0
operations:
type: array
items:
oneOf:
- type: object
additionalProperties: false
required:
- kind
- order_id
properties:
kind:
type: string
const: cancel
order_id:
type: string
- type: object
additionalProperties: false
required:
- kind
- order_id
- price
properties:
kind:
type: string
const: modify
order_id:
type: string
price:
type: number
exclusiveMinimum: 0
size:
type: number
exclusiveMinimum: 0
- type: object
additionalProperties: false
required:
- kind
- group
- price
- size
properties:
kind:
type: string
const: place
group:
type: string
enum:
- tp
- sl
execution_type:
type: string
enum:
- market
- limit
price:
type: number
exclusiveMinimum: 0
size:
type: number
exclusiveMinimum: 0
oco_pair_with_operation_index:
type: integer
minimum: 0
Position:
type: object
required:
- id
- account_id
- market_id
- provider
- symbol
- coin
- side
- size
- entry_price
- leverage
- margin_mode
- isolated_margin_extra
- status
- opened_at
properties:
id:
type: string
account_id:
type: string
market_id:
type: string
provider:
type: string
symbol:
type: string
coin:
type: string
side:
type: string
enum:
- long
- short
size:
type: number
entry_price:
type: number
leverage:
type: number
margin_mode:
type: string
enum:
- cross
- isolated
liquidation_price:
type: number
isolated_margin_extra:
type: number
status:
type: string
enum:
- open
- closed
opened_at:
type: number
closed_at:
type: number
size_decimals:
type: integer
minimum: 0
exit_price:
type: number
realized_pnl:
type: number
realized_margin_basis:
type: number
fees:
type: number
funding:
type: number
close_reason:
type: string
enum:
- user
- take_profit
- stop_loss
- liquidation
- reversal
- system
description: >-
Why a closed position closed. Absent on open positions and on
positions closed before this field was added.
ErrorEnvelope:
type: object
required:
- error
properties:
error:
$ref: '#/components/schemas/Error'
TradeRejectionEnvelope:
type: object
required:
- error
properties:
error:
$ref: '#/components/schemas/TradeRejection'
Error:
type: object
required:
- code
- message
- request_id
properties:
code:
type: string
message:
type: string
request_id:
type: string
format: uuid
details:
type: array
description: >-
Present on request-validation failures, with one entry per invalid
field so a request can be fixed in one pass.
items:
$ref: '#/components/schemas/ValidationIssue'
TradeRejection:
allOf:
- $ref: '#/components/schemas/Error'
- type: object
properties:
order_id:
type: string
client_order_id:
type: string
rule_id:
type: string
details:
type: object
additionalProperties: true
ValidationIssue:
type: object
required:
- field
- issue
properties:
field:
type: string
description: >-
Wire name of the offending request field, such as size or
operations[2].price. The value body refers to the whole payload.
issue:
type: string
responses:
BadRequest:
description: >-
Invalid request. Validation failures list every offending field in
error.details.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
Unauthorized:
description: Missing, invalid, or revoked API key, or an invalid partner key.
headers:
WWW-Authenticate:
schema:
type: string
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
Forbidden:
description: The API key is valid but does not allow this operation.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
NotFound:
description: Resource not found or not owned by the authenticated user.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
Conflict:
description: >-
The request conflicts with current state, an idempotency record, or a
client order ID.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
TradeRejected:
description: The trading engine rejected the requested operation.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradeRejectionEnvelope'
RateLimited:
description: >-
The per-IP request limit, a partner budget, or an account-wide operation
budget is exhausted.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Scope:
$ref: '#/components/headers/RateLimitScope'
X-Request-Id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
headers:
RequestId:
description: Stable identifier for support and log correlation.
schema:
type: string
format: uuid
RetryAfter:
description: Seconds to wait before retrying.
schema:
type: integer
minimum: 1
RateLimitLimit:
description: >-
Requests per minute allowed by the request budget that ran out. Sent on
request-budget 429s; account-wide operation budget 429s omit it.
schema:
type: integer
minimum: 1
RateLimitScope:
description: >-
Which request budget ran out: ip for the per-address limit, api_key
for a partner's per-trader-key budget, or partner for a partner's
combined budget. Sent on request-budget 429s; account-wide operation
budget 429s omit it.
schema:
type: string
enum:
- ip
- api_key
- partner
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: MyFundedPerps API key
description: >-
API key beginning with fp_live_ (live keys, served at
developers.myfundedperpetuals.com) or fp_test_ (test keys, served at
sandbox.myfundedperpetuals.com). A key presented on the other host is
rejected with 401 and a message naming the correct host. Affiliate API
keys are fp_live_ keys created on the Affiliates page: they read only
the /v1/affiliate endpoints and get 403 with code
insufficient_scope on every other authenticated endpoint. Every other
key gets the same 403 on /v1/affiliate.
partnerKey:
type: apiKey
in: header
name: X-MFP-Partner-Key
description: >-
Optional partner key beginning with mfp_partner_, issued by
MyFundedPerps to platforms that call the live API on behalf of many
traders. Send it beside the trader's own fp_live_ key: the request is
then counted against the partner's budgets instead of the per-address
limit. It grants no access on its own. An unknown, malformed, or revoked
partner key returns 401 with code invalid_partner_key. The header is
ignored on the sandbox host and on requests without a live trader key.
This documentation is built and hosted on Mintlify, a developer documentation platform.

SHA-256 eb46689db68d234a2fd2cda0c9af0220c9c865f85eb9a663974047c9917ac266

Scroll to Top