---
title: "POST /CreateView"
method: POST
path: "/CreateView"
---

# POST /CreateView

`POST /CreateView`

Creates a view that users can query by using the Search operation. Results from queries that you make using this view include only resources that match the view's `Filters`. For more information about Amazon Web Services Resource Explorer views, see [Managing views](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views.html) in the _Amazon Web Services Resource Explorer User Guide_.

Only the principals with an IAM identity-based policy that grants `Allow` to the `Search` action on a `Resource` with the [Amazon resource name (ARN)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of this view can Search using views you create with this operation.

## Request body

- object
  - `ClientToken` string — This value helps ensure idempotency. Resource Explorer uses this value to prevent the accidental creation of duplicate versions. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type value</a> to ensure the uniqueness of your views.
  - `ViewName` string, required — <p>The name of the new view. This name appears in the list of views in Resource Explorer.</p> <p>The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its Amazon Web Services Region.</p>
  - `IncludedProperties` IncludedProperty[] — <p>Specifies optional fields that you want included in search results from this view. It is a list of objects that each describe a field to include.</p> <p>The default is an empty list, with no optional fields included in the results.</p>
    - `Name` string, required — <p>The name of the property that is included in this view.</p> <p>You can specify the following property names for this field:</p> <ul> <li> <p> <code>tags</code> </p> </li> </ul>
  - `Scope` string — The root ARN of the account, an organizational unit (OU), or an organization ARN. If left empty, the default is account.
  - `Filters` object — A search filter defines which resources can be part of a search query result set.
    - `FilterString` string — The string that contains the search keywords, prefixes, and operators to control the results that can be returned by a <a>Search</a> operation. For more details, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/APIReference/about-query-syntax.html">Search query syntax</a>.
  - `Tags` object — Tag key and value pairs that are attached to the view.

## Response `200`

Success

- CreateViewOutput
  - `View` object — A structure that contains the details about the new view.
    - `ViewArn` string — The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of the view.
    - `ViewName` string — The name of the view.
    - `Owner` string — The Amazon Web Services account that owns this view.
    - `LastUpdatedAt` string, date-time — The date and time when this view was last modified.
    - `Scope` string — <p>An <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of an Amazon Web Services account, an organization, or an organizational unit (OU) that specifies whether this view includes resources from only the specified Amazon Web Services account, all accounts in the specified organization, or all accounts in the specified OU.</p> <p>If not specified, the value defaults to the Amazon Web Services account used to call this operation.</p>
    - `IncludedProperties` IncludedProperty[] — A structure that contains additional information about the view.
      - `Name` string, required — <p>The name of the property that is included in this view.</p> <p>You can specify the following property names for this field:</p> <ul> <li> <p> <code>tags</code> </p> </li> </ul>
    - `Filters` object — An array of <a>SearchFilter</a> objects that specify which resources can be included in the results of queries made using this view.
      - `FilterString` string, required — The string that contains the search keywords, prefixes, and operators to control the results that can be returned by a <a>Search</a> operation. For more details, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/APIReference/about-query-syntax.html">Search query syntax</a>.

## Other responses

- `480` — InternalServerException
- `481` — ValidationException
- `482` — ConflictException
- `483` — ServiceQuotaExceededException
- `484` — UnauthorizedException
- `485` — ThrottlingException
- `486` — AccessDeniedException

---

[API](https://skmtc.net/aws/apis/resource-explorer-2.md) · [All operations](https://skmtc.net/aws/apis/resource-explorer-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/resource-explorer-2/versions/d0cbc402825f/schema)
