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

# POST /v1/{+parent}/examples

`POST /v1/{+parent}/examples`

Creates a new example in the given app.

## Path parameters

- `parent` string, required

## Query parameters

- `exampleId` string

## Request body

- Example — An example represents a sample conversation between the user and the agent(s).
  - `name` string — Identifier. The unique identifier of the example. Format: `projects/{project}/locations/{location}/apps/{app}/examples/{example}`
  - `entryAgent` string — Optional. The agent that initially handles the conversation. If not specified, the example represents a conversation that is handled by the root agent. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
  - `displayName` string — Required. Display name of the example.
  - `description` string — Optional. Human-readable description of the example.
  - `messages` Message[] — Optional. The collection of messages that make up the conversation.
    - `eventTime` string, google-datetime — Optional. Timestamp when the message was sent or received. Should not be used if the message is part of an example.
    - `chunks` Chunk[] — Optional. Content of the message as a series of chunks.
      - `agentTransfer` AgentTransfer — Represents an event indicating the transfer of a conversation to a different agent.
        - `targetAgent` string — Required. The agent to which the conversation is being transferred. The agent will handle the conversation from this point forward. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
        - `displayName` string — Output only. Display name of the agent.
      - `toolCall` ToolCall — Request for the client or the agent to execute the specified tool.
        - `tool` string — Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
        - `displayName` string — Output only. Display name of the tool.
        - `args` object — Optional. The input parameters and values for the tool in JSON object format.
        - `toolsetTool` ToolsetTool — A tool that is created from a toolset.
          - `toolset` string — Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
          - `toolId` string — Optional. The tool ID to filter the tools to retrieve the schema for.
        - `id` string — Optional. The unique identifier of the tool call. If populated, the client should return the execution result with the matching ID in ToolResponse.
      - `transcript` string — Optional. Transcript associated with the audio.
      - `text` string — Optional. Text data.
      - `payload` object — Optional. Custom payload data.
      - `toolResponse` ToolResponse — The execution result of a specific tool from the client or the agent.
        - `toolsetTool` ToolsetTool — A tool that is created from a toolset.
          - `toolset` string — Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
          - `toolId` string — Optional. The tool ID to filter the tools to retrieve the schema for.
        - `id` string — Optional. The matching ID of the tool call the response is for.
        - `response` object — Required. The tool execution result in JSON object format. Use "output" key to specify tool response and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as tool execution result.
        - `displayName` string — Output only. Display name of the tool.
        - `tool` string — Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
      - `image` Image — Represents an image input or output in the conversation.
        - `mimeType` string — Required. The IANA standard MIME type of the source data. Supported image types includes: * image/png * image/jpeg * image/webp
        - `data` string, byte — Required. Raw bytes of the image.
      - `updatedVariables` object — A struct represents variables that were updated in the conversation, keyed by variable names.
      - `defaultVariables` object — A struct represents default variables at the start of the conversation, keyed by variable names.
      - `blob` Blob — Represents a blob input or output in the conversation.
        - `mimeType` string — Required. The IANA standard MIME type of the source data.
        - `data` string, byte — Required. Raw bytes of the blob.
    - `role` string — Optional. The role within the conversation, e.g., user, agent.
  - `updateTime` string, google-datetime — Output only. Timestamp when the example was last updated.
  - `createTime` string, google-datetime — Output only. Timestamp when the example was created.
  - `invalid` boolean — Output only. The example may become invalid if referencing resources are deleted. Invalid examples will not be used as few-shot examples.
  - `etag` string — Etag used to ensure the object hasn't changed during a read-modify-write operation. If the etag is empty, the update will overwrite any concurrent changes.

## Response `200`

Successful response

---

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