Skip to content

Authentication

All requests to the XBTFX Trading API must be authenticated using an API key passed as a Bearer token in the Authorization header.

Each API key is bound to a single MT5 trading login. You can create and manage API keys from your XBTFX dashboard:

https://interface.xbtfx.com/dashboard/keys

When you create a key, it is associated with one MT5 account. All actions performed with that key operate on that specific account.

Include your API key in every request using the Authorization header:

Authorization: Bearer <your-api-key>
Terminal window
curl -X GET https://interface.xbtfx.com/v1/auth/status \
-H "Authorization: Bearer your_api_key_here"

Use this endpoint to verify your API key is valid and inspect its permissions.

GET /v1/auth/status

{
"login": 12345678,
"tier": "standard",
"status": "active",
"permissions": ["trade", "read"],
"margin_mode": "hedging"
}
FieldTypeDescription
loginintegerThe MT5 account login number bound to this key
tierstringAccount tier level
statusstringKey status (e.g., active)
permissionsarrayList of permissions granted to this key
margin_modestringAccount margin mode: hedging or netting
  • Store API keys securely. Never commit them to version control or expose them in client-side code.
  • Use environment variables or a secrets manager to inject keys at runtime.
  • Create separate keys for different applications or environments.
  • Rotate keys periodically and revoke any that are no longer in use.