Using multiple projects

In some cases, you might need to create multiple Google Cloud projects to use Dialogflow:

  • You might find it useful to create one project for authentication, quotas, and billing, and additional projects for agent data.

Consumer and resource projects

When you make calls to the API, you typically provide service account keys for authentication. Each service account is owned by a specific project, but service accounts might be provided roles to access resources for other projects The project associated with the service account you provide for an API call is referred to as the consumer project.

When you make calls to the API, your request specifies the agent's project. This project is referred to as the resource project.

For example, in the following REST curl request, the project associated with AGENT_ID is the resource project, and the project associated with the service account used to generate TOKEN is the consumer project:

curl -X GET
    -H "Authorization: Bearer TOKEN"
    "https://REGION_ID-dialogflow.googleapis.com/v3/projects/PROJECT_ID/locations/REGION_ID/agents/AGENT_ID"

One project can play the role of both consumer and resource project. Agent data, charges, and quotas are associated only with this project.

When consumer and resource projects are two different projects, charges, quota constraints, agent information, and a requirement to enable the API are applicable to either or both projects. The following table shows the association for an API call with two projects:

Description Consumer project (service account project) Resource project (agent project) Notes
Project that charges are incurred for
Project that's bound to quotas
Project that contains all agent data
Projects for which you must enable the Dialogflow API The Dialogflow API must be enabled for both project types.
Project that shows API usage on the Cloud console API dashboard