

# Template operations


A *template* is a resource in Quick Sight that holds the information necessary to create an analysis or dashboard. You can use templates to migrate dashboards and analyses across accounts.

With template API operations, you can perform actions on Quick Sight templates. For more information, see the following API operations.

**Topics**
+ [

# Template permissions
](template-permissions.md)
+ [

# CreateTemplate
](create-template.md)
+ [

# DeleteTemplate
](delete-template.md)
+ [

# DescribeTemplate
](describe-template.md)
+ [

# ListTemplates
](list-templates.md)
+ [

# ListTemplateVersions
](list-template-versions.md)
+ [

# UpdateTemplate
](update-template.md)

# Template permissions


With template permissions API operations, you can view and update permissions for templates. For more information, see the following API operations.
+ [DescribeTemplatePermissions](describe-template-permissions.md)
+ [UpdateTemplatePermissions](update-template-permissions.md)

# DescribeTemplatePermissions


Use the `DescribeTemplatePermission`s operation to describe read and write permissions for a template. To use this operation, you need the ID of the template that you want to describe the permissions of. You can use the `ListTemplates` operation to list all templates and their corresponding template IDs.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight describe-template-permissions
    --aws-account-id AWSACCOUNTID 
    --template-id 222244446666
```

------

For more information about the `DescribeTemplatePermissions` operation, see [DescribeTemplatePermissions](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DescribeTemplatePermissions.html) in the *Quick Sight API Reference*.

# UpdateTemplatePermissions


Use the `UpdateTemplatePermissions` operation updates the resource permissions for a template. You can grant or revoke permissions in the same command. To use this operation, you need the ID of the template that you want to update the permissions of. You can use the `ListTemplates` operation to list all templates and their corresponding template IDs.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight update-template-permissions
    --aws-account-id AWSACCOUNTID 
    --template-id TEMPLATEID 
    --grant-permissions Principal=arn:aws:quicksight:us-east-1:AWSACCOUNTID:user/default/USERNAME,Actions=DescribeTemplate
    --revoke-permissions Principal=arn:aws:quicksight:us-east-1:AWSACCOUNTID:user/default/USERNAME,Actions=DescribeTemplate
```

If your `region` has already been configured within the CLI, it doesn't need to be included as an argument.

You can also make this command using a CLI skeleton file with the following command. For more information about CLI skeleton files, see [Use CLI skeleton files](cli-skeletons.md).

```
aws quicksight update-template-permissions 
    --cli-input-json file://updatetemplatepermissions.json
```

------

If your region has already been configured with the CLI, it does not need to be included in an argument.

For more information on the `UpdateTemplatePermissions` operation, see [UpdateTemplatePermissions](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdateTemplatePermissions.html) in the * Quick Sight API Reference*.

# CreateTemplate


Use the `CreateTemplate` operation to create a template from an existing Quick Sight analysis or template. You can use the resulting template to create a dashboard.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight create-template 
    --aws-account-id 555555555555
    --template-id TEMPLATEID
    --source-entity SOURCEENTITY
```

You can also make this command using a CLI skeleton file with the following command. For more information about CLI skeleton files, see [Use CLI skeleton files](cli-skeletons.md).

```
aws quicksight create-template
    --cli-input-json file://createtemplate.json
```

------

You can to get the ID the dataset ID by using a `DescribeAnalysis`operation. The `ANALYSISID`is part of the analysis URL in Quick Sight. You can also use the `ListAnalyses` operation to get the ID.

For more information about the `CreateTemplate` operation, see [CreateTemplate](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_CreateTemplate.html) in the *Quick Sight API Reference*.

# DeleteTemplate


Use the `DeleteTemplate` operation to delete a template. To use this operation, you need the ID of the template that you want to delete. You can use the `ListTemplates` operation to list all templates and their corresponding template IDs.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight delete-template 
    --aws-account-id AWSACCOUNTID 
    --template-id TEMPLATEID
```

------

For more information about the `DeleteTemplate` operation, see [DeleteTemplate](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DeleteTemplate.html) in the *Quick Sight API Reference*.

# DescribeTemplate


Use the `DescribeTemplate` operation to describe a template's metadata. To use this operation, you need the ID of the template that you want to describe. You can use the `ListTemplates` operation to list all templates and their corresponding template IDs.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight describe-template 
    --aws-account-id AWSACCOUNTID 
    --template-id TEMPLATEID 
    --version-number VERSION 
    --alias-name ALIAS
```

------

The parameter value for `alias-name` can be `$LATEST`.

For more information about the `DescribeTemplate` operation, see [DescribeTemplate](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DescribeTemplate.html) in the *Quick Sight API Reference*.

# ListTemplates


Use the `ListTemplates` operation to list all the templates in the current Quick Sight account.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight list-templates 
    --aws-account-id AWSACCOUNTID
    --page-size 10
    --max-items 100
```

------

For more information about the `ListTemplates` operation, see [ListTemplates](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListTemplates.html) in the *Quick Sight API Reference*.

# ListTemplateVersions


Use the `ListTemplateVersions` operation to list all the versions of the templates in the current Quick Sight account. To use this operation to list the versions of a template, you need that template's ID. You can use the `ListTemplates` operation to list all templates and their corresponding template IDs.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight list-template-versions 
    --aws-account-id AWSACCOUNTID 
    --template-id TEMPLATEID 
    --page-size 10 
    --max-items 100
```

------

For more information about the `ListTemplateVersions` operation, see [ListTemplateVersions](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_ListTemplateVersions.html) in the *Quick Sight API Reference*.

# UpdateTemplate


Use the `UpdateTemplate` operation to update a template from an existing Quick Sight analysis or another template.

Following is an example AWS CLI command for this operation.

------
#### [ AWS CLI ]

```
aws quicksight update-template
    --aws-account-id 555555555555
    --template-id TEMPLATEID
    --source-entity SOURCEENTITY
```

You can also make this command using a CLI skeleton file with the following command. For more information about CLI skeleton files, see [Use CLI skeleton files](cli-skeletons.md).

```
aws quicksight update-template
    --cli-input-json file://updatetemplate.json
```

------

For more information about the `UpdateTemplate` operation, see [UpdateTemplate](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdateTemplate.html) in the *Quick Sight API Reference*.