Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dev4traders/mt5-manager-api/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The MT5 Manager API uses bearer token authentication. You must first initialize a connection to obtain a token, then use that token for all subsequent API calls.Authentication Flow
The authentication process follows these steps:- Call the
/init/endpoint with your MT5 server credentials - Receive a bearer token in the response
- Configure the SDK with the token
- Make authenticated API calls
Step 1: Initialize Connection
Use theinitGet() method to authenticate and obtain a token:
MetaTrader5 server IP with port (e.g.,
127.0.0.1:443)MetaTrader manager login credential
MetaTrader manager password
Connection timeout in milliseconds (optional)
Step 2: Configure SDK with Token
Once you receive the token, configure it for subsequent API calls:The token is automatically included in the
Authorization header as Bearer {token} for all authenticated endpoints.Bearer Token Usage
After configuration, the SDK automatically adds the bearer token to all API requests. Here’s how it works internally (fromBasicApi.php:616-619):
Complete Example
Here’s a full workflow from authentication to making an API call:Token Management
TheConfiguration class provides methods for managing access tokens:
Security Best Practices
- Store tokens in environment variables or secure configuration files
- Use HTTPS for all API communications
- Implement token refresh logic if your tokens expire
- Never log or display tokens in production environments
Next Steps
- Configuration - Learn about SDK configuration options
- Error Handling - Handle authentication errors properly