[[["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 create or update an agent using a POST request to a specific endpoint, following gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003eagent.parent\u003c/code\u003e path parameter, which specifies the project of the agent using a format like \u003ccode\u003eprojects/<Project ID>\u003c/code\u003e or \u003ccode\u003eprojects/<Project ID>/locations/<Location ID>\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAn optional \u003ccode\u003eupdateMask\u003c/code\u003e query parameter can be used to control which fields of the agent are updated using a comma-separated list of fully qualified field names.\u003c/p\u003e\n"],["\u003cp\u003eBoth the request and response bodies utilize an instance of the \u003ccode\u003eAgent\u003c/code\u003e resource, while the request also requires one of two specific OAuth scopes for authorization.\u003c/p\u003e\n"],["\u003cp\u003eBefore sending queries, you should always train an agent, as detailed in the training documentation.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.setAgent\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates/updates the specified agent.\n\nNote: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).\n\n### HTTP request\n\n`POST https://{endpoint}/v2beta1/{agent.parent=projects/*/locations/*}/agent`\n\nWhere `{endpoint}` is one of the [supported service endpoints](/dialogflow/es/docs/reference/rest#rest_endpoints).\n\nThe URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body contains an instance of [Agent](/dialogflow/es/docs/reference/rest/v2beta1/Agent).\n\n### Response body\n\nIf successful, the response body contains an instance of [Agent](/dialogflow/es/docs/reference/rest/v2beta1/Agent).\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)."]]