Skip to main content

How to Generate an API key

Written by Abdul Samad
Updated over 2 weeks ago

Overview

This guide explains how to create and manage API keys for programmatic access to your workspace resources. API keys enable automated interactions with TeamAI services through the API.

Learning Objectives:

  • Create a personal API key for your workspace

  • Understand API key security best practices

  • Learn where to find API key management settings

Prerequisites

You'll Need:

  • Access to a workspace

  • Administrative or API management permissions

  • Secure location to store your API key


Creating an API Key

Access API Key Settings

  1. Navigate to workspace settings

    • Open your workspace in a web browser (https://[yourdomainslug].teamai.com)

    • Click the settings icon (gear) in the main navigation

    • Select "Workspace Settings" from the dropdown menu

  2. Locate the API keys section

    • In the workspace settings sidebar, click "API keys"

    • This will display the API key management interface


​

Generate a New API Key

  1. Create a new API key

    • Click the "Add Api Key" button

    • Enter a descriptive name for your key (optional)

    • Click "Add APi Key" to generate the key

  2. Securely save your API key

    • Copy the displayed API key immediately

    • Store it in a secure location (password manager recommended)

Important: The API key will only be displayed once at creation time. If you don't copy it immediately, you'll need to generate a new key.

Result: You now have an API key that can be used for programmatic access to your workspace resources.

Store API key safely!

Anyone who has your API key has full control over your account. For security reasons, you cannot view the API key again.


API Key Security

Security Best Practices

  1. Treat API keys like passwords

    • Never share your API key with unauthorized individuals

    • Do not expose keys in public code repositories, client-side code, or logs

    • Store keys in secure environment variables or secrets management systems

  2. Limit API key exposure

    • Create separate keys for different applications or services

    • Use the principle of least privilege when assigning permissions

    • Regularly rotate keys, especially for production environments

Security Advisory: Your API key provides the same level of access as your logged-in account. Protect it accordingly to prevent unauthorized access to your workspace.


Managing Existing API Keys

View and Delete Keys

  1. Access the API keys page

    • Navigate to workspace settings

    • Click "API keys" in the settings menu

  2. Review existing keys

    • View a list of all active API keys

    • Check creation dates

  3. Revoke keys when necessary

    • Click the trash next to any key you wish to disable

    • Confirm the revocation when prompted

Result: The revoked key will immediately become invalid and can no longer be used for API requests.


Common Questions

Q: Can I see my API key after creation?
A: No. For security reasons, API keys are only displayed once at the time of creation. If you lose a key, you'll need to generate a new one and revoke the old key.

Q: What happens if my API key is compromised?
A: Immediately revoke the compromised key from the API keys page and generate a new one. Update all your integrations with the new key.

Q: Do API keys expire automatically?
A: API keys generally do not expire automatically however, It's recommended to rotate keys periodically.
​

Did this answer your question?