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

# Change Default Language API

[Back to API List](https://koreai.mintlify.site/ai-for-service/apis/automation/api-list)

This API allows you to update the default NLU language for an app using the botId.

| Field | Value |
| - | - |
| **Method** | POST |
| **Endpoint** | `https://{{host}}/api/1.1/public/bot/{{botId}}/defaultLanguage` |
| **Content Type** | `application/json` |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token](https://koreai.mintlify.site/ai-for-service/apis/automation/api-introduction.md#generating-the-jwt-token). |
| **API Scope** | App Settings: Language Management; Admin Console: Language Settings > Language Management |

## Path Parameters

| Parameter | Required | Description |
| - | - | - |
| `host` | Yes | The environment URL. For example, `https://platform.kore.ai`. |
| `botId` | Yes | Bot ID or Stream ID. You can access it from the App Settings page. |

## Sample Request

```bash theme={null}
curl --location 'https://{{host}}/api/1.1/public/bot/st-5ac72231-5a37-5b71-bb1e-1be02ef0xxxx/defaultLanguage' \
--header 'Content-Type: application/json' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--data '{
"Language": "en"
}'
```

## Body Parameters

| Parameter | Description | Required |
| - | - | - |
| `languageCode` | The ISO language code, for example `en-US` for American English or `es-ES` for Spanish. | Required |

## Sample Response

### Success Response

```json theme={null}
{
  "status": "success",
  "message": "Default language has been updated successfully.",
  "language code": "en-US"
}
```

### Error Responses

**Scenario 1**: Missing scope from the app.

```json theme={null}
{
  "errors": [{
    "message": "Permission denied. Scope is incorrect!",
    "code": 4002
  }]
}
```

**Scenario 2**: Language not configured.

```text theme={null}
Can't set default language. The language '{{language code}}' isn't currently configured.
Please configure the language and publish the app at least once before setting it as the default.
```

**Scenario 3**: Language already set as default.

```text theme={null}
Permission denied. The language '{{language code}}' is already set as the default language.
```

**Scenario 4**: Language is disabled.

```text theme={null}
Unable to change the default language. The language '{{language code}}' is currently disabled.
Please enable the language before setting it as the default.
```

**Scenario 5**: App not published for the language.

```json theme={null}
{
  "status": "Error",
  "message": "Unable to set default language. Please perform a full publish of the app, including all content for {{language code}}, before setting it as the default language."
}
```

**Scenario 6**: Invalid language code.

```text theme={null}
Error message: Please provide the valid language code.
```

> [!NOTE]
>
> * There is no rollback once the API execution is complete.
> * No publishing is required to display the default language in published mode.
> * Once the API is executed, the default language is reflected immediately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.