Method: projects.locations.collections.engines.sessions.removeContextFile

Removes a context file from a session.

HTTP request


POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}:removeContextFile

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The name of the session.

Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}

Request body

The request body contains data with the following structure:

JSON representation
{
  "fileId": string,
  "metadata": {
    string: string,
    ...
  }
}
Fields
fileId

string

Required. The ID of the context file.

metadata

map (key: string, value: string)

Optional. client-supplied metadata about the file. Mirrors the metadata map on UploadSessionFileRequest. Keys follow AIP-148 shape (lowercase letters, digits, -; no dots or DNS-style namespace prefix). Used today to dispatch the Sobi user-supplied artifact branch (sobi-scope = SOBI_ARTIFACT), which carries sobi-agent-id, sobi-task-id, and sobi-filename off-URL because the delete happens outside any session context.

Response body

If successful, the response body is empty.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • discoveryengine.sessions.removeContextFile

For more information, see the IAM documentation.