Delete Session
client.Beta.Sessions.Delete(ctx, sessionID, body) (*BetaManagedAgentsDeletedSession, error)DELETE/v1/sessions/{session_id}
Delete Session
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaManagedAgentsDeletedSession, err := client.Beta.Sessions.Delete(
context.TODO(),
"sesn_011CZkZAtmR3yMPDzynEDxu7",
anthropic.BetaSessionDeleteParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaManagedAgentsDeletedSession.ID)
}{
"id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"type": "session_deleted"
}Returns Examples
{
"id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"type": "session_deleted"
}