An API token is tied to a particular project in Leap. If you are in multiple projects, Leap manages these tokens for you automatically as you switch between projects and workspaces. Before we look at how this happens, let's look at the situations where you would want to update or add a new token to the Leap IDE.
- You upgraded your account to get more time and, as a result, have a new token
- You reset your token on the Dashboard
- You have multiple tokens because you are in multiple projects
Upgraded Account or Token Reset
If you upgraded your account or clicked on 'Reset Token' on the Leap dashboard, your account will have a new API token. The Leap IDE periodically pulls in your API token, so if you reset your token the change will propagate to any active Leap IDE sessions shortly after. If this doesn't happen, check out How does API token management work in the Leap IDE?
If you are part of multiple projects you will have multiple tokens - one token per project. Each new workspace you create is 'pinned' to the project that's active when the workspace is created. This way the Leap IDE knows which project to deduct time from when you run a problem.
The active project is shown in your dashboard. For example, if I see Project: Developer in my dashboard I know that new projects will use my Developer token. The only time this isn't true is when you have environment variables set in the IDE. Setting your DWAVE_API_TOKEN with the token you want to use can be handy for overriding the automatic token management behavior, but if you want to take full advantage of this new feature follow the steps in How does API token management work in the Leap IDE?
See also the Leap IDE User Guide.