> ## Documentation Index
> Fetch the complete documentation index at: https://docs-xcor.paloaltonetworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collections

> Learn how collections group dashboards, monitors, and other resources so a team can manage a service at scale.

A *collection* is a group of Palo Alto Networks Cortex XCOR resources, such as
[dashboards](https://docs-xcor.paloaltonetworks.com/observe/dashboards) and [monitors](https://docs-xcor.paloaltonetworks.com/investigate/alerts/monitors), associated with a
service or feature you want to monitor.

A [*team*](https://docs-xcor.paloaltonetworks.com/administer/accounts-teams/teams.md), consisting of
[*user accounts*](https://docs-xcor.paloaltonetworks.com/administer/accounts-teams/user-accounts.md) and
[*service accounts*](https://docs-xcor.paloaltonetworks.com/administer/accounts-teams/service-accounts.md) that share
responsibility for the service or feature, is also responsible for each collection.

Collections help service and feature owners manage their services at scale and
streamline incident response by consolidating all relevant information about a
service or feature into one place, and sharing access to that information with
everyone in its responsible team.

For example, to ensure that your team and on-call engineers all have full context for
a service, you can create a collection for it that provides direct access to its
monitors, dashboards, and the team members who can respond to incidents.
Cortex XCOR then provides a menu of a team's collections to its members
who can quickly review resources most relevant to their services, and a homepage for
the collection that the team can share with on-call engineers or other stakeholders.

## View collections

> [tab] Web
>
> To search for a collection:
>
> 1. Click the search bar to focus on it, or use the keyboard shortcut
>    `Control+K` (`Command+K` on macOS).
>    1. Begin typing any part of the collection's name.
>    2. Optional: Click the filters for all other listed resource types at the top of
>       the search results to remove them and display only collections.
>    3. Click the search result you're interested in, or use the arrow keys to select
>       it and press `Enter` (`Return` on macOS), to select that
>       collection.
>
> An *unowned collection* is a collection that isn't assigned to a team. Unowned
> collections often originate from *buckets*, an earlier container for organizing
> resources that Cortex XCOR automatically converted to unowned
> collections. To resolve an unowned collection,
> [assign it to a team](#edit-a-collection).
>
> To browse collections in a filterable table:
>
> 1. In the navigation menu, click \*\* Go to admin view\*\* and
>    then select
>    **Platform > Collections**.
>    Clicking a collection or team in this table takes you to their respective
>    homepages.
>
>    * To filter this table by keyword, click **Search collections** and begin typing.
>      The table automatically updates to display only the matching collections.
>    * To filter this list by teams, select them in the **Select a Team** dropdown.
>    * To display only collections that lack an owner, enable the **Unowned Collections Only**
>      toggle.
>
> You can optionally select collections by checking the checkbox on each collection's
> row, which reveals an **Edit Team Association** button. Clicking this button allows
> you to select a parent team for all selected collections. If you select a team,
> click **Save** to save the edited association. For more Collection editing features,
> see [Edit a Collection](#edit-a-collection).

> [tab] Chronoctl
>
> To view a list of all collections using [Chronoctl](https://docs-xcor.paloaltonetworks.com/tooling/chronoctl), use the
> `collections list` command:
>
> ```shell theme={null}
> chronoctl collections list
> ```
>
> This returns a list of YAML documents separated by three dashes (`---`), each
> representing a collection:
>
> ```yaml Chronoctl example icon="square-terminal" theme={null}
> api_version: v1/config
> kind: Collection
> spec:
>   slug: example-collection
>   name: Example Collection
>   team_slug: example-team
>   description: Example Team - Example Collection
> ```

> [tab] API
>
> To complete this action with the Cortex XCOR API, use the
> [`ListCollections`](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/ListCollections) endpoint.
>
> Because the Cortex XCOR API requires authentication, include an API token with your
> `curl` request, as shown in the following example. For more details, see
> [Create an API token](https://docs-xcor.paloaltonetworks.com/tooling/api-info.md#create-an-api-token).
>
> ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
> export CHRONOSPHERE_API_TOKEN="TOKEN"
> export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"
>
> curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
>      -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
> ```
>
> Replace the following:
>
> * *`TOKEN`*: Your API token.
> * *`INSTANCE`*: The subdomain name for your organization's Cortex XCOR instance.
> * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
> * *`ENDPOINT_PATH`*: The specific endpoint you want to access.

## Create a collection

You can use Cortex XCOR to create Terraform, Chronoctl, or API
configurations, which you must then apply using the respective application.

Collections use a `slug` as an identifier. [Services](https://docs-xcor.paloaltonetworks.com/observe/services) also use a
`slug`. Collection and service slugs can have the same value.

> [tab] Web
>
> To create a collection, you must have administrative privileges.
>
> 1. In the navigation menu, click \*\* Go to admin view\*\*
>    and then click
>    **Platform > Collections**.
> 2. Click **Create collection**.
> 3. In the dialog that appears, enter a descriptive name in the **Collection Name**
>    field. Cortex XCOR displays this name anywhere that it refers to this
>    collection.
> 4. Optional: Click the **Parent team** dropdown and select a team to which
>    you're associating this collection. If the dropdown doesn't contain any teams,
>    you can create one.
> 5. Optional: Enter a description in the **Collection Description** field.
>    Cortex XCOR displays this description when you view this collection's
>    homepage.
> 6. Click **Save**.

> [tab] Chronoctl
>
> To create a collection using [Chronoctl](https://docs-xcor.paloaltonetworks.com/tooling/chronoctl), apply a `Collection` resource.
> The resource contains these fields:
>
> | Field | Type | Description |
> | - | - | - |
> | `name` | String | The collection name as displayed in Cortex XCOR. |
> | `slug` | String | Optional: A unique identifier that Cortex XCOR uses to identify the collection. If omitted, Cortex XCOR generates a slug. |
> | `team_slug` | String | Optional: The slug of the team with which you're associating with this collection. |
> | `description` | String | A description displayed when viewing this collection. |
> | `notification_policy_slug` | String | The slug of a notification policy that you're associating with this collection. |
>
> For example, this resource creates a new collection named `DBAs` with the slug
> `dbas-collection` and associated with `dbas-team`:
>
> ```yaml Chronoctl example icon="square-terminal" theme={null}
> api_version: v1/config
> kind: Collection
> spec:
>   slug: dbas-collection
>   name: DBAs
>   team_slug: dbas-team
>   description: Collection of database-related resources.
>   notification_policy_slug: dbas-policy
> ```
>
> To create the collection:
>
> 1. Save the `Collection` resource definition to a file, such as `collection.yaml`.
>
> 2. Test the changes with a dry run:
>
>    ```shell theme={null}
>    chronoctl collections create -f collection.yaml -d
>    ```
>
> 3. Apply the changes:
>
>    ```shell theme={null}
>    chronoctl collections create -f collection.yaml
>    ```

> [tab] Terraform
>
> To create a collection using [Terraform](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform), use
> the `chronosphere_collection` resource type.
>
> | Field | Type | Description |
> | - | - | - |
> | `name` | String | The collection name as displayed in Cortex XCOR. |
> | `slug` | String | Optional: A unique identifier that Cortex XCOR uses to identify the collection. If omitted, Cortex XCOR generates a slug. |
> | `team_id` | String | Optional: The identifier of the team with which you're associating with this collection. |
> | `description` | String | A description displayed when viewing this collection. |
> | `notification_policy_id` | String | Optional: The identifier of a notification policy that you're associating with this collection. |
>
> For example, this resource creates a new collection that Terraform refers to as
> `databases`, names it `Databases` in Cortex XCOR, provides a description, associates
> the collection with a notification policy, and assigns the collection to the team `dbas`:
>
> ```terraform Terraform example icon="square-terminal" theme={null}
> resource "chronosphere_collection" "infra" {
>   name        = "Databases"
>   team_id     = chronosphere_team.dbas.id
>   description = "Collection of resources related to database services."
>   notification_policy_id = chronosphere_notification_policy.np.id
> }
> ```

> [tab] API
>
> To complete this action with the Cortex XCOR API, use the
> [`CreateCollection`](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/CreateCollection) endpoint.
>
> Because the Cortex XCOR API requires authentication, include an API token with your
> `curl` request, as shown in the following example. For more details, see
> [Create an API token](https://docs-xcor.paloaltonetworks.com/tooling/api-info.md#create-an-api-token).
>
> ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
> export CHRONOSPHERE_API_TOKEN="TOKEN"
> export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"
>
> curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
>      -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
> ```
>
> Replace the following:
>
> * *`TOKEN`*: Your API token.
> * *`INSTANCE`*: The subdomain name for your organization's Cortex XCOR instance.
> * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
> * *`ENDPOINT_PATH`*: The specific endpoint you want to access.

## Edit a collection

> [tab] Web
>
> > [!NOTE]
> >
> > Users can modify Terraform-managed resources only by using Terraform.
> > [Learn more](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform#prevent-changes-to-managed-resources).
>
> To edit a collection, you must have administrative privileges.
>
> 1. In the navigation menu, click \*\* Go to admin view\*\* and
>    then select
>    **Platform > Collections**.
> 2. Click the name of the collection you want to modify.
> 3. In the **Collection information** section, click
>    \*\* Edit\*\*.
> 4. In the dialog that appears, edit the collection based on your needs.
> 5. Click **Save**.
>
> You can optionally select collections by checking the checkbox on each collection's
> row, which reveals an **Edit Team Association** button. Clicking this button allows
> you to select a parent team for all selected collections. If you select a team,
> click **Save** to save the edited association. For more Collection editing features,
> see [Edit a Collection](#edit-a-collection).

> [tab] Chronoctl
>
> To edit a collection using [Chronoctl](https://docs-xcor.paloaltonetworks.com/tooling/chronoctl), modify
> an existing `Collection` resource, then apply the change.
>
> To view `Collection` resources as Chronoctl YAML, see
> [View collections](#view-collections).
>
> 1. Copy the `Collection` resource for the collection you want to edit.
>
> 2. Save the collection to a file, such as `collection.yml`.
>
> 3. Modify the collection's fields. For details, see [Create a collection](#create-a-collection).
>
> 4. Test the changes with a dry run:
>
>    ```shell theme={null}
>    chronoctl collections create -f collection.yaml -d
>    ```
>
> 5. Apply the changes:
>
>    ```shell theme={null}
>    chronoctl collections create -f collection.yaml
>    ```

> [tab] Terraform
>
> To edit a collection using [Terraform](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform), modify
> its resource and apply it using Terraform.

> [tab] API
>
> To complete this action with the Cortex XCOR API, use the
> [`UpdateCollection`](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/UpdateCollection) endpoint.
>
> Because the Cortex XCOR API requires authentication, include an API token with your
> `curl` request, as shown in the following example. For more details, see
> [Create an API token](https://docs-xcor.paloaltonetworks.com/tooling/api-info.md#create-an-api-token).
>
> ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
> export CHRONOSPHERE_API_TOKEN="TOKEN"
> export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"
>
> curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
>      -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
> ```
>
> Replace the following:
>
> * *`TOKEN`*: Your API token.
> * *`INSTANCE`*: The subdomain name for your organization's Cortex XCOR instance.
> * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
> * *`ENDPOINT_PATH`*: The specific endpoint you want to access.

## Delete a collection

> [!WARNING]
>
> Before you delete a collection, you must first remove all of its monitors and dashboards.
> You can do this by either deleting them or moving them to other collections.

> [tab] Web
>
> > [!NOTE]
> >
> > Users can modify Terraform-managed resources only by using Terraform.
> > [Learn more](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform#prevent-changes-to-managed-resources).
>
> To delete a collection, you must have administrative privileges.
>
> 1. In the navigation menu, click \*\* Go to admin view\*\* and
>    then select
>    **Platform > Collections**.
> 2. Click the name of the collection you want to delete.
> 3. In the **Collection information** section, click
>    \*\* Edit\*\*.
> 4. In the dialog that appears, click **Delete collection**.

> [tab] Chronoctl
>
> > [!NOTE]
> >
> > Users can modify Terraform-managed resources only by using Terraform.
> > [Learn more](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform#prevent-changes-to-managed-resources).
>
> To delete a collection using [Chronoctl](https://docs-xcor.paloaltonetworks.com/tooling/chronoctl), use
> the `collections delete` command:
>
> ```shell /SLUG/ theme={null}
> chronoctl collections delete SLUG
> ```
>
> Replace *`SLUG`* with the slug for the collection you want to delete.
>
> For example, to delete a collection with the slug `dbas-collection`, run:
>
> ```shell theme={null}
> chronoctl collections delete dbas-collection
> ```

> [tab] Terraform
>
> To delete a resource that's managed by [Terraform](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform):
>
> 1. Edit your Terraform configuration file to remove the pre-existing resource
>    definition.
> 2. Run this command to remove the resource from Cortex XCOR:
>
>    ```shell theme={null}
>    terraform apply
>    ```

> [tab] API
>
> To complete this action with the Cortex XCOR API, use the
> [`DeleteCollection`](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/DeleteCollection) endpoint.
>
> Because the Cortex XCOR API requires authentication, include an API token with your
> `curl` request, as shown in the following example. For more details, see
> [Create an API token](https://docs-xcor.paloaltonetworks.com/tooling/api-info.md#create-an-api-token).
>
> ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
> export CHRONOSPHERE_API_TOKEN="TOKEN"
> export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"
>
> curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
>      -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
> ```
>
> Replace the following:
>
> * *`TOKEN`*: Your API token.
> * *`INSTANCE`*: The subdomain name for your organization's Cortex XCOR instance.
> * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
> * *`ENDPOINT_PATH`*: The specific endpoint you want to access.


## Related topics

- [CreateCollection](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/CreateCollection.md)
- [UpdateCollection](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/UpdateCollection.md)
- [ReadCollection](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/ReadCollection.md)
- [ListCollections](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/ListCollections.md)
- [DeleteCollection](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/DeleteCollection.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.