---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/examples"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/examples"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/examples

`POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/examples`

## Request

- Base URL: `https://ces.googleapis.com`
- URL: `https://ces.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/examples`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/ces`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/ces`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Creates a new example in the given app.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `appsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `exampleId` string

## Request body

- Example: An example represents a sample conversation between the user and the agent(s).
  - `createTime` string, google-datetime: Output only. Timestamp when the example was created.
  - `description` string: Optional. Human-readable description of the example.
  - `displayName` string: Required. Display name of the 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}`
  - `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.
  - `invalid` boolean: Output only. The example may become invalid if referencing resources are deleted. Invalid examples will not be used as few-shot examples.
  - `messages` Message[]: Optional. The collection of messages that make up the conversation.
    - `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.
        - `displayName` string: Output only. Display name of the 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}`
      - `blob` Blob: Represents a blob input or output in the conversation.
        - `data` string, byte: Required. Raw bytes of the blob.
        - `mimeType` string: Required. The IANA standard MIME type of the source data.
      - `defaultVariables` object: A struct represents default variables at the start of the conversation, keyed by variable names.
      - `image` Image: Represents an image input or output in the conversation.
        - `altText` string: Optional. The alternative text for the image.
        - `data` string, byte: Required. Raw bytes of the image.
        - `mimeType` string: Required. The IANA standard MIME type of the source data. Supported image types includes: * image/png * image/jpeg * image/webp
      - `payload` object: Optional. Custom payload data.
      - `text` string: Optional. Text data.
      - `toolCall` ToolCall: Request for the client or the agent to execute the specified tool.
        - `agentName` string: Output only. Human-readable name of the agent that issued this call, e.g. "Contract Architect". Empty when the root agent issued it.
        - `args` object: Optional. The input parameters and values for the tool in JSON object format.
        - `displayName` string: Output only. Display name of the tool.
        - `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.
        - `parentToolCallId` string: Output only. The id of the tool call that caused this one, when it was issued by a sub-agent working on behalf of a parent call. Empty for top-level calls. Lets a client group a sub-agent's work under the call that started it instead of rendering every step as a sibling.
        - `targetApp` string: Output only. The app this call targets, derived by the assistant from the call's resource arguments: an app resource name, `PROJECT` for location-scoped tools, or empty for session-local tools. Set only in project-scoped assistant sessions.
        - `tool` string: Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
        - `toolsetTool` ToolsetTool: A tool that is created from a toolset.
          - `toolId` string: Optional. The tool ID to filter the tools to retrieve the schema for.
          - `toolset` string: Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
      - `toolResponse` ToolResponse: The execution result of a specific tool from the client or the agent.
        - `agentName` string: Output only. Human-readable name of the agent that issued this call, e.g. "Contract Architect". Empty when the root agent issued it.
        - `displayName` string: Output only. Display name of the tool.
        - `id` string: Optional. The matching ID of the tool call the response is for.
        - `parentToolCallId` string: Output only. The id of the tool call that caused this one, when it was issued by a sub-agent working on behalf of a parent call. Empty for top-level calls. Lets a client group a sub-agent's work under the call that started it instead of rendering every step as a sibling.
        - `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.
        - `targetApp` string: Output only. The app the executed tool targeted; mirrors ToolCall.target_app.
        - `tool` string: Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
        - `toolsetTool` ToolsetTool: A tool that is created from a toolset.
          - `toolId` string: Optional. The tool ID to filter the tools to retrieve the schema for.
          - `toolset` string: Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
      - `transcript` string: Optional. Transcript associated with the audio.
      - `updatedVariables` object: A struct represents variables that were updated in the conversation, keyed by variable names.
    - `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.
    - `role` string: Optional. The role within the conversation, e.g., user, agent.
  - `name` string: Identifier. The unique identifier of the example. Format: `projects/{project}/locations/{location}/apps/{app}/examples/{example}`
  - `updateTime` string, google-datetime: Output only. Timestamp when the example was last updated.

## Response `200`

Successful response

- Example: An example represents a sample conversation between the user and the agent(s).
  - `createTime` string, google-datetime: Output only. Timestamp when the example was created.
  - `description` string: Optional. Human-readable description of the example.
  - `displayName` string: Required. Display name of the 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}`
  - `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.
  - `invalid` boolean: Output only. The example may become invalid if referencing resources are deleted. Invalid examples will not be used as few-shot examples.
  - `messages` Message[]: Optional. The collection of messages that make up the conversation.
    - `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.
        - `displayName` string: Output only. Display name of the 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}`
      - `blob` Blob: Represents a blob input or output in the conversation.
        - `data` string, byte: Required. Raw bytes of the blob.
        - `mimeType` string: Required. The IANA standard MIME type of the source data.
      - `defaultVariables` object: A struct represents default variables at the start of the conversation, keyed by variable names.
      - `image` Image: Represents an image input or output in the conversation.
        - `altText` string: Optional. The alternative text for the image.
        - `data` string, byte: Required. Raw bytes of the image.
        - `mimeType` string: Required. The IANA standard MIME type of the source data. Supported image types includes: * image/png * image/jpeg * image/webp
      - `payload` object: Optional. Custom payload data.
      - `text` string: Optional. Text data.
      - `toolCall` ToolCall: Request for the client or the agent to execute the specified tool.
        - `agentName` string: Output only. Human-readable name of the agent that issued this call, e.g. "Contract Architect". Empty when the root agent issued it.
        - `args` object: Optional. The input parameters and values for the tool in JSON object format.
        - `displayName` string: Output only. Display name of the tool.
        - `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.
        - `parentToolCallId` string: Output only. The id of the tool call that caused this one, when it was issued by a sub-agent working on behalf of a parent call. Empty for top-level calls. Lets a client group a sub-agent's work under the call that started it instead of rendering every step as a sibling.
        - `targetApp` string: Output only. The app this call targets, derived by the assistant from the call's resource arguments: an app resource name, `PROJECT` for location-scoped tools, or empty for session-local tools. Set only in project-scoped assistant sessions.
        - `tool` string: Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
        - `toolsetTool` ToolsetTool: A tool that is created from a toolset.
          - `toolId` string: Optional. The tool ID to filter the tools to retrieve the schema for.
          - `toolset` string: Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
      - `toolResponse` ToolResponse: The execution result of a specific tool from the client or the agent.
        - `agentName` string: Output only. Human-readable name of the agent that issued this call, e.g. "Contract Architect". Empty when the root agent issued it.
        - `displayName` string: Output only. Display name of the tool.
        - `id` string: Optional. The matching ID of the tool call the response is for.
        - `parentToolCallId` string: Output only. The id of the tool call that caused this one, when it was issued by a sub-agent working on behalf of a parent call. Empty for top-level calls. Lets a client group a sub-agent's work under the call that started it instead of rendering every step as a sibling.
        - `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.
        - `targetApp` string: Output only. The app the executed tool targeted; mirrors ToolCall.target_app.
        - `tool` string: Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
        - `toolsetTool` ToolsetTool: A tool that is created from a toolset.
          - `toolId` string: Optional. The tool ID to filter the tools to retrieve the schema for.
          - `toolset` string: Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
      - `transcript` string: Optional. Transcript associated with the audio.
      - `updatedVariables` object: A struct represents variables that were updated in the conversation, keyed by variable names.
    - `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.
    - `role` string: Optional. The role within the conversation, e.g., user, agent.
  - `name` string: Identifier. The unique identifier of the example. Format: `projects/{project}/locations/{location}/apps/{app}/examples/{example}`
  - `updateTime` string, google-datetime: Output only. Timestamp when the example was last updated.

## Changes

- **2026-11-17** `455f2f484021`: 4 info
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-11** `d1599b011b2e`: 4 info
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/ces/changes/v1/projects/:projectsId/locations/:locationsId/apps/:appsId/examples/post.md)

---

[API](https://skmtc.dev/google/apis/ces.md) - [All operations](https://skmtc.dev/google/apis/ces/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/ces/revisions/455f2f484021?raw)
