Skip to main content
Version: Current

Connections.DeleteConnectionAsync

Description​

The API deletes a Connection with the specified ID inside the AI Command Center.

Signature [C#]​

Task<DeletedConnectionStatus> DeleteConnectionAsync(int connectionId);

Properties​

Input​

ParameterTypeRequired / defaultDescription
connectionIdintRequiredId of the connection to be deleted.

Output​

PropertyDescription
Task<DeletedConnectionStatus>Returns deleted connection status.

Remarks​

Use DeleteConnectionAsync API to Delete a Connection inside the connected AI Command Center.

Example​

C#
public async Task DeleteConnection()
{
IControlRoomContext context = LoginControlRoom();
try
{
string connectionName = "demo_connection";
var connection = await context.Connections.GetConnectionByNameAsync(connectionName);
var connectionStatus = await context.Connections.DeleteConnectionAsync(connection.ID);
System.Console.WriteLine("Stauts: " + connectionStatus.Status);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}

See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.