> ## AI Agent Context
> Get the complete documentation index at: https://aistudio.google.com/llms.txt
> Use this file to discover all available pages.
> For the full documentation in a single file, fetch: https://aistudio.google.com/llms-full.txt

# Deleting an interaction

{% callout type="note" %}
  You are viewing the beta version of the Interactions API. Endpoints are under `/v1beta/`. The stable [v1 version](/api-reference/interactions-api/delete-interaction?api-version=v1) is also available.

{% /callout %}

{% mark class="http-delete" %}{% icon name="close" /%}`DELETE`{% /mark %} `https://generativelanguage.googleapis.com/v1beta/interactions/{id}`

Deletes the interaction by id.

{% two-column-layout %}
  {% left-column %}
## Parameters  {% class="hide-from-toc" id="parameters" %}

  {% section class="api-ref-property-list" %}
  **api_version**: {% mark %}required{% /mark %} `string`

  API version for request routing.

  {% hr /%}

  **id**: {% mark %}required{% /mark %} `string`

  The unique identifier of the interaction to delete.

  {% hr /%}

  **interactionsId**: {% mark %}required{% /mark %} `string`

  The name of the interaction to delete.

  {% /section %}

  {% /left-column %}

  {% right-column class="sticky" %}
  **Example request** {% class="example-heading" %}

  {% tabs %}
  {% tab label="REST" %}
  ```sh
  curl -X DELETE "https://generativelanguage.googleapis.com/v1beta/interactions/$INTERACTION_ID" \
    -H "x-goog-api-key: $GEMINI_API_KEY"
  ```

  {% /tab %}

  {% tab label="Python" %}
  ```python
  from google import genai
  
  client = genai.Client()
  
  
  client.interactions.delete(id=created.id)
  print("Interaction deleted successfully.")
  ```

  {% /tab %}

  {% tab label="JavaScript" %}
  ```javascript
  import {GoogleGenAI} from '@google/genai';
  
  const ai = new GoogleGenAI({});
  
  
  await ai.interactions.delete(created.id);
  console.log('Interaction deleted successfully.');
  ```

  {% /tab %}

  {% tab label="Java" %}
  ```java
  import com.google.genai.Client;
  import com.google.genai.gaos.models.interactions.Interaction;
  
  Client client = new Client();
  
  
  client.interactions.delete(interactionId);
  System.out.println("Interaction deleted successfully.");
  ```

  {% /tab %}

  {% tab label="Go" %}
  ```go
  package main
  
  import (
      "context"
      "fmt"
      "log"
      "google.golang.org/genai"
      "google.golang.org/genai/interactions/models/operations"
  )
  
  func main() {
      ctx := context.Background()
      client, err := genai.NewClient(ctx, nil)
      if err != nil {
          log.Fatal(err)
      }
  
  
      req := operations.DeleteInteractionRequest{
          ID: interactionID,
      }
  
      _, err = client.Interactions.Delete(
          ctx,
          req,
      )
      if err != nil {
          log.Fatal(err)
      }
  
      fmt.Println("Interaction deleted successfully.")
  }
  ```

  {% /tab %}

  {% /tabs %}

  {% /right-column %}

{% /two-column-layout %}

## Response  {% class="hide-from-toc" id="response" %}

Empty response.

