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 endpoint exports test cases from a specified Dialogflow agent to either a Cloud Storage bucket or a local file.\u003c/p\u003e\n"],["\u003cp\u003eThe export process is a long-running operation, returning an \u003ccode\u003eOperation\u003c/code\u003e type with metadata and response fields for tracking and retrieving results.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a POST method to a specific endpoint with the parent agent's path and requires authorization.\u003c/p\u003e\n"],["\u003cp\u003eYou can filter the test cases to be exported using a filter expression in the request body, and it can be in \u003ccode\u003eBLOB\u003c/code\u003e or \u003ccode\u003eJSON\u003c/code\u003e format.\u003c/p\u003e\n"],["\u003cp\u003eThe destination for exported test cases can be specified via a Google Cloud Storage URI, or if unspecified, the data is returned inline.\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/v3beta1/ExportTestCasesMetadata)\n- `response`: [ExportTestCasesResponse](/dialogflow/cx/docs/reference/rest/v3beta1/ExportTestCasesResponse)\n\n### HTTP request\n\n`POST https://{endpoint}/v3beta1/{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/v3beta1/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."]]