Generate API Keys
API keys are essential for securely authenticating your applications when using the Mecha Developer CLI and REST APIs. Follow this guide to generate your API keys:
1. Navigate to API Keys Section
- Go to Settings in your Mecha account.
- Click on API Keys to open the API key management section.
2. Generate a New API Key
- Click on the Generate Key button to initiate the creation of a new API key.
3. Fill in the API Key Details
A modal will appear with the following fields:
- Key Name: Enter a name for your API key. Note that the key name must start with an alphabet. It cannot begin with a number or a special character.
- Expire In: Choose the expiration period for your API key from the dropdown menu. Options include:
- 7 days
- 30 days
- 90 days
- 180 days
- 365 days
- No Expiry (for keys that don’t expire)
- Description: Add a brief description to remind yourself of what this key will be used for.
4. Generate the API Key
- After entering the required details, click the Generate button.
- The modal will transition to the next step, displaying the API Key ID and Key Secret.
5. Save Your API Key
- Important: You will see the API Key ID and Key Secret, along with copy icons to easily copy the details.
- Make sure to copy and save your personal access token immediately. You will not be able to see this key secret again after closing the modal.
- Once you’ve copied the key, close the modal.
6. View Your API Key
- After closing the modal, the new API key will appear in the list of API Keys under the API Keys section.
- You can generate and manage up to 10 API keys within your account.
Applications of API Keys
-
Mecha Developer CLI: Use your API keys to authenticate and interact with the Mecha Developer CLI. This tool enables you to build custom applications and workflows that integrate seamlessly with Mecha.
Learn how to set up the Developer CLI: [How to install a CLI-101]
-
Mecha REST API: Use your API keys to securely access Mecha's REST APIs, allowing you to automate processes, manage machines, and more.
Learn how to use the REST API: [Understand how to use the REST API]
By following this guide, you can efficiently generate and manage API keys for your Mecha projects, ensuring secure access and integration with your custom tools and applications.