You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs). info

Collections enable you to group API proxies, targets, or developer apps and
set up appropriate threshold values for all members of the group to diagnose issues faster.

The following sections describe how to manage collections using the API.

- [Create collections using the API](https://docs.apigee.com/api-monitoring/collections-api#create-collections)
- [View all collections using the API](https://docs.apigee.com/api-monitoring/collections-api#view-collections)

See [Collections API](https://apidocs.apigee.com/docs/collections/1/overview) for more on the collections API.

## Create collections using the API

Create a collection of API proxies by issuing a POST request to the following
resource: `https://apimonitoring.enterprise.apigee.com/collections`

The following example shows how to create a collection.

```
curl 'https://apimonitoring.enterprise.apigee.com/collections' \
  -X POST \
  -H 'Accept: application/json, text/plain, */*' -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
     "organization":"myorg",
     "name":"My Collection",
     "description":"My collection for critical APIs",
     "environment": "prod",
     "type": "proxy",
     "members":["proxy1", "proxy2"]
    }'
```

Set `$ACCESS_TOKEN` to your OAuth 2.0 access token, as described in [Obtain an OAuth 2.0 access token](https://docs.apigee.com/api-monitoring/api#oauth2).

For information about the cURL options used in this example, see [Use cURL](https://docs.apigee.com/api-monitoring/api#curl).

You can specify the `type` value as `proxy`, `target`, or `developerApp`.
For example, to create a collection of developer apps:

```
curl 'https://apimonitoring.enterprise.apigee.com/collections' \
  -X POST \
  -H 'Accept: application/json, text/plain, */*' -H "Content-Type: application/json"\
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
     "organization":"myorg",
     "name":"My Dev App Collection",
     "description":"My collection for critical apps",
     "environment": "prod",
     "type": "developerApp",
     "members":["app1", "app2"]
    }'
```

## View all collections using the API

View all alerts and notifications by issuing a GET request to the following resource: `https://apimonitoring.enterprise.apigee.com/collections`

You must pass the name of your organization using the `org` query parameter.

For example:

```
curl 'https://apimonitoring.enterprise.apigee.com/collections?org=myorg' 
  -X GET
  -H 'Accept: application/json, text/plain, */*' 
  -H "Authorization: Bearer $ACCESS_TOKEN"    
```

The following provides an example of the response:

```
[{
     "uuid":"1234abcd",
     "organization":"myorg",
     "environment": "prod",
     "name":"My Collection",
     "type": "proxy",
     "members":["proxy1", "proxy2"],
     "description":"My collection for critical APIs",
     "updatedAt":"2018-07-13T16:25:15Z",
     "updatedBy":"joe@acme.com"
}]
```

<br />

Set `$ACCESS_TOKEN` to your OAuth 2.0 access token, as described in [Obtain an OAuth 2.0 access token](https://docs.apigee.com/api-monitoring/api#oauth2).

For information about the cURL options used in this example, see [Use cURL](https://docs.apigee.com/api-monitoring/api#curl).

Append the `uuid` of the collection to the `/collections` resource to view the
specific collection:

```
curl 'https://apimonitoring.enterprise.apigee.com/collections/1234abcd?org=myorg'
  -X GET
  -H 'Accept: application/json, text/plain, */*' 
  -H "Authorization: Bearer $ACCESS_TOKEN"    
```