curl -X POST "https://api.strike.markets/emergency-exit" \
-H "X-API-Key: stk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"positionId": 12345
}'
const response = await fetch('https://api.strike.markets/emergency-exit', {
method: 'POST',
headers: {
'X-API-Key': 'stk_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
positionId: 12345
})
});
const data = await response.json();
console.log('Emergency exit completed:', data);
import requests
response = requests.post(
'https://api.strike.markets/emergency-exit',
headers={
'X-API-Key': 'stk_your_api_key_here',
'Content-Type': 'application/json'
},
json={
'positionId': 12345
}
)
data = response.json()
print('Emergency exit completed:', data)
{
"success": true,
"refundedAmount": "100.0"
}
Trading Operations
Emergency Exit Position
Emergency exit from a position, refunding the margin
POST
/
emergency-exit
curl -X POST "https://api.strike.markets/emergency-exit" \
-H "X-API-Key: stk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"positionId": 12345
}'
const response = await fetch('https://api.strike.markets/emergency-exit', {
method: 'POST',
headers: {
'X-API-Key': 'stk_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
positionId: 12345
})
});
const data = await response.json();
console.log('Emergency exit completed:', data);
import requests
response = requests.post(
'https://api.strike.markets/emergency-exit',
headers={
'X-API-Key': 'stk_your_api_key_here',
'Content-Type': 'application/json'
},
json={
'positionId': 12345
}
)
data = response.json()
print('Emergency exit completed:', data)
{
"success": true,
"refundedAmount": "100.0"
}
curl -X POST "https://api.strike.markets/emergency-exit" \
-H "X-API-Key: stk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"positionId": 12345
}'
const response = await fetch('https://api.strike.markets/emergency-exit', {
method: 'POST',
headers: {
'X-API-Key': 'stk_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
positionId: 12345
})
});
const data = await response.json();
console.log('Emergency exit completed:', data);
import requests
response = requests.post(
'https://api.strike.markets/emergency-exit',
headers={
'X-API-Key': 'stk_your_api_key_here',
'Content-Type': 'application/json'
},
json={
'positionId': 12345
}
)
data = response.json()
print('Emergency exit completed:', data)
{
"success": true,
"refundedAmount": "100.0"
}
Overview
Perform an emergency exit from a position, immediately returning your original margin without realizing profit or loss. This is a last-resort option that should only be used in exceptional circumstances.Emergency exit forfeits any potential profit or loss and should only be used when normal position closure is not possible or during system emergencies.
This endpoint requires authentication with a valid API key. You can only emergency exit positions that belong to your wallet.
Authentication
Include your API key in the X-API-Key header:X-API-Key: stk_your_api_key_here
Request Body
integer
required
The unique identifier of the position to emergency exit.How to get: Use Get Positions to find your position IDs
Example: 12345
Example: 12345
Response Fields
boolean
Indicates if the emergency exit was completed successfully
string
The original margin amount returned to your account in USD
Error Responses
object
Invalid position ID or position cannot be emergency exited
{
"error": 400,
"message": "Position not found or already closed"
}
object
Missing or invalid authentication token
{
"error": 401,
"message": "Authorization header missing"
}
object
Attempting to emergency exit position that doesn’t belong to your wallet
{
"error": 403,
"message": "Position does not belong to authenticated wallet"
}
object
Rate limit exceeded (10 requests per minute for trading endpoints)
{
"error": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please wait 45 seconds.",
"retry_after": 45
}
Recovery and Next Steps
After an emergency exit:- Confirm Refund - Check Account for margin refund
- Review Dashboard - Update portfolio view in Dashboard
- Assess Markets - Use Market Data to evaluate conditions
- Consider Reentry - If conditions improve, consider new positions
Emergency exit is irreversible and forfeits all potential profit. Only use when absolutely necessary.
Keep emergency exit as a true last resort. In most cases, normal position closure or even waiting out temporary issues is preferable to forfeiting potential gains.