Common types

This page lists commonly used types in the Dialogflow API and provides links to reference documentation and samples.

Agents

An agent is a natural language understanding module that you build and use in your app or service.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Agents references

V2 V2Beta1
REST projects,
projects.locations,
projects.agent,
projects.locations.agent
projects,
projects.locations,
projects.agent,
projects.locations.agent
RPC Agents Agents
C++ AgentsClient Not available
C# AgentsClient Not available
Go AgentsClient Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP AgentsClient Not available
Python AgentsClient AgentsClient
Ruby AgentsClient Not available

Contexts

Contexts are used to control the flow of a conversation.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Contexts references

V2 V2Beta1
REST projects.agent.sessions.contexts,
projects.locations.agent.sessions.contexts
projects.agent.sessions.contexts,
projects.locations.agent.sessions.contexts
RPC Contexts Contexts
C++ ContextsClient Not available
C# ContextsClient Not available
Go ContextsClient Not available
Java ContextsClient ContextsClient
Node.js ContextsClient ContextsClient
PHP ContextsClient Not available
Python ContextsClient ContextsClient
Ruby ContextsClient Not available

Documents

A document for a knowledge base.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Documents references

V2 V2Beta1
REST Not available projects.knowledgeBases.documents,
projects.locations.knowledgeBases.documents
RPC Not available Document
C++ Not available Not available
C# Not available Not available
Go Not available Not available
Java Not available DocumentsClient
Node.js Not available DocumentsClient
PHP Not available Not available
Python Not available DocumentsClient
Ruby Not available Not available

Documents samples

Sample REST C# Go Java Node.js PHP Python Ruby
Knowledge connectors

EntityTypes

Entity types serve as a tool for extracting parameter values from natural language queries.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

EntityTypes references

V2 V2Beta1
REST projects.agent.entityTypes,
projects.locations.agent.entityTypes
projects.agent.entityTypes,
projects.locations.agent.entityTypes
RPC EntityTypes EntityTypes
C++ EntityTypesClient Not available
C# EntityTypesClient Not available
Go EntityTypesClient Not available
Java EntityTypesClient EntityTypesClient
Node.js EntityTypesClient EntityTypesClient
PHP EntityTypesClient Not available
Python EntityTypesClient EntityTypesClient
Ruby EntityTypesClient Not available

Environments

You can serve your agent from one or more environments, like testing, staging, and production.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Environments references

V2 V2Beta1
REST projects.agent.environments,
projects.locations.agent.environments
projects.agent.environments,
projects.locations.agent.environments
RPC Environments Environments
C++ EnvironmentsClient Not available
C# EnvironmentsClient Not available
Go EnvironmentsClient Not available
Java EnvironmentsClient EnvironmentsClient
Node.js EnvironmentsClient EnvironmentsClient
PHP EnvironmentsClient Not available
Python EnvironmentsClient EnvironmentsClient
Ruby EnvironmentsClient Not available

Intents

An intent represents a mapping between input from a user and an action to be taken by your application.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Intents references

V2 V2Beta1
REST projects.agent.intents,
projects.locations.agent.intents
projects.agent.intents,
projects.locations.agent.intents
RPC Intents Intents
C++ IntentsClient Not available
C# IntentsClient Not available
Go IntentsClient Not available
Java IntentsClient IntentsClient
Node.js IntentsClient IntentsClient
PHP IntentsClient Not available
Python IntentsClient IntentsClient
Ruby IntentsClient Not available

Intents samples

Sample REST C# Go Java Node.js PHP Python Ruby
Manage intents with the API

KnowledgeBases

KnowledgeBases parse documents (for example, FAQs or articles) to find automated responses.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

KnowledgeBases references

V2 V2Beta1
REST Not available projects.agent.knowledgeBases,
projects.locations.agent.knowledgeBases
RPC Not available KnowledgeBase
C++ Not available Not available
C# Not available Not available
Go Not available Not available
Java Not available KnowledgeBasesClient
Node.js Not available KnowledgeBasesClient
PHP Not available Not available
Python KnowledgeBasesClient KnowledgeBasesClient
Ruby Not available Not available

KnowledgeBases samples

Sample REST C# Go Java Node.js PHP Python Ruby
Knowledge connectors

Operations

A long-running operation that can be polled for completion. This type only has links to REST and RPC references, because client libraries implement long-running operations in a way that is idiomatic for each language. See the documentation for the method that returns the operation.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Operations references

V2 V2Beta1
REST projects.operations,
projects.locations.operations
projects.operations,
projects.locations.operations
RPC Operation Operation

Operations samples

Sample REST C# Go Java Node.js PHP Python Ruby
Long-running operations

Sessions

A session represents an interaction with a user.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Sessions references

V2 V2Beta1
REST projects.agent.sessions,
projects.locations.agent.sessions
projects.agent.sessions,
projects.locations.agent.sessions
RPC Sessions Sessions
C++ SessionsClient Not available
C# SessionsClient Not available
Go SessionsClient Not available
Java SessionsClient SessionsClient
Node.js SessionsClient SessionsClient
PHP SessionsClient Not available
Python SessionsClient SessionsClient
Ruby SessionsClient Not available

Sessions samples

Sample REST C# Go Java Node.js PHP Python Ruby
Quickstart: Interactions with the API
Detect intent from audio file
Detect intent from audio stream
Detect intent with speech response
Detect intent with sentiment analysis

SessionEntityTypes

Session entities can extend or replace custom entity types and only exist during the session that they were created for.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

SessionEntityTypes references

V2 V2Beta1
REST projects.agent.sessions.entityTypes,
projects.locations.agent.sessions.entityTypes
projects.agent.sessions.entityTypes,
projects.locations.agent.sessions.entityTypes
RPC SessionEntityTypes SessionEntityTypes
C++ SessionEntityTypesClient Not available
C# SessionEntityTypesClient Not available
Go SessionEntityTypesClient Not available
Java SessionEntityTypesClient SessionEntityTypesClient
Node.js SessionEntityTypesClient SessionEntityTypesClient
PHP SessionEntityTypesClient Not available
Python SessionEntityTypesClient SessionEntityTypesClient
Ruby SessionEntityTypesClient Not available

WebhookRequest

The request message for a webhook call sent from Dialogflow to your service.

WebhookRequest references

V2 V2Beta1
REST WebhookRequest WebhookRequest

WebhookResponse

The response message for a webhook call sent from your service to Dialogflow.

WebhookResponse references

V2 V2Beta1
REST WebhookResponse WebhookResponse

Versions

You can maintain multiple versions of agents.

To find the reference information for this type, click the appropriate link below for your protocol, client library language, and API version.

Some REST resources can be accessed by specifying a region. These resources have two REST reference links: one with and one without a location path parameter. The two resource references are otherwise identical.

Versions references

V2 V2Beta1
REST projects.agent.versions,
projects.locations.agent.versions
projects.agent.versions,
projects.locations.agent.versions
RPC Versions Versions
C++ VersionsClient Not available
C# VersionsClient Not available
Go VersionsClient Not available
Java VersionsClient VersionsClient
Node.js VersionsClient VersionsClient
PHP VersionsClient Not available
Python VersionsClient VersionsClient
Ruby VersionsClient Not available