MetaAPI Docs
Auth Flow
The user-facing flow is simple: create one auth token, put it into the EA, confirm a new device if needed, then use the same token in your client.
User Steps
- Log in to the web console with your email and password.
- Create one
auth_tokenfor one MT4 or MT5 terminal and set an expiry if you want one. - Paste that
auth_tokeninto the EA settings. - If the machine is new, complete the email verification step shown by the terminal or the web console.
- Use the same
auth_tokenin your external client when calling local/rpcor/ws.
Why The Same Token Is Required
The EA side and the external client side should use the same auth_token. This keeps the local gateway scoped to the terminal the user intentionally exposed.
Without this check, any process that can reach the local port could try to read account data or send trading requests. Matching the token on both sides narrows that access.
What Happens Next
- The terminal starts with the configured
auth_token. - If the machine is already approved, the local API becomes available automatically.
- If it is a new machine, you complete one email verification step.
- After that, your application can use the same token to access local
/rpcand/ws.
What Users Usually See
The dashboard login is only for account management. Users create the auth_token in the console, then put that token into the EA input fields and the external client configuration.
If the device has already been approved before, the terminal usually comes back without any extra action. If it is a new device, the user completes one email verification step and then continues.
How To Confirm It Works
- Open the dashboard and check that the terminal appears as active.
- Make sure the terminal no longer shows an auth or expiry error.
- Send a simple request such as
get_account_infowith the sameauth_token. - If you receive account data, the token and terminal are aligned correctly.
For more detail about token usage, see the dedicated Auth Token page.