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

# Update Assistant Version

> Promote an assistant provider version to the active assistant version.

Updates the active provider version for an assistant. Use this after creating a provider with [Create assistant provider](https://doc.rapida.ai/api-reference/assistant/create-assistant-provider.md).

> [!NOTE]
>
> For setup and authentication options, see the [Installation guide](https://doc.rapida.ai/api-reference/installation.md) and [Authentication](https://doc.rapida.ai/api-reference/authentication.md).

## Parameters

**connectionConfig** `ConnectionConfig` *required*

Configuration for the client connection.

**request** `UpdateAssistantVersionRequest` *required*

Provider version to promote.

**assistantId** `uint64` *required*

Assistant ID to update.

**assistantProviderId** `uint64` *required*

Provider version ID to make active.

**assistantProvider** `string` *required*

Provider type for the version. Use `MODEL`, `AGENTKIT`, or `WEBSOCKET`.

## Usage

```ts React theme={null}
import {
  ConnectionConfig,
  UpdateAssistantVersion,
  UpdateAssistantVersionRequest,
} from "@rapidaai/react";

const auth = ConnectionConfig.WithDebugger({
  authorization: "AUTHORIZATION_TOKEN_PLACEHOLDER",
  userId: "AUTH_ID_PLACEHOLDER",
  projectId: "PROJECT_ID_PLACEHOLDER",
});
const connectionCfg = ConnectionConfig.DefaultConnectionConfig(auth);

const request = new UpdateAssistantVersionRequest();
request.setAssistantid("ASSISTANT_ID_PLACEHOLDER");
request.setAssistantproviderid("PROVIDER_VERSION_ID_PLACEHOLDER");
request.setAssistantprovider("AGENTKIT");

const response = await UpdateAssistantVersion(connectionCfg, request);
console.dir(response.toObject());
```

```javascript Node.js theme={null}
import {
  ConnectionConfig,
  UpdateAssistantVersion,
  UpdateAssistantVersionRequest,
} from "@rapidaai/nodejs";

const auth = ConnectionConfig.WithDebugger({
  authorization: process.env.RAPIDA_AUTHORIZATION,
  userId: process.env.RAPIDA_AUTH_ID,
  projectId: process.env.RAPIDA_PROJECT_ID,
});
const connectionCfg = ConnectionConfig.DefaultConnectionConfig(auth);

const request = new UpdateAssistantVersionRequest();
request.setAssistantid(process.env.RAPIDA_ASSISTANT_ID);
request.setAssistantproviderid(process.env.RAPIDA_PROVIDER_VERSION_ID);
request.setAssistantprovider("AGENTKIT");

try {
  const response = await UpdateAssistantVersion(connectionCfg, request);
  console.dir(response.toObject());
} catch (error) {
  console.error("Error with UpdateAssistantVersion call:", error);
}
```

```python Python theme={null}
import os
from pprint import pprint

from rapida import (
    ConnectionConfig,
    UpdateAssistantVersionRequest,
    update_assistant_version,
)

auth = ConnectionConfig.with_debugger(
    authorization=os.getenv("RAPIDA_AUTHORIZATION"),
    user_id=os.getenv("RAPIDA_AUTH_ID"),
    project_id=os.getenv("RAPIDA_PROJECT_ID"),
)
connection_config = ConnectionConfig.default_connection_config(auth)

response = update_assistant_version(
    client_cfg=connection_config,
    request=UpdateAssistantVersionRequest(
        assistantId=int(os.getenv("RAPIDA_ASSISTANT_ID")),
        assistantProviderId=int(os.getenv("RAPIDA_PROVIDER_VERSION_ID")),
        assistantProvider="AGENTKIT",
    ),
)
pprint(response)
```

```go Go theme={null}
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/rapidaai/rapida-go/rapida/clients"
	"github.com/rapidaai/rapida-go/rapida/connections"
	protos "github.com/rapidaai/rapida-go/protos"
)

func main() {
	connectionConfig := connections.DefaultconnectionConfig(
		connections.WithPersonalToken(
			os.Getenv("RAPIDA_AUTHORIZATION"),
			os.Getenv("RAPIDA_AUTH_ID"),
			os.Getenv("RAPIDA_PROJECT_ID"),
		),
	)

	request := &protos.UpdateAssistantVersionRequest{
		AssistantId:         2227823180112723968,
		AssistantProviderId: 2230142097179373568,
		AssistantProvider:   "AGENTKIT",
	}

	response, err := clients.UpdateAssistantVersion(context.Background(), connectionConfig, request)
	if err != nil {
		fmt.Printf("error while updating assistant version: %+v\n", err)
		return
	}
	fmt.Printf("update assistant version response: %+v\n", response)
}
```

## Response

**code** `int32`

Numeric status code for the operation.

**success** `boolean`

Indicates whether the operation was successful.

**data** `Assistant`

Updated assistant with the active provider version.

**error** `Error`

Error details when the operation fails.


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