---
schema_version: "1"
id: 6bd355422428c6df7cf3b122e1f3cec3c1e54e624488f3db83a85d2bae2d4353
title: Classifying an API Instance into an Environment
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/api-manager/latest/classify-api-task.md
canonical_url: https://docs.mulesoft.com/api-manager/latest/classify-api-task
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 594fd82debd65dd04cf4ed9c0c5467692b246d8874ae26a89a3bc7047544610f
description: MuleSoft Documentation Site
release: 2.x
latest: true
---
---
product: API Manager
version: 2.x
is-latest-version: true
---

# Classifying an API Instance into an Environment

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

After you upgrade to API Manager 2.x your APIs are placed in an unclassified environment. You need
to classify unclassified APIs to govern or otherwise manage the APIs.

Even though API Manager supports tracking APIs with both organization and environment credentials,
MuleSoft recommends using environment credentials since the permissions associated to them are more
restrictive. You need to restart Mule Runtime after changing credentials. Restarting can cause
downtime. See
[Configuring Mule Servers with Environment Credentials (Advanced Classification: Optional)](#configuring-mule-servers-with-environment-credentials-advanced-classification-optional)
below for details on how to change them. After doing so, you may classify your API to an environment
that API Manager will suggest.

Using credentials from one environment does not allow:

- Tracking APIs from different environment

- Tracking APIs from different organizations

If you need to track APIs in either of these ways, use organization credentials.  
See [Configuring Organization Credentials in Mule Runtime 4](https://docs.mulesoft.com/mule-gateway/mule-gateway-org-credentials-mule4).

If you need to track APIs using environment credentials review the advanced section.

## Classifying the API Instance on API Manager

1.  In API Manager, click the environment control, which is labeled SANDBOX in this example:

    ![API Manager API Administration with the environment sandbox selected.](/mulesoft/current/en-us/api-manager/latest/_images/environment3.png)

    If you do not have a suitable environment you want to classify the API into, create the
    environment in Access Management. See
    [To Create a New Environment](https://docs.mulesoft.com/access-management/environments#to-create-a-new-environment)
    and [Reviewing Environment Concepts](https://docs.mulesoft.com/api-manager/latest/environments-concept) for more information.

2.  Select **Unclassified**.

    ![The Switch Environment dialog showing the environments.](/mulesoft/current/en-us/api-manager/latest/_images/switch-environment.png)

3.  Click **Switch**.

    A list of unclassified APIs appears.

    ![API Administration dialog box showing a list of unclassified APIs.](/mulesoft/current/en-us/api-manager/latest/_images/classify.png)

4.  If the **Classify** button is disabled, click **Reconnect** to link the unclassified API with
    its corresponding Exchange asset.

    ![Reconnect option that enables the Classify action for an unclassified API.](/mulesoft/current/en-us/api-manager/latest/_images/reconnect-api.png)

    Once the API is successfully reconnected, the **Classify** button becomes available.

5.  Click **Classify**.

6.  For **Target environment**, select the environment for the API from the list of environments
    available to you. For example, select **Test**.

7.  For **Instance name**, optionally type a unique instance name. For example, type `abc-api-1`.

    For environments, APIs can have more than a single instance. Therefore, an instance name is
    required to uniquely identify it.

    ![The Classify dialog box with example values in the Target environments and instance name fields.](/mulesoft/current/en-us/api-manager/latest/_images/classify-instance.png)

## Classifying the API Instance via REST API

You can also classify unclassified APIs using the Anypoint Platform REST APIs. This method is useful
for automation, scripting, or bulk updates.

> [!NOTE] Customers can continue using the REST APIs for classifying API instances after January
> 31, 2026. These endpoints remain available and supported for automation, scripting, and
> operational workflows.

Before you begin, obtain an authentication token using the Login API.

### Logging In

POST `/accounts/login`

Payload example:

```json
{ "username": "myusername", "password": "mypassword" }
```

Curl example:

```bash
curl --location 'https://anypoint.mulesoft.com/accounts/login' \
  -H 'Content-Type: application/json' \
  --data-raw '{"username":"myusername","password":"mypassword"}'
```

The response contains the bearer token you must use in subsequent requests.

### Getting the List of Unclassified APIs

Use this request to retrieve all API instances that are not yet classified into an environment.

GET `/apiplatform/repository/v2/organizations/{organizationId}/apis`

Example:

```bash
curl --location 'https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/00000000-0000-0000-0000-00000000000/apis' \
  --header 'Authorization: bearer <token>'
```

### Classifying an Unclassified API

Once you identify the API and version you want to classify, send the classification request.

POST
`/apiplatform/repository/v2/organizations/{organizationId}/apis/{apiId}/versions/{apiVersionId}/classify`

Payload:

```json
{
  "environmentId": "00000000-0000-0000-0000-00000000000",
  "instanceLabel": "mylabel"
}
```

Curl example:

```bash
curl --location 'https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/00000000-0000-0000-0000-00000000000/apis/0000000/versions/0000000/classify' \
  --header 'Authorization: bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{"environmentId": "00000000-0000-0000-0000-00000000000","instanceLabel": "mylabel"}'
```

Notes:

- `environmentId` is required.

- `instanceLabel` is optional.

- Existing client contracts continue to work after classification.

### Connecting the API to an Exchange Asset

An unclassified API must be linked to an asset in Exchange and must have an endpoint configured. To
associate the API with an Exchange asset, update the GAV coordinates using the following calls.

#### Update the API Root Object

PATCH `/apiplatform/repository/v2/organizations/{organizationId}/apis/{apiId}`

Payload:

```json
{
  "groupId": "{groupId}",
  "assetId": "{assetId}"
}
```

#### Update the API Version

PATCH
`/apiplatform/repository/v2/organizations/{organizationId}/apis/{apiId}/versions/{apiVersionId}`

Payload:

```json
{
  "assetVersion": "{assetVersion}"
}
```

Reference: Exchange Experience API
[https://dev-portal.mulesoft.com/apis/exchange-experience.html](https://dev-portal.mulesoft.com/apis/exchange-experience.html)

### Deleting an Unclassified API

You can delete an unclassified API using:

DELETE `/apiplatform/repository/v2/organizations/{organizationId}/apis/{apiId}`

Example:

```bash
curl --location --request DELETE 'https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/00000000-0000-0000-0000-00000000000/apis/0000000' \
  --header 'Authorization: bearer <token>'
```

If the API has existing contracts in **pending** or **approved** state, revoke them before deletion:

POST
`/apiplatform/repository/v2/organizations/{organizationId}/apis/{apiId}/versions/{apiVersionId}/contracts/{contractId}/revoke`

You can obtain `contractId` via:

GET
`/apiplatform/repository/v2/organizations/{organizationId}/applications/{applicationId}/contracts`

### API Analytics Impact

In the Pre-Crowd version of API Manager, all dashboards were organization-wide. In Crowd, each
dashboard links to a particular environment.

If you had custom reports for your APIs before migrating, those custom reports would no longer work
after you classify all your APIs.

### Configuring Mule Servers with Environment Credentials (Advanced Classification: Optional)

You can use this configuration to track APIs that use environment credentials. This configuration
requires a server restart.

The sections that follow help you classify your APIs depending on how you deployed proxies before
migration.

### Managing an API instance by using a Proxy deployed through API Manager

If your API was deployed in Runtime Manager:

1.  From API Administration, click the **API Name** of the API instance.

2.  Click **Runtime & Endpoint Configuration > Save & Deploy**.

3.  Select the **Runtime version**.

4.  Click **Save & Apply**.

If your API was deployed in an on-premises standalone runtime:

1.  From API Administration, click the **API Name** of the API instance.

2.  Click **Runtime & Endpoint Configuration > Save & Deploy**.

3.  Specify a runtime version for Mule Agent 1.9 and later.

4.  Click **Save & Apply**.

To update an existing server:

1.  Use SSH to access the standalone runtime server.

2.  Download the Runtime Agent 1.9 or later.

3.  Update the Gateway runtime agent.

4.  Restart the Gateway.

### Managing an API instance by using a Basic Endpoint or a Proxy deployed through Runtime Manager

If your API was deployed in Runtime Manager:

1.  Navigate to Access Manager.

2.  Click Environments.

3.  Click the environment name you want to use.

4.  Copy the Client ID and Client Secret.

To update an application in Runtime Manager:

1.  Navigate to the proxy application in Runtime Manager.

2.  Click Settings.

3.  Click Properties.

4.  Change the values of the following properties to the values from the Environment:

    - Anypoint.platform.client\_id

    - Anypoint.platform.client\_secret

5.  Click Apply changes.

To update an application deployed in standalone Mule Runtime:

1.  Use SSH to access the standalone runtime server where the application is deployed.

2.  Download Runtime Agent 1.9.x.

3.  Update the Runtime Agent.

4.  Restart the Mule Runtime.

### Other Deployments

This section explains the manual steps needed to prepare Mule Runtime to use API environments
without updating the agent or registering the server with Runtime Manager.

Getting the environment client ID and secret:

1.  Navigate to Access Manager.

2.  Click Environments.

3.  Click the environment name that you want to use.

4.  Copy the Client ID and Client Secret.

Updating an application in Runtime Manager:

1.  Navigate to the proxy application in Runtime Manager.

2.  Click Settings.

3.  Click Properties.

4.  Change the values of the following properties to the values from the environment:

    - anypoint.platform.client\_id

    - anypoint.platform.client\_secret

Updating standalone runtimes:

1.  Use SSH to access the runtime server that you want to update.

2.  Edit the `<mule_home>/<conf>/wrapper.conf` file.

3.  Change the values of the following properties to the values from the environment:

    - anypoint.platform.client\_id

    - anypoint.platform.client\_secret

4.  Restart Mule Runtime.

## See Also

- [To Shutdown, Restart and Delete a Server (Hybrid)](https://docs.mulesoft.com/runtime-manager/servers-actions)
