# Method: projects.locations.templates.use

- [HTTP request](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.UseTemplateResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.templates/use#try-it)

Use the template to create integration. This api would keep track of usageCount and lastUsedTime. PERMISSION_DENIED would be thrown if template is not accessible by client.

### HTTP request

`POST https://integrations.googleapis.com/v1/{name=projects/*/locations/*/templates/*}:use`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name that is associated with the Template. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "integrationDetails": { object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/IntegrationDetails`) }, "subIntegrations": { string: { object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/IntegrationDetails`) }, ... }, "integrationRegion": string } ``` |

| Fields ||
|---|---|
| `integrationDetails` | ``object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/IntegrationDetails`)`` Required. Integration details which would be created via templates. |
| `subIntegrations` | ``map (key: string, value: object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/IntegrationDetails`))`` Optional. Sub Integration which would be created via templates. |
| `integrationRegion` | `string` Required. The region of the Integration to be created. |

### Response body

Response for use template

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "integrationVersion": { object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions#IntegrationVersion`) }, "subIntegrationVersions": [ { object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions#IntegrationVersion`) } ] } ``` |

| Fields ||
|---|---|
| `integrationVersion` | ``object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions#IntegrationVersion`)`` IntegrationVersion which is created. |
| `subIntegrationVersions[]` | ``object (`https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions#IntegrationVersion`)`` Sub integration versions which are created. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `integrations.templates.use`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).