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
}'
{
"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
The unique identifier of the position to emergency exit.How to get: Use Get Positions to find your position IDs
Example: 12345
Response Fields
Indicates if the emergency exit was completed successfully
The original margin amount returned to your account in USD
Error Responses
Invalid position ID or position cannot be emergency exited{
"error": 400,
"message": "Position not found or already closed"
}
Missing or invalid authentication token{
"error": 401,
"message": "Authorization header missing"
}
Attempting to emergency exit position that doesn’t belong to your wallet{
"error": 403,
"message": "Position does not belong to authenticated wallet"
}
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.
Strike Protocol API key authentication
Position ID for emergency exit
Emergency exit completed successfully