> ## Documentation Index
> Fetch the complete documentation index at: https://doc.evolution-api.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

See the example env file in the [official repository](https://github.com/EvolutionAPI/evolution-api/blob/main/Docker/.env.example).

## Server

| Variable     | Value                                                                                                                   | Example                                                                |
| ------------ | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| SERVER\_TYPE | The type of server (http or https)                                                                                      | http                                                                   |
| SERVER\_PORT | Port on which the server will run                                                                                       | 8080                                                                   |
| SERVER\_URL  | The address for your running server. This address is used to return data from internal requests, such as webhook links. | [https://example.evolution-api.com](https://example.evolution-api.com) |

## Telemetry

| Variable       | Value                                         | Example                                                        |
| -------------- | --------------------------------------------- | -------------------------------------------------------------- |
| TELEMETRY      | Enables or disables telemetry (true or false) | true                                                           |
| TELEMETRY\_URL | URL of the telemetry server                   | [https://telemetry.example.com](https://telemetry.example.com) |

## CORS

| Variable          | Value                                                                                          | Example             |
| ----------------- | ---------------------------------------------------------------------------------------------- | ------------------- |
| CORS\_ORIGIN      | Allowed origins for the API, separated by commas (use "\*" to accept requests from any origin) | \*                  |
| CORS\_METHODS     | Allowed HTTP methods, separated by commas                                                      | GET,POST,PUT,DELETE |
| CORS\_CREDENTIALS | Permission for cookies in requests (true or false)                                             | true                |

## Logs

| Variable     | Value                                                                                          | Example                                         |
| ------------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| LOG\_LEVEL   | Logs that will be displayed among: ERROR, WARN, DEBUG, INFO, LOG, VERBOSE, DARK, WEBHOOKS      | ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS |
| LOG\_COLOR   | Whether or not to show colors in Logs (true or false)                                          | true                                            |
| LOG\_BAILEYS | Which Baileys logs will be displayed among: "fatal", "error", "warn", "info", "debug", "trace" | error                                           |

## Instances

| Variable      | Value                                                                                         | Example |
| ------------- | --------------------------------------------------------------------------------------------- | ------- |
| DEL\_INSTANCE | In how many minutes an instance will be deleted if not connected. Use "false" to never delete | false   |

## Persistent Storage

| Variable                           | Value                                                                                                               | Example                                                        |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| DATABASE\_ENABLED                  | Whether persistent storage is enabled (true or false)                                                               | true                                                           |
| DATABASE\_PROVIDER                 | Database provider (postgresql or mysql)                                                                             | postgresql                                                     |
| DATABASE\_CONNECTION\_URI          | The database connection URI                                                                                         | postgresql://user:pass\@localhost:5432/evolution?schema=public |
| DATABASE\_CONNECTION\_CLIENT\_NAME | Client name for the database connection, used to separate one API installation from another using the same database | evolution\_exchange                                            |

### Which data will be saved (true or false)

| Variable                           | Value                 |
| ---------------------------------- | --------------------- |
| DATABASE\_SAVE\_DATA\_INSTANCE     | Saves instance data   |
| DATABASE\_SAVE\_DATA\_NEW\_MESSAGE | Saves new messages    |
| DATABASE\_SAVE\_MESSAGE\_UPDATE    | Saves message updates |
| DATABASE\_SAVE\_DATA\_CONTACTS     | Saves contacts        |
| DATABASE\_SAVE\_DATA\_CHATS        | Saves chats           |
| DATABASE\_SAVE\_DATA\_LABELS       | Saves labels          |
| DATABASE\_SAVE\_DATA\_HISTORIC     | Saves event history   |

## RabbitMQ

| Variable                  | Value                                     | Example           |
| ------------------------- | ----------------------------------------- | ----------------- |
| RABBITMQ\_ENABLED         | Enables RabbitMQ (true or false)          | false             |
| RABBITMQ\_URI             | RabbitMQ connection URI                   | amqp\://localhost |
| RABBITMQ\_EXCHANGE\_NAME  | Exchange name                             | evolution         |
| RABBITMQ\_GLOBAL\_ENABLED | Enables RabbitMQ globally (true or false) | false             |

### Choose the events you want to send to RabbitMQ

| Variable                                      | Value                                                                                   | Example |
| --------------------------------------------- | --------------------------------------------------------------------------------------- | ------- |
| RABBITMQ\_EVENTS\_APPLICATION\_STARTUP        | Sends an event on app startup (true or false)                                           | false   |
| RABBITMQ\_EVENTS\_INSTANCE\_CREATE            | Sends instance creation events (true or false)                                          | false   |
| RABBITMQ\_EVENTS\_INSTANCE\_DELETE            | Sends instance deletion events (true or false)                                          | false   |
| RABBITMQ\_EVENTS\_QRCODE\_UPDATED             | Sends QR Code update events (true or false)                                             | false   |
| RABBITMQ\_EVENTS\_MESSAGES\_SET               | Sends message creation events (message retrieval) (true or false)                       | false   |
| RABBITMQ\_EVENTS\_MESSAGES\_UPSERT            | Sends message receipt events (true or false)                                            | false   |
| RABBITMQ\_EVENTS\_MESSAGES\_EDITED            | Sends message editing events (true or false)                                            | false   |
| RABBITMQ\_EVENTS\_MESSAGES\_UPDATE            | Sends message update events (true or false)                                             | false   |
| RABBITMQ\_EVENTS\_MESSAGES\_DELETE            | Sends message deletion events (true or false)                                           | false   |
| RABBITMQ\_EVENTS\_SEND\_MESSAGE               | Sends message sending events (true or false)                                            | false   |
| RABBITMQ\_EVENTS\_CONTACTS\_SET               | Sends contact creation events (true or false)                                           | false   |
| RABBITMQ\_EVENTS\_CONTACTS\_UPSERT            | Sends contact retrieval events (true or false)                                          | false   |
| RABBITMQ\_EVENTS\_CONTACTS\_UPDATE            | Sends contact update events (true or false)                                             | false   |
| RABBITMQ\_EVENTS\_PRESENCE\_UPDATE            | Sends presence update events ("typing..." or "recording...") (true or false)            | false   |
| RABBITMQ\_EVENTS\_CHATS\_SET                  | Sends chat creation events (chat retrieval) (true or false)                             | false   |
| RABBITMQ\_EVENTS\_CHATS\_UPSERT               | Sends chat creation events (receiving or sending messages in new chats) (true or false) | false   |
| RABBITMQ\_EVENTS\_CHATS\_UPDATE               | Sends chat update events (true or false)                                                | false   |
| RABBITMQ\_EVENTS\_CHATS\_DELETE               | Sends chat deletion events (true or false)                                              | false   |
| RABBITMQ\_EVENTS\_GROUPS\_UPSERT              | Sends group creation events (true or false)                                             | false   |
| RABBITMQ\_EVENTS\_GROUP\_UPDATE               | Sends group update events (true or false)                                               | false   |
| RABBITMQ\_EVENTS\_GROUP\_PARTICIPANTS\_UPDATE | Sends group participant update events (true or false)                                   | false   |
| RABBITMQ\_EVENTS\_CONNECTION\_UPDATE          | Sends connection update events (true or false)                                          | false   |
| RABBITMQ\_EVENTS\_CALL                        | Sends call events (true or false)                                                       | false   |
| RABBITMQ\_EVENTS\_TYPEBOT\_START              | Sends Typebot flow start events (true or false)                                         | false   |
| RABBITMQ\_EVENTS\_TYPEBOT\_CHANGE\_STATUS     | Sends Typebot status update events (true or false)                                      | false   |

## SQS

| Variable                 | Value                                  | Example |
| ------------------------ | -------------------------------------- | ------- |
| SQS\_ENABLED             | Whether SQS is enabled (true or false) | false   |
| SQS\_ACCESS\_KEY\_ID     | SQS key ID                             | -       |
| SQS\_SECRET\_ACCESS\_KEY | Access key                             | -       |
| SQS\_ACCOUNT\_ID         | Account ID                             | -       |
| SQS\_REGION              | SQS region                             | -       |

## WebSocket

| Variable                  | Value                                              | Example |
| ------------------------- | -------------------------------------------------- | ------- |
| WEBSOCKET\_ENABLED        | Enables WebSocket (true or false)                  | false   |
| WEBSOCKET\_GLOBAL\_EVENTS | Enables global events in WebSocket (true or false) | false   |

## WhatsApp Business API

| Variable                     | Value                                                  | Example                                                  |
| ---------------------------- | ------------------------------------------------------ | -------------------------------------------------------- |
| WA\_BUSINESS\_TOKEN\_WEBHOOK | Token used to validate the webhook in the Facebook APP | evolution                                                |
| WA\_BUSINESS\_URL            | WhatsApp Business API URL                              | [https://graph.facebook.com](https://graph.facebook.com) |
| WA\_BUSINESS\_VERSION        | WhatsApp Business API version                          | v20.0                                                    |
| WA\_BUSINESS\_LANGUAGE       | WhatsApp Business API language                         | en\_US                                                   |

## Global Webhook

| Variable                             | Value                                                                                     | Example                                                    |
| ------------------------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| WEBHOOK\_GLOBAL\_ENABLED             | Whether webhooks are globally enabled (true or false)                                     | false                                                      |
| WEBHOOK\_GLOBAL\_URL                 | URL that will receive webhook requests                                                    | [https://webhook.example.com](https://webhook.example.com) |
| WEBHOOK\_GLOBAL\_WEBHOOK\_BY\_EVENTS | Enables webhook by event, respecting the global URL and each event's name (true or false) | false                                                      |

### Webhook events with true or false value

| Variable                                     |
| -------------------------------------------- |
| WEBHOOK\_EVENTS\_APPLICATION\_STARTUP        |
| WEBHOOK\_EVENTS\_QRCODE\_UPDATED             |
| WEBHOOK\_EVENTS\_MESSAGES\_SET               |
| WEBHOOK\_EVENTS\_MESSAGES\_UPSERT            |
| WEBHOOK\_EVENTS\_MESSAGES\_EDITED            |
| WEBHOOK\_EVENTS\_MESSAGES\_UPDATE            |
| WEBHOOK\_EVENTS\_MESSAGES\_DELETE            |
| WEBHOOK\_EVENTS\_SEND\_MESSAGE               |
| WEBHOOK\_EVENTS\_CONTACTS\_SET               |
| WEBHOOK\_EVENTS\_CONTACTS\_UPSERT            |
| WEBHOOK\_EVENTS\_CONTACTS\_UPDATE            |
| WEBHOOK\_EVENTS\_PRESENCE\_UPDATE            |
| WEBHOOK\_EVENTS\_CHATS\_SET                  |
| WEBHOOK\_EVENTS\_CHATS\_UPSERT               |
| WEBHOOK\_EVENTS\_CHATS\_UPDATE               |
| WEBHOOK\_EVENTS\_CHATS\_DELETE               |
| WEBHOOK\_EVENTS\_GROUPS\_UPSERT              |
| WEBHOOK\_EVENTS\_GROUPS\_UPDATE              |
| WEBHOOK\_EVENTS\_GROUP\_PARTICIPANTS\_UPDATE |
| WEBHOOK\_EVENTS\_CONNECTION\_UPDATE          |
| WEBHOOK\_EVENTS\_LABELS\_EDIT                |
| WEBHOOK\_EVENTS\_LABELS\_ASSOCIATION         |
| WEBHOOK\_EVENTS\_CALL                        |
| WEBHOOK\_EVENTS\_TYPEBOT\_START              |
| WEBHOOK\_EVENTS\_TYPEBOT\_CHANGE\_STATUS     |
| WEBHOOK\_EVENTS\_ERRORS                      |
| WEBHOOK\_EVENTS\_ERRORS\_WEBHOOK             |

## Session Configurations

| Variable                       | Value                                                    | Example       |
| ------------------------------ | -------------------------------------------------------- | ------------- |
| CONFIG\_SESSION\_PHONE\_CLIENT | Name that will be displayed on the smartphone connection | Evolution API |
| CONFIG\_SESSION\_PHONE\_NAME   | Browser name (Chrome, Firefox, Edge, Opera, Safari)      | Chrome        |

## QR Code

| Variable      | Value                          | Example |
| ------------- | ------------------------------ | ------- |
| QRCODE\_LIMIT | How long the QR code will last | 30      |
| QRCODE\_COLOR | Color of the generated QR code | #175197 |

## Typebot

| Variable              | Value              | Example |
| --------------------- | ------------------ | ------- |
| TYPEBOT\_API\_VERSION | API version (fixed |         |

version or latest) | latest |

## Chatwoot

| Variable                                      | Value                                                                                               | Example                                                        |
| --------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| CHATWOOT\_ENABLED                             | Enables integration with Chatwoot (true or false)                                                   | false                                                          |
| CHATWOOT\_MESSAGE\_READ                       | Marks the client's last WhatsApp message as read when sending a message in Chatwoot (true or false) | true                                                           |
| CHATWOOT\_MESSAGE\_DELETE                     | Deletes the message in Chatwoot when deleted in WhatsApp (true or false)                            | true                                                           |
| CHATWOOT\_IMPORT\_DATABASE\_CONNECTION\_URI   | Database connection URI for Chatwoot to import messages                                             | postgresql://user:password\@host:5432/chatwoot?sslmode=disable |
| CHATWOOT\_IMPORT\_PLACEHOLDER\_MEDIA\_MESSAGE | Imports media messages as a placeholder in Chatwoot (true or false)                                 | true                                                           |

## OpenAI

| Variable        | Value                                           | Example |
| --------------- | ----------------------------------------------- | ------- |
| OPENAI\_ENABLED | Enables integration with OpenAI (true or false) | false   |

## Dify

| Variable      | Value                                         | Example |
| ------------- | --------------------------------------------- | ------- |
| DIFY\_ENABLED | Enables integration with Dify (true or false) | false   |

## Cache

| Variable                      | Value                                                                              | Example                   |
| ----------------------------- | ---------------------------------------------------------------------------------- | ------------------------- |
| CACHE\_REDIS\_ENABLED         | Enables Redis cache (true or false)                                                | true                      |
| CACHE\_REDIS\_URI             | Redis connection URI                                                               | redis\://localhost:6379/6 |
| CACHE\_REDIS\_PREFIX\_KEY     | Prefix to differentiate data from one installation to another using the same Redis | evolution                 |
| CACHE\_REDIS\_SAVE\_INSTANCES | Saves WhatsApp connection credentials in Redis (true or false)                     | false                     |
| CACHE\_LOCAL\_ENABLED         | Enables local in-memory cache as an alternative to Redis (true or false)           | false                     |

## Amazon S3 / MinIO

| Variable        | Value                                      | Example          |
| --------------- | ------------------------------------------ | ---------------- |
| S3\_ENABLED     | Enables storage on S3 (true or false)      | false            |
| S3\_ACCESS\_KEY | S3 access key                              | -                |
| S3\_SECRET\_KEY | S3 secret key                              | -                |
| S3\_BUCKET      | S3 bucket name                             | evolution        |
| S3\_PORT        | S3 connection port                         | 443              |
| S3\_ENDPOINT    | S3 (or MinIO) endpoint                     | s3.amazonaws.com |
| S3\_USE\_SSL    | Uses SSL for S3 connection (true or false) | true             |

## Authentication

| Variable                                     | Value                                                 | Example                          |
| -------------------------------------------- | ----------------------------------------------------- | -------------------------------- |
| AUTHENTICATION\_API\_KEY                     | API key used for global authentication                | 429683C4C977415CAAFCCE10F7D57E11 |
| AUTHENTICATION\_EXPOSE\_IN\_FETCH\_INSTANCES | Shows instances in the fetch endpoint (true or false) | true                             |

## Language

| Variable | Value        | Example |
| -------- | ------------ | ------- |
| LANGUAGE | API language | en      |
