Skip to main content
Skip to main content
Version: Next 🚧

Delete Algorithm

Delete a trading algorithm. Active algorithms must be stopped before deletion.

Endpoint

DELETE /api/trading/algorithms/:id

Authentication

Requires authentication via Bearer token.

Authorization: Bearer <access_token>

Request

Path Parameters

ParameterTypeRequiredDescription
idstringYesAlgorithm ID

Response

Success (204 No Content)

No response body. The algorithm has been successfully deleted.

Errors

StatusCodeMessage
401UNAUTHORIZEDAuthentication required
403FORBIDDENCannot delete active algorithm
404NOT_FOUNDAlgorithm not found

Examples

Delete Algorithm

cURL:

curl -X DELETE https://api.x3algo.com/api/trading/algorithms/507f1f77bcf86cd799439011 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

JavaScript:

const algorithmId = '507f1f77bcf86cd799439011'

const response = await fetch(
`https://api.x3algo.com/api/trading/algorithms/${algorithmId}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
)

if (response.status === 204) {
console.log('Algorithm deleted successfully')
}

Python:

algorithm_id = '507f1f77bcf86cd799439011'

response = requests.delete(
f'https://api.x3algo.com/api/trading/algorithms/{algorithm_id}',
headers={'Authorization': f'Bearer {access_token}'}
)

if response.status_code == 204:
print('Algorithm deleted successfully')

Notes

  • Active algorithms must be stopped before deletion
  • Deletion is permanent and cannot be undone
  • All associated trades and performance data will be preserved for historical records
  • Consider archiving instead of deleting if you want to preserve the configuration