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.
Imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected.
This method is a long-running operation. The returned Operation type has the following method-specific fields:
Required. The agent to import test cases to. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>.
Authorization requires the following IAM permission on the specified resource parent:
dialogflow.testcases.import
Request body
The request body contains data with the following structure:
JSON representation
{// Union field source can be only one of the following:"gcsUri": string,"content": string// End of list of possible types for union field source.}
Fields
Union field source. Required. The source to import. source can be only one of the following:
gcsUri
string
The Google Cloud Storage URI to import test cases from. The format of this URI must be gs://<bucket-name>/<object-name>.
Dialogflow performs a read operation for the Cloud Storage object on the caller's behalf, so your request authentication must have read permissions for the object. For more information, see Dialogflow access control.
[[["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 process imports test cases from either a Google Cloud Storage bucket or a local file, creating new test cases without overwriting existing ones.\u003c/p\u003e\n"],["\u003cp\u003eThe method is a long-running operation, returning an \u003ccode\u003eOperation\u003c/code\u003e type with \u003ccode\u003emetadata\u003c/code\u003e and \u003ccode\u003eresponse\u003c/code\u003e fields containing details about the import.\u003c/p\u003e\n"],["\u003cp\u003eThe import source can be specified using either a Google Cloud Storage URI (\u003ccode\u003egcsUri\u003c/code\u003e) or raw byte content (\u003ccode\u003econtent\u003c/code\u003e) within the request body.\u003c/p\u003e\n"],["\u003cp\u003eTo perform this operation, the request requires specific authorization via IAM permissions (\u003ccode\u003edialogflow.testcases.import\u003c/code\u003e) and one of the specified OAuth scopes.\u003c/p\u003e\n"],["\u003cp\u003eThe request is made through a POST request to a URL, where the parent path parameter must contain the location of the agent to import test cases to.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.agents.testCases.import\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- [Try it!](#try-it)\n\nImports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected.\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`: [ImportTestCasesMetadata](/dialogflow/cx/docs/reference/rest/v3beta1/ImportTestCasesMetadata)\n- `response`: [ImportTestCasesResponse](/dialogflow/cx/docs/reference/rest/v3beta1/ImportTestCasesResponse)\n\n### HTTP request\n\n`POST https://{endpoint}/v3beta1/{parent=projects/*/locations/*/agents/*}/testCases:import`\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)."]]