# Environment Variables (.env) APIs

> Manage bot environment variables, API secrets, and configuration keys securely.

**Category:** REST API Reference  
**URL:** https://docs.botlify.cloud/?page=api-env  
**Platform:** Botlify Cloud (https://botlify.cloud)  

---

## 1. Get Environment Variables (get_env)

      

Action: `get_env`
      Parameters: `bot_id`
      Returns a key-value dictionary of environment variables.

      

## 2. Set Single Variable (set_env_variable)

      

Action: `set_env_variable` or `set_env_var`
      Parameters: `bot_id`, `key`, `value`

      
```php
curl -X POST https://botlify.cloud/user_api.php   -H "X-API-KEY: YOUR_KEY"   -H "Content-Type: application/json"   -d '{
    "action": "set_env_variable",
    "bot_id": 14,
    "key": "PAYMENT_API_KEY",
    "value": "sk_live_9876543210"
  }'
```

      

## 3. Delete Variable (delete_env_variable)

      

Action: `delete_env_variable`
      Parameters: `bot_id`, `key`
