Method: projects.locations.agents.environments.sessions.detectIntent

Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause session entity types to be updated, which in turn might affect results of future queries.

Note: Always use agent versions for production traffic. See Versions and environments.

HTTP request

POST https://{endpoint}/v3beta1/{session=projects/*/locations/*/agents/*/environments/*/sessions/*}:detectIntent

Where {endpoint} is one of the supported service endpoints.

The URLs use gRPC Transcoding syntax.

Path parameters



Required. The name of the session this query is sent to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session ID> or projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>. If Environment ID is not specified, we assume default 'draft' environment. It's up to the API caller to choose an appropriate Session ID. It can be a random number or some type of session identifiers (preferably hashed). The length of the Session ID must not exceed 36 characters.

For more information, see the sessions guide.

Note: Always use agent versions for production traffic. See Versions and environments.

Authorization requires the following IAM permission on the specified resource session:

  • dialogflow.sessions.detectIntent

Request body

The request body contains data with the following structure:

JSON representation
  "queryParams": {
    object (QueryParameters)
  "queryInput": {
    object (QueryInput)
  "outputAudioConfig": {
    object (OutputAudioConfig)

object (QueryParameters)

The parameters of this query.


object (QueryInput)

Required. The input specification.


object (OutputAudioConfig)

Instructs the speech synthesizer how to generate the output audio.

Response body

If successful, the response body contains an instance of DetectIntentResponse.

Authorization scopes

Requires one of the following OAuth scopes:


For more information, see the Authentication Overview.