CreateTemplate
Creates a template either from a TemplateDefinition
or from an existing Amazon QuickSight analysis or template. You can use the resulting
template to create additional dashboards, templates, or analyses.
A template is an entity in Amazon QuickSight that encapsulates the metadata required to create an analysis and that you can use to create s dashboard. A template adds a layer of abstraction by using placeholders to replace the dataset associated with the analysis. You can use templates to create dashboards by replacing dataset placeholders with datasets that follow the same schema that was used to create the source analysis and template.
Request Syntax
POST /accounts/AwsAccountId
/templates/TemplateId
HTTP/1.1
Content-type: application/json
{
"Definition": {
"AnalysisDefaults": {
"DefaultNewSheetConfiguration": { ... }
},
"CalculatedFields": [
{ ... }
],
"ColumnConfigurations": [
{ ... }
],
"DataSetConfigurations": [
{ ... }
],
"FilterGroups": [
{ ... }
],
"Options": {
"Timezone": "string
",
"WeekStart": "string
"
},
"ParameterDeclarations": [
{ ... }
],
"QueryExecutionOptions": {
"QueryExecutionMode": "string
"
},
"Sheets": [
{ ... }
]
},
"Name": "string
",
"Permissions": [
{
"Actions": [ "string
" ],
"Principal": "string
"
}
],
"SourceEntity": {
"SourceAnalysis": {
"Arn": "string
",
"DataSetReferences": [
{
"DataSetArn": "string
",
"DataSetPlaceholder": "string
"
}
]
},
"SourceTemplate": {
"Arn": "string
"
}
},
"Tags": [
{
"Key": "string
",
"Value": "string
"
}
],
"ValidationStrategy": {
"Mode": "string
"
},
"VersionDescription": "string
"
}
URI Request Parameters
The request uses the following URI parameters.
- AwsAccountId
-
The ID for the AWS account that the group is in. You use the ID for the AWS account that contains your Amazon QuickSight account.
Length Constraints: Fixed length of 12.
Pattern:
^[0-9]{12}$
Required: Yes
- TemplateId
-
An ID for the template that you want to create. This template is unique per AWS Region; in each AWS account.
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
[\w\-]+
Required: Yes
Request Body
The request accepts the following data in JSON format.
- Definition
-
The definition of a template.
A definition is the data model of all features in a Dashboard, Template, or Analysis.
Either a
SourceEntity
or aDefinition
must be provided in order for the request to be valid.Type: TemplateVersionDefinition object
Required: No
- Name
-
A display name for the template.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
Required: No
- Permissions
-
A list of resource permissions to be set on the template.
Type: Array of ResourcePermission objects
Array Members: Minimum number of 1 item. Maximum number of 64 items.
Required: No
- SourceEntity
-
The entity that you are using as a source when you create the template. In
SourceEntity
, you specify the type of object you're using as source:SourceTemplate
for a template orSourceAnalysis
for an analysis. Both of these require an Amazon Resource Name (ARN). ForSourceTemplate
, specify the ARN of the source template. ForSourceAnalysis
, specify the ARN of the source analysis. TheSourceTemplate
ARN can contain any AWS account and any Amazon QuickSight-supported AWS Region.Use the
DataSetReferences
entity withinSourceTemplate
orSourceAnalysis
to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.Either a
SourceEntity
or aDefinition
must be provided in order for the request to be valid.Type: TemplateSourceEntity object
Required: No
- Tags
-
Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.
Type: Array of Tag objects
Array Members: Minimum number of 1 item. Maximum number of 200 items.
Required: No
- ValidationStrategy
-
TThe option to relax the validation needed to create a template with definition objects. This skips the validation step for specific errors.
Type: ValidationStrategy object
Required: No
- VersionDescription
-
A description of the current template version being created. This API operation creates the first version of the template. Every time
UpdateTemplate
is called, a new version is created. Each version of the template maintains a description of the version in theVersionDescription
field.Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Required: No
Response Syntax
HTTP/1.1 Status
Content-type: application/json
{
"Arn": "string",
"CreationStatus": "string",
"RequestId": "string",
"TemplateId": "string",
"VersionArn": "string"
}
Response Elements
If the action is successful, the service sends back the following HTTP response.
- Status
-
The HTTP status of the request.
The following data is returned in JSON format by the service.
- Arn
-
The ARN for the template.
Type: String
- CreationStatus
-
The template creation status.
Type: String
Valid Values:
CREATION_IN_PROGRESS | CREATION_SUCCESSFUL | CREATION_FAILED | UPDATE_IN_PROGRESS | UPDATE_SUCCESSFUL | UPDATE_FAILED | DELETED
- RequestId
-
The AWS request ID for this operation.
Type: String
- TemplateId
-
The ID of the template.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
[\w\-]+
- VersionArn
-
The ARN for the template, including the version information of the first version.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon QuickSight service, that your policies have the correct permissions, and that you are using the correct credentials.
HTTP Status Code: 401
- ConflictException
-
Updating or deleting a resource can cause an inconsistent state.
HTTP Status Code: 409
- InternalFailureException
-
An internal failure occurred.
HTTP Status Code: 500
- InvalidParameterValueException
-
One or more parameters has a value that isn't valid.
HTTP Status Code: 400
- LimitExceededException
-
A limit is exceeded.
HTTP Status Code: 409
- ResourceExistsException
-
The resource specified already exists.
HTTP Status Code: 409
- ResourceNotFoundException
-
One or more resources can't be found.
HTTP Status Code: 404
- ThrottlingException
-
Access is throttled.
HTTP Status Code: 429
- UnsupportedUserEditionException
-
This error indicates that you are calling an operation on an Amazon QuickSight subscription where the edition doesn't include support for that operation. Amazon Amazon QuickSight currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.
HTTP Status Code: 403
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: