---
title: "POST /v1/{+name}:appendEvent"
method: POST
path: "/v1/{+name}:appendEvent"
tags: ["projects"]
---

# POST /v1/{+name}:appendEvent

`POST /v1/{+name}:appendEvent`

Appends an event to a given session.

## Path parameters

- `name` string, required

## Request body

- GoogleCloudAiplatformV1SessionEvent — An event represents a message from either the user or agent.
  - `author` string — Required. The name of the agent that sent the event, or user.
  - `timestamp` string, google-datetime — Required. Timestamp when the event was created on client side.
  - `errorCode` string — Optional. Error code if the response is an error. Code varies by model.
  - `errorMessage` string — Optional. Error message if the response is an error.
  - `content` GoogleCloudAiplatformV1Content — The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
    - `parts` GoogleCloudAiplatformV1Part[] — Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      - `fileData` GoogleCloudAiplatformV1FileData — URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage.
        - `mimeType` string — Required. The IANA standard MIME type of the source data.
        - `fileUri` string — Required. The URI of the file in Google Cloud Storage.
        - `displayName` string — Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
      - `executableCode` GoogleCloudAiplatformV1ExecutableCode — Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated.
        - `language` 'LANGUAGE_UNSPECIFIED' | 'PYTHON' — Required. Programming language of the `code`.
        - `code` string — Required. The code to be executed.
      - `codeExecutionResult` GoogleCloudAiplatformV1CodeExecutionResult — Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used.
        - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_OK' | 'OUTCOME_FAILED' | 'OUTCOME_DEADLINE_EXCEEDED' — Required. Outcome of the code execution.
        - `output` string — Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
      - `functionResponse` GoogleCloudAiplatformV1FunctionResponse — The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction.
        - `name` string — Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name.
        - `response` object — Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
        - `parts` GoogleCloudAiplatformV1FunctionResponsePart[] — Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
          - `inlineData` GoogleCloudAiplatformV1FunctionResponseBlob — Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field.
            - `mimeType` string — Required. The IANA standard MIME type of the source data.
            - `displayName` string — Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
            - `data` string, byte — Required. Raw bytes.
          - `fileData` GoogleCloudAiplatformV1FunctionResponseFileData — URI based data for function response.
            - `mimeType` string — Required. The IANA standard MIME type of the source data.
            - `fileUri` string — Required. URI.
            - `displayName` string — Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
        - `scheduling` 'SCHEDULING_UNSPECIFIED' | 'SILENT' | 'WHEN_IDLE' | 'INTERRUPT' — Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
      - `mediaResolution` GoogleCloudAiplatformV1PartMediaResolution — per part media resolution. Media resolution for the input media.
        - `level` 'MEDIA_RESOLUTION_UNSPECIFIED' | 'MEDIA_RESOLUTION_LOW' | 'MEDIA_RESOLUTION_MEDIUM' | 'MEDIA_RESOLUTION_HIGH' | 'MEDIA_RESOLUTION_ULTRA_HIGH' — The tokenization quality used for given media.
      - `thought` boolean — Optional. Indicates whether the `part` represents the model's thought process or reasoning.
      - `text` string — Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.
      - `functionCall` GoogleCloudAiplatformV1FunctionCall — A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values.
        - `name` string — Optional. The name of the function to call. Matches FunctionDeclaration.name.
        - `willContinue` boolean — Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow.
        - `args` object — Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details.
        - `partialArgs` GoogleCloudAiplatformV1PartialArg[] — Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally.
          - `stringValue` string — Optional. Represents a string value.
          - `numberValue` number, double — Optional. Represents a double value.
          - `willContinue` boolean — Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
          - `jsonPath` string — Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
          - `boolValue` boolean — Optional. Represents a boolean value.
          - `nullValue` 'NULL_VALUE' — Optional. Represents a null value.
      - `thoughtSignature` string, byte — Optional. An opaque signature for the thought so it can be reused in subsequent requests.
      - `inlineData` GoogleCloudAiplatformV1Blob — A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video.
        - `data` string, byte — Required. The raw bytes of the data.
        - `mimeType` string — Required. The IANA standard MIME type of the source data.
        - `displayName` string — Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
      - `videoMetadata` GoogleCloudAiplatformV1VideoMetadata — Provides metadata for a video, including the start and end offsets for clipping and the frame rate.
        - `fps` number, double — Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
        - `startOffset` string, google-duration — Optional. The start offset of the video.
        - `endOffset` string, google-duration — Optional. The end offset of the video.
    - `role` string — Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
  - `name` string — Identifier. The resource name of the event. Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
  - `actions` GoogleCloudAiplatformV1EventActions — Actions are parts of events that are executed by the agent.
    - `skipSummarization` boolean — Optional. If true, it won't call model to summarize function response. Only used for function_response event.
    - `artifactDelta` object — Optional. Indicates that the event is updating an artifact. key is the filename, value is the version.
    - `transferAgent` string — Optional. If set, the event transfers to the specified agent.
    - `stateDelta` object — Optional. Indicates that the event is updating the state with the given delta.
    - `requestedAuthConfigs` object — Optional. Will only be set by a tool response indicating tool request euc. Struct key is the function call id since one function call response (from model) could correspond to multiple function calls. Struct value is the required auth config, which can be another struct.
    - `escalate` boolean — Optional. The agent is escalating to a higher level agent.
  - `invocationId` string — Required. The invocation id of the event, multiple events can have the same invocation id.
  - `eventMetadata` GoogleCloudAiplatformV1EventMetadata — Metadata relating to a LLM response event.
    - `customMetadata` object — The custom metadata of the LlmResponse.
    - `groundingMetadata` GoogleCloudAiplatformV1GroundingMetadata — Information about the sources that support the content of a response. When grounding is enabled, the model returns citations for claims in the response. This object contains the retrieved sources.
      - `sourceFlaggingUris` GoogleCloudAiplatformV1GroundingMetadataSourceFlaggingUri[] — Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps.
        - `sourceId` string — The ID of the place or review.
        - `flagContentUri` string — The URI that can be used to flag the content.
      - `searchEntryPoint` GoogleCloudAiplatformV1SearchEntryPoint — An entry point for displaying Google Search results. A `SearchEntryPoint` is populated when the grounding source for a model's response is Google Search. It provides information that you can use to display the search results in your application.
        - `renderedContent` string — Optional. An HTML snippet that can be embedded in a web page or an application's webview. This snippet displays a search result, including the title, URL, and a brief description of the search result.
        - `sdkBlob` string, byte — Optional. A base64-encoded JSON object that contains a list of search queries and their corresponding search URLs. This information can be used to build a custom search UI.
      - `retrievalMetadata` GoogleCloudAiplatformV1RetrievalMetadata — Metadata related to the retrieval grounding source. This is part of the `GroundingMetadata` returned when grounding is enabled.
        - `googleSearchDynamicRetrievalScore` number, float — Optional. A score indicating how likely it is that a Google Search query could help answer the prompt. The score is in the range of `[0, 1]`. A score of 1 means the model is confident that a search will be helpful, and 0 means it is not. This score is populated only when Google Search grounding and dynamic retrieval are enabled. The score is used to determine whether to trigger a search.
      - `webSearchQueries` string[] — Optional. The web search queries that were used to generate the content. This field is populated only when the grounding source is Google Search.
      - `imageSearchQueries` string[] — Optional. The image search queries that were used to generate the content. This field is populated only when the grounding source is Google Search with the Image Search search_type enabled.
      - `googleMapsWidgetContextToken` string — Optional. Output only. Deprecated: The Google Maps contextual widget behavior in Grounding with Google Maps is being deprecated; this field is planned for removal and will no longer be populated once removed. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.
      - `groundingChunks` GoogleCloudAiplatformV1GroundingChunk[] — A list of supporting references retrieved from the grounding source. This field is populated when the grounding source is Google Search, Vertex AI Search, or Google Maps.
        - `web` GoogleCloudAiplatformV1GroundingChunkWeb — A `Web` chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information.
          - `uri` string — The URI of the web page that contains the evidence.
          - `title` string — The title of the web page that contains the evidence.
          - `domain` string — The domain of the web page that contains the evidence. This can be used to filter out low-quality sources.
        - `maps` GoogleCloudAiplatformV1GroundingChunkMaps — A `Maps` chunk is a piece of evidence that comes from Google Maps, containing information about places or routes. This is used to provide the user with rich, location-based information.
          - `text` string — The text of the place answer.
          - `route` GoogleCloudAiplatformV1GroundingChunkMapsRoute — Route information from Google Maps.
            - `distanceMeters` integer — The total distance of the route, in meters.
            - `duration` string, google-duration — The total duration of the route.
            - `encodedPolyline` string — An encoded polyline of the route. See https://developers.google.com/maps/documentation/utilities/polylinealgorithm
          - `title` string — The title of the place.
          - `placeAnswerSources` GoogleCloudAiplatformV1GroundingChunkMapsPlaceAnswerSources — The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content.
            - `reviewSnippets` GoogleCloudAiplatformV1GroundingChunkMapsPlaceAnswerSourcesReviewSnippet[] — Snippets of reviews that were used to generate the answer.
              - …
          - `uri` string — The URI of the place.
          - `placeId` string — This Place's resource name, in `places/{place_id}` format. This can be used to look up the place in the Google Maps API.
        - `image` GoogleCloudAiplatformV1GroundingChunkImage — An `Image` chunk is a piece of evidence that comes from an image search result. It contains the URI of the image search result and the URI of the image. This is used to provide the user with a link to the source of the information.
          - `sourceUri` string — The URI of the image search result page.
          - `imageUri` string — The URI of the image.
          - `title` string — The title of the image search result page.
          - `domain` string — The domain of the image search result page.
        - `retrievedContext` GoogleCloudAiplatformV1GroundingChunkRetrievedContext — Context retrieved from a data source to ground the model's response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset.
          - `title` string — The title of the retrieved data source.
          - `uri` string — The URI of the retrieved data source.
          - `documentName` string — Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
          - `text` string — The content of the retrieved data source.
          - `ragChunk` GoogleCloudAiplatformV1RagChunk — A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
            - `text` string — The content of the chunk.
            - `pageSpan` GoogleCloudAiplatformV1RagChunkPageSpan — Represents where the chunk starts and ends in the document.
              - …
      - `groundingSupports` GoogleCloudAiplatformV1GroundingSupport[] — Optional. A list of grounding supports that connect the generated content to the grounding chunks. This field is populated when the grounding source is Google Search or Vertex AI Search.
        - `confidenceScores` number[] — The confidence scores for the support references. This list is parallel to the `grounding_chunk_indices` list. A score is a value between 0.0 and 1.0, with a higher score indicating a higher confidence that the reference supports the claim. For Gemini 2.0 and before, this list has the same size as `grounding_chunk_indices`. For Gemini 2.5 and later, this list is empty and should be ignored.
        - `groundingChunkIndices` integer[] — A list of indices into the `grounding_chunks` field of the `GroundingMetadata` message. These indices specify which grounding chunks support the claim made in the content segment. For example, if this field has the values `[1, 3]`, it means that `grounding_chunks[1]` and `grounding_chunks[3]` are the sources for the claim in the content segment.
        - `renderedParts` integer[] — Indices into the `rendered_parts` field of the `GroundingMetadata` message. These indices specify which rendered parts are associated with this support message.
        - `segment` GoogleCloudAiplatformV1Segment — A segment of the content.
          - `partIndex` integer — Output only. The index of the `Part` object that this segment belongs to. This is useful for associating the segment with a specific part of the content.
          - `startIndex` integer — Output only. The start index of the segment in the `Part`, measured in bytes. This marks the beginning of the segment and is inclusive, meaning the byte at this index is the first byte of the segment.
          - `endIndex` integer — Output only. The end index of the segment in the `Part`, measured in bytes. This marks the end of the segment and is exclusive, meaning the segment includes content up to, but not including, the byte at this index.
          - `text` string — Output only. The text of the segment.
    - `turnComplete` boolean — Optional. Indicates whether the response from the model is complete. Only used for streaming mode.
    - `branch` string — Optional. The branch of the event. The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3. Branch is used when multiple child agents shouldn't see their siblings' conversation history.
    - `partial` boolean — Optional. Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.
    - `inputTranscription` GoogleCloudAiplatformV1Transcription — Audio transcription in Server Content.
      - `text` string — Optional. Transcription text.
      - `finished` boolean — Optional. The bool indicates the end of the transcription.
    - `outputTranscription` GoogleCloudAiplatformV1Transcription — Audio transcription in Server Content.
      - `text` string — Optional. Transcription text.
      - `finished` boolean — Optional. The bool indicates the end of the transcription.
    - `longRunningToolIds` string[] — Optional. Set of ids of the long running function calls. Agent client will know from this field about which function call is long running. Only valid for function call event.
    - `interrupted` boolean — Optional. Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.
  - `rawEvent` object — Optional. Weakly typed raw event data in proto struct format.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/aiplatform.md) · [All operations](https://skmtc.net/google/apis/aiplatform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/aiplatform/versions/b608d71b91f0/schema)
