## V2beta1 to V2

The V2beta1 API is used to share beta features with Dialogflow users.
This section has advice for switching to the stable V2 API.

> [!IMPORTANT]
> **Important:** The default behavior for enabling machine learning has changed. See details below.

- If you are using REST or RPC, update the endpoint from `dialogflow.googleapis.com/v2beta1/...` to `dialogflow.googleapis.com/v2/...`
- If you are using a [client library](https://docs.cloud.google.com/dialogflow/docs/reference/libraries), update it:
  - **Dynamic languages** (Python, Node.js, Ruby): Upgrade the package, and your code will automatically use the latest stable version.
  - **Static languages** (Java, C#, PHP, Go): Install the new package and update all import statements to reference "v2" instead of "v2beta1".
- The field that controls whether machine learning (ML) is enabled for an `Intent` has changed. The `mlEnabled` field has been removed and replaced by the `mlDisabled` field, and ML is enabled by default.

  | Version | REST | RPC | Default value | Default behavior |
  |---|---|---|---|---|
  | V2beta1 | [mlEnabled](https://docs.cloud.google.com/dialogflow/docs/reference/rest/v2beta1/projects.agent.intents#Intent.FIELDS.ml_enabled) | [ml_enabled](https://docs.cloud.google.com/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2beta1#google.cloud.dialogflow.v2beta1.Intent.FIELDS.bool.google.cloud.dialogflow.v2beta1.Intent.ml_enabled) | true | ML is enabled |
  | V2 | [mlDisabled](https://docs.cloud.google.com/dialogflow/docs/reference/rest/v2/projects.agent.intents#Intent.FIELDS.ml_disabled) | [ml_disabled](https://docs.cloud.google.com/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.Intent.FIELDS.bool.google.cloud.dialogflow.v2.Intent.ml_disabled) | false | ML is enabled |