> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetzy.es/llms.txt
> Use this file to discover all available pages before exploring further.

# API Tokens

> Create and manage secure API tokens for programmatic access to Meetzy's platform

API tokens provide secure, programmatic access to Meetzy's platform without requiring user credentials. These tokens act as secret keys that authenticate your applications and services.

<Warning>
  Never share API tokens or expose them in client-side code. Treat them like passwords and store them securely in your server environment.
</Warning>

## Accessing Token Manager

Navigate to your account settings to manage API tokens:

<Steps>
  <Step title="Open Account Menu">
    Click on your profile avatar in the top-right corner of the dashboard
  </Step>

  <Step title="Select Account Settings">
    Choose "Account Settings" from the dropdown menu
  </Step>

  <Step title="Access Token Manager">
    Click on the "API Tokens" tab to view your token management interface
  </Step>
</Steps>

## Creating a New Token

<Steps>
  <Step title="Click New Token">
    Click the "New Token" button in the token manager interface
  </Step>

  <Step title="Enter Token Details">
    Provide a descriptive name for your token (e.g., "Production API", "Analytics Service")
  </Step>

  <Step title="Set Expiration Period">
    Choose an expiration timeframe:

    * **30 days** - Short-term testing
    * **90 days** - Medium-term projects
    * **6 months** - Long-term integrations
    * **1 year** - Annual renewals
    * **No expiration (4 years)** - Permanent access
  </Step>

  <Step title="Generate Token">
    Click "Create Token" to generate your new API token
  </Step>

  <Step title="Copy Token Securely">
    **Important**: Copy the token immediately. For security reasons, the full token value will never be displayed again
  </Step>
</Steps>

<Info>
  Choose expiration periods based on your security requirements. Shorter expiration periods are more secure but require more frequent renewal.
</Info>

## Token Security Best Practices

### Storage Guidelines

* Store tokens in environment variables, not in code
* Use secure secret management services in production
* Never commit tokens to version control systems
* Rotate tokens regularly based on your security policy

### Access Control

* Create separate tokens for different applications or environments
* Use descriptive names to easily identify token purposes
* Revoke unused or compromised tokens immediately
* Monitor token usage through API logs

### Environment Separation

```bash theme={null}
# Development environment
MEETZY_API_TOKEN=your_dev_token_here

# Production environment  
MEETZY_API_TOKEN=your_prod_token_here
```

## Using API Tokens

### HTTP Headers

Include your API token in the Authorization header of your requests:

```bash theme={null}
curl -H "Authorization: Bearer your_api_token_here" \
     https://api.meetzy.ai/v1/assistants
```

### Code Examples

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={null}
    const headers = {
      'Authorization': `Bearer ${process.env.MEETZY_API_TOKEN}`,
      'Content-Type': 'application/json'
    };

    fetch('https://api.meetzy.ai/v1/assistants', { headers })
      .then(response => response.json())
      .then(data => console.log(data));
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import os
    import requests

    headers = {
        'Authorization': f'Bearer {os.getenv("MEETZY_API_TOKEN")}',
        'Content-Type': 'application/json'
    }

    response = requests.get('https://api.meetzy.ai/v1/assistants', headers=headers)
    data = response.json()
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X GET \
      -H "Authorization: Bearer $MEETZY_API_TOKEN" \
      -H "Content-Type: application/json" \
      https://api.meetzy.ai/v1/assistants
    ```
  </Tab>
</Tabs>

## Managing Existing Tokens

### Viewing Token Information

Your token list displays:

* **Token Name** - The descriptive name you assigned
* **Masked Value** - First 24 characters + masked remainder for identification
* **Expiration Date** - When the token will expire
* **Status** - Active/Expired indicator

### Copying Token Values

<Steps>
  <Step title="Locate Your Token">
    Find the token you need in your token list
  </Step>

  <Step title="Click Copy Button">
    Hover over the token row and click the "Copy" button that appears
  </Step>

  <Step title="Verify Copy Success">
    The button will briefly show "Copied!" to confirm the action
  </Step>
</Steps>

<Warning>
  You can only copy the full token value if you've just created it. For existing tokens, only the masked version is available for security.
</Warning>

## Revoking Access

When you need to revoke a token:

<Steps>
  <Step title="Identify the Token">
    Locate the token you want to revoke in your token list
  </Step>

  <Step title="Click Delete Button">
    Hover over the token row and click the trash icon
  </Step>

  <Step title="Confirm Revocation">
    Confirm the action in the popup dialog
  </Step>

  <Step title="Update Your Applications">
    Remove or replace the revoked token in any applications using it
  </Step>
</Steps>

<Info>
  Revoked tokens stop working immediately. Make sure to update any applications or services using the token before revoking it.
</Info>

## Token Expiration Handling

### Monitoring Expiration

* Check expiration dates regularly in the token manager
* Set calendar reminders before tokens expire
* Monitor your application logs for authentication errors

### Renewal Process

<Steps>
  <Step title="Create New Token">
    Generate a new token before the old one expires
  </Step>

  <Step title="Update Applications">
    Replace the old token in your applications with the new one
  </Step>

  <Step title="Test Integration">
    Verify that your applications work with the new token
  </Step>

  <Step title="Revoke Old Token">
    Once confirmed working, revoke the expired/old token
  </Step>
</Steps>

## Troubleshooting

### Authentication Errors

If you receive 401 Unauthorized errors:

* Verify the token is correctly included in the Authorization header
* Check that the token hasn't expired
* Ensure there are no extra spaces or characters in the token value

### Token Not Working

* Confirm you're using the complete token value
* Verify the token hasn't been revoked
* Check that your account has the necessary permissions for the API endpoint

### Rate Limiting

API tokens are subject to rate limits:

* Implement exponential backoff for retries
* Monitor response headers for rate limit information
* Consider caching responses when appropriate
