Some products and features are in the process of being renamed. Generative playbook and flow features are also being migrated to a single consolidated console. See the details.
Required. The agent where to export test cases from. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>.
Authorization requires the following IAM permission on the specified resource parent:
dialogflow.testcases.export
Request body
The request body contains data with the following structure:
JSON representation
{"dataFormat": enum (DataFormat),"filter": string,// Union field destination can be only one of the following:"gcsUri": string// End of list of possible types for union field destination.}
The data format of the exported test cases. If not specified, BLOB is assumed.
filter
string
The filter expression used to filter exported test cases, see API Filtering. The expression is case insensitive and supports the following syntax:
name = [OR name = ] ...
For example:
"name = t1 OR name = t2" matches the test case with the exact resource name "t1" or "t2".
Union field destination. The destination to export. destination can be only one of the following:
gcsUri
string
The Google Cloud Storage URI to export the test cases to. The format of this URI must be gs://<bucket-name>/<object-name>. If unspecified, the serialized test cases is returned inline.
Dialogflow performs a write operation for the Cloud Storage object on the caller's behalf, so your request authentication must have write permissions for the object. For more information, see Dialogflow access control.
Response body
If successful, the response body contains an instance of Operation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[[["\u003cp\u003eThis document describes how to export test cases from a Dialogflow agent to either a Google Cloud Storage bucket or a local file.\u003c/p\u003e\n"],["\u003cp\u003eThe export operation uses a long-running process, returning an \u003ccode\u003eOperation\u003c/code\u003e with metadata and response fields detailing the export status and results.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request for exporting test cases is a POST method to a specific endpoint, requiring the agent's resource name in the request URL.\u003c/p\u003e\n"],["\u003cp\u003eThe request body allows specification of the data format (\u003ccode\u003eBLOB\u003c/code\u003e or \u003ccode\u003eJSON\u003c/code\u003e) and a filter expression to select a subset of test cases for export.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization to export test cases requires specific IAM permissions and one of two OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/dialogflow\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.agents.testCases.export\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [DataFormat](#DataFormat)\n- [Try it!](#try-it)\n\nExports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases.\n\nThis method is a [long-running operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The returned `Operation` type has the following method-specific fields:\n\n- `metadata`: [ExportTestCasesMetadata](/dialogflow/cx/docs/reference/rest/v3/ExportTestCasesMetadata)\n- `response`: [ExportTestCasesResponse](/dialogflow/cx/docs/reference/rest/v3/ExportTestCasesResponse)\n\n### HTTP request\n\n`POST https://{endpoint}/v3/{parent=projects/*/locations/*/agents/*}/testCases:export`\n\nWhere `{endpoint}` is one of the [supported service endpoints](/dialogflow/cx/docs/reference/rest#rest_endpoints).\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/dialogflow/cx/docs/reference/rest/v3/projects.locations.operations#Operation).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/dialogflow`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\nDataFormat\n----------\n\nData format of the exported test cases."]]