---
schema_version: "1"
id: 0364ff912990dde8fcb8ff1a0844901e12676dfca99efbda8699e6c8997bd3a4
title: Applying Rulesets to Identified APIs
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/api-governance/create-profiles.md
canonical_url: https://docs.mulesoft.com/api-governance/create-profiles
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c02163031d1c55ce81d0e17e8e4de34fa2de591f0306d0139a4ebb073b9afb2f
description: MuleSoft Documentation Site
latest: true
---
---
product: API Governance
---

# Applying Rulesets to Identified APIs

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

After you identify the APIs in Exchange that you want to govern, add your governance profiles.
Governance profiles enable you to filter the specific sets of APIs to govern for each set of
rulesets. When you create or update a profile, the set of APIs that meet the filter criteria in the
profile are validated against the set of rulesets selected in the profile.

> [!NOTE] Only API Governance and organization administrators can create, edit, and delete profiles.

## Governance Profiles and Applying Policies

Governance profiles validate APIs; they don’t apply or enforce policies. When you add rulesets to a
profile, the APIs that match the profile’s filter criteria are validated against those rulesets, and
their conformance is tracked over time. Use governance profiles for ongoing conformance validation
and reporting.

Applying a policy to your APIs is a separate capability. In the enhanced MuleSoft experience, you
can apply a policy in two ways:

Automated policies

Automatically attach a policy to every API that matches a set of criteria, such as runtime,
technology, or environment. The system applies policies by rule as APIs move in and out of scope.
Automated policies apply only to Anypoint API instances, including Flex Gateway and Mule Gateway.
They don’t apply to instances on third-party providers. A single, shared configuration governs all
matching APIs. If you change the configuration, the change applies to every in-scope API.

Open policies

Configure a policy once and apply it directly to one or more selected API instances. These policies
support third-party providers such as Google Apigee, Azure API Management, and Kong Gateway. The
system uses the configuration only to create a native policy on each selected instance. After
creation, each policy is independent. Editing the configuration of one policy doesn’t affect
policies on other instances.

> [!NOTE] Automated policies and open policies are available only in the enhanced MuleSoft
> experience. For more information, see
> [Working with Governance Strategies](https://docs.mulesoft.com/general/exp-governance-work-with-strategies) and
> [Apply Open Policies](https://docs.mulesoft.com/general/exp-governance-policy-library-apply).

## Create a Governance Profile Using the Governance Console

The Governance console UI guides you through creating profiles. You can save a profile as draft to
test your settings and activate it later.

> [!CAUTION] If you don’t select filter criteria, your governance profile applies rulesets to _all_
> of your APIs in Exchange.

### Considerations

- Start by saving your profiles as draft to test settings before revealing the targeted API’s
  conformance across Anypoint Platform.

- Select fewer rulesets and add more filters to narrow the scope of a single profile.

- Configure each profile to govern a related set of APIs for easier maintenance.

- Start with governing just a few APIs until you are familiar with API Governance and establish
  governance processes in your organization.

To create a governance profile using the Governance console:

1.  In **API Governance**, click **New Profile**.

2.  Follow the UI prompts to enter the following:

<table><colgroup><col> <col></colgroup><tbody><tr><td><div><div><p>Select Rulesets</p></div></div></td><td><div><div><p>Select one or more rulesets to use to govern your APIs.</p></div><div><p>Use the search box and filters to find the rulesets to use. You can filter rulesets by the following:</p></div><div><ul><li><p>Organization</p></li><li><p>Tag</p></li><li><p>Category</p></li></ul></div><div><p>You can select the version of each ruleset to use or select the <strong>Latest</strong> option. The default is <strong>Latest</strong>.</p></div><div><ul><li><p>If you select <strong>Latest</strong>, the profile automatically uses the latest version of that ruleset if any versions are published after the profile is saved. This ensures that the APIs selected in this profile are always validated against the latest version of rulesets without the need to manually update the profile.</p></li><li><p>If you select a specific version, the profile continues to use that version even if new versions of the rulesets are published after the profile is saved. This ensures that APIs selected in this profile that are conformant to a specific ruleset version are not inadvertently made nonconformant by a newly published version of the ruleset. You can update the profile and select a new version when you are ready to use the new ruleset version.</p></li></ul></div></div></td></tr><tr><td><div><div><p>Define Filter Criteria</p></div></div></td><td><div><div><p>To apply selected rulesets to specific APIs, select filter criteria. The filter criteria applies to your organization’s APIs that are in Exchange and to new APIs as you add them to Exchange.</p></div><div><p>A preview of filtered APIs appears in the <strong>Define Filter Criteria</strong> page as you apply filters. The preview shows only a few APIs and is not searchable. After you save the profile, you can view and search the list of governed APIs for that profile.</p></div><div><p><strong>General</strong> filters:</p></div><div><ul><li><p>API Types</p></li><li><p>Tags</p><div><p>The <strong>Tags</strong> section lists frequently used tags and the tags you add to the profile. See <a href="https://docs.mulesoft.com/api-governance/add-tags#select-and-add-tags">Select and Add Tags in Governance Profiles</a>.</p></div></li><li><p>Categories</p><div><p>Selections appear in the <strong>Categories</strong> section only if your APIs in Exchange have categories.</p></div><div><p>If you filter by multiple tags and categories, your APIs must have all of the selected tags and categories to match the criteria. See <a href="https://docs.mulesoft.com/api-governance/add-tags">Identifying APIs to Govern</a>.</p></div><div><p>If you filter by categories, you can see the number of categories for each API, which is denoted by <strong>Categories</strong> followed by a number in parenthesis. Hover over <strong>Categories</strong> to see more details.</p></div></li></ul></div><div><p><strong>API Instance</strong> filters:</p></div><div><ul><li><p>Include only APIs with instances</p><div><ul><li><p>Environment Type</p></li><li><p>Environment Name</p></li></ul></div></li></ul></div><div><p>If you select the <strong>API Instance</strong> filter <strong>Include only APIs with instances</strong>, only specifications that have an instance in API Manager are included. You can then optionally filter by environment type and environment name.</p></div></div></td></tr><tr><td><div><div><p>Set Notifications</p></div></div></td><td><div><div><p>Enable or disable automatic notifications for this profile. The default setting is enabled for active profiles. Notifications are automatically disabled for draft profiles. See <a href="https://docs.mulesoft.com/api-governance/configure-notifications#send-auto-notifs">Sending Conformance Notifications</a>.</p></div></div></td></tr><tr><td><div><div><p>Specify General Information</p></div></div></td><td><div><div><p>Enter a profile name and description that helps others understand the kinds of governance rulesets included and the kinds of APIs validated in this profile.</p></div></div></td></tr><tr><td><div><div><p>Review</p></div></div></td><td><div><div><p>Review your profile and click <strong>Save as a draft</strong> or <strong>Save as active</strong>:</p></div><div><ul><li><p>Save a profile as draft to test profile settings and review conformance information before showing the conformance information for its targeted APIs outside of the draft profile view.</p></li><li><p>Save a profile as active to show the conformance information outside of the draft profile view.</p></li></ul></div><div><p>When you save a profile as either draft or active, its targeted APIs become governed.</p></div></div></td></tr></tbody></table>

## Update a Governance Profile Using the Governance Console

The Governance console UI guides you through updating profiles.

To update governance profile information using the console:

1.  In the Governance console **Profiles** tab, click **Draft** or **Active**.

2.  For the profile you want to update, click the more options menu icon
    (![overflow menu icon](/mulesoft/current/en-us/api-governance/_images/overflow-menu-icon.png)) and then select **Edit**.

3.  Navigate through the UI using the **Next** and **Previous** buttons and update the profile
    information as needed. For details on the options, see
    [Create a Governance Profile Using the Governance Console](#create-profile-in-console).

4.  Review your changes and click **Update Profile**.

    After you apply your edits, the total APIs value refreshes to indicate how many APIs your
    governance profile includes based on your updated filter criteria.

## Activate a Draft Governance Profile

To activate a draft profile:

1.  In the Governance console **Profiles** tab, click **Draft** to show draft profiles.

2.  Click **Activate** for the profile to activate.

    After you activate a profile, its targeted APIs' conformance information appears outside of the
    draft profile view.

    If enabled, notifications are sent for failed validations.

## Duplicate a Governance Profile

To duplicate a profile:

1.  In the Governance console **Profiles** tab, click **Draft** or **Active**.

2.  Select a profile.

3.  Select **Profile Settings > Duplicate**.

    A copy of the profile opens.

4.  Follow the steps in
    [Create a Governance Profile Using the Governance Console](#create-profile-in-console).

## Delete a Governance Profile Using the Governance Console

To delete a governance profile:

1.  In the Governance console **Profiles** tab, click the more options menu icon
    (![overflow menu icon](/mulesoft/current/en-us/api-governance/_images/overflow-menu-icon.png)) for the profile to update and select
    **Delete**.

2.  Click **Yes, Delete**.

## Create Governance Profiles Using the API Governance CLI

To use the CLI to create an API Governance profile, use the following command:

### governance:profile:create

`> governance:profile:create [flags] <profile-name> <ruleset-asset-identifiers>`

Creates an active governance profile using a string value for the new governance profile name
specified in `profile-name`.

You must include `ruleset-asset-identifiers`, a comma-separated list of ruleset asset identifiers,
each of which is the group ID, asset ID, and version (GAV) that uniquely identifies each asset in
Exchange. For example: `<group_id>/<asset_id>/<version>,<group_id>/<asset_id>/<version>`, where
`<version>` is a specific version or `latest`. If you use `latest` as the version, the profile
automatically uses the latest version of the ruleset when versions are published after you create
the profile. See [Get Exchange Asset Identifiers](#exchange-asset-identifiers).

You can use one of the `notify` flags to configure notifications for the profile you are creating.
If you do not use a `notify` flag, no notifications are configured by the command. Notifications are
off by default.

In addition to the [default flags](https://docs.mulesoft.com/api-governance/#default-options), this command accepts the following flags:

<table><colgroup><col> <col></colgroup><thead><tr><th>Flag</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>--criteria &lt;filtertype:filtervalue&gt;,…​</code></p></div></div></td><td><div><div><p>Enables you to apply filters to select the list of APIs to which the profile rulesets apply. Specify a list of comma-separated filters where each filter has a type and value in the format <code>filtertype:filtervalue</code>.</p></div><div><p>Available filters include:</p></div><div><ul><li><p><code>scope</code>: API type. Supported values are: <code>async-api</code>, <code>http-api</code>, or <code>rest-api</code>.</p></li><li><p><code>tag</code>: Tag defined for APIs in Exchange.</p></li><li><p><code>category</code>: Category defined for APIs in Exchange, where the filter value is specified in two parts as <code>categoryName:value</code>.</p></li><li><p><code>env-type</code>: Environment type. Supported values are: <code>any</code>, <code>production</code>, or <code>sandbox</code>.</p></li><li><p><code>env-id</code>: The ID for the environment name in API Manager. You can get this value using <strong>API Manager</strong> &gt; <strong>Environment information</strong>. See <a href="https://docs.mulesoft.com/api-manager/latest/environments-concept">Reviewing Environment Concepts</a>.</p><div><p>If <code>env-type</code> or <code>env-id</code> is used, the <strong>API Instance</strong> filter is set in the profile, so that only APIs that have instances are filtered.</p></div><div><p>To deselect the <strong>API Instance</strong> filter in the profile using the CLI, update the profile using the <code>--criteria</code> flag with neither <code>env-type</code> nor <code>env-id</code>.</p></div></li></ul></div><div><p>Example: tag:tag1,category:category1:value,category:category2:value2,scope:rest-api,scope:async-api,env-type:production</p></div></div></td></tr><tr><td><div><div><p><code>--description &lt;description&gt;</code></p></div></div></td><td><div><div><p>The <code>description</code> flag is followed by a string that is the new governance profile’s description.</p></div></div></td></tr><tr><td><div><div><p><code>--notify-contact</code></p></div></div></td><td><div><div><p>Enables notifications and sets the recipient to the contact set for the API.</p></div></div></td></tr><tr><td><div><div><p><code>--notify-publisher</code></p></div></div></td><td><div><div><p>Enables notifications and sets the recipient to the API publisher.</p></div></div></td></tr><tr><td><div><div><p><code>--notify-others &lt;email ID,email ID,…​&gt;</code></p></div></div></td><td><div><div><p>Enables notifications and sets the recipient to the specified list of email IDs.</p></div></div></td></tr></tbody></table>

**Example commands:**

```copy
anypoint-cli-v4 governance:profile:create "OAS Best Practices" 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1 --criteria "tag:oas,category:API Type:Experience API,scope:rest-api" --description "Profile for OAS Best Practices"

anypoint-cli-v4 governance:profile:create "Open API Best Practices" 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1 --criteria "tag:oas,category:API Type:Experience API,scope:rest-api" --description "Profile for OAS Best Practices"

anypoint-cli-v4 governance:profile:create "Anypoint Best Practices" 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-api-best-practices/1.0.1 --criteria "tag:raml tag:oas category:API Type:Experience API,scope:rest-api" --description "Profile for REST API Best Practices" --notify-publisher  --notify-contact --notify-others a@a.a,b@b.com

anypoint-cli-v4 governance:profile:create "Primary API Standards" 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/latest,68ef9520-24e9-4cf2-b2f5-620025690913/myorg-best-practices/1.0.2 --criteria "tag:prim,category:API Type:Experience API,scope:rest-api" --description "Profile for Primary API Standards"
```

**Example output:**

Profile Added Id 4f98e59d-8efb-420f-ac95-9cd0af15bd45 Name OAS Best Practices Description Profile
for OAS Best Practices Rulesets
gav://68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1 Filter tag:best

## List Governance Profile Information Using the API Governance CLI

To use the CLI to list governance profile information for all governance profiles, use the following
command:

### governance:profile:list

`> governance:profile:list [flags]`

Lists information for all governance profiles for an organization. You need this information when
updating a governance profile.

In addition to the [default flags](https://docs.mulesoft.com/api-governance/#default-options), this command accepts the following flags:

<table><colgroup><col> <col></colgroup><thead><tr><th>Flag</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>--output &lt;output-format&gt;</code></p></div></div></td><td><div><div><p>Format for the command output. Supported values are <code>table</code> (default) and <code>json</code>.</p></div></div></td></tr></tbody></table>

**Example command:**

```copy
anypoint-cli-v4 governance:profile:list
```

**Example output:**

Profile Name Profile Id

Minimum Security Requirements 1f418cf4-b870-4b31-8734-f55f28d45f8f Best Practices
19fb211b-8775-43cc-865a-46228921d6ed New Best Practices 4eaf9176-3ef9-4021-a67c-6e4bc10d3763 OAS
Standards 51ae8795-2278-407e-942f-becba29af986

## List Specific Governance Profile Information Using the API Governance CLI

To use the CLI to list governance profile information for a specific governance profile ID, use the
following command:

### governance:profile:info

`> governance:profile:info [flags] <profile-id>`

Lists all information for a governance profile ID

In addition to the [default flags](https://docs.mulesoft.com/api-governance/#default-options), this command accepts the following flags:

<table><colgroup><col> <col></colgroup><thead><tr><th>Flag</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>--output &lt;output-format&gt;</code></p></div></div></td><td><div><div><p>Format for the command output. Supported values are <code>table</code> (default) and <code>json</code>.</p></div></div></td></tr></tbody></table>

**Example command:**

```copy
anypoint-cli-v4 governance:profile:info 19fb211b-8775-43cc-865a-46228921d6ed
```

**Example output:**

Id 19fb211b-8775-43cc-865a-46228921d6ed Name Best Practices Description Best Practices Profile
Rulesets 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.0
8a840abd-e63a-4f8b-87ab-24052eda2017/best-practices-ruleset/1.0.0
68ef9520-24e9-4cf2-b2f5-620025690913/required-examples/1.0.0 Criteria tag:best,category:API
Type:Experience API,scope:rest-api NotificationConfig Contact,Publisher

## Update a Governance Profile Using the API Governance CLI

To use the CLI to update a governance profile, use the following command:

### governance:profile:update

`> governance:profile:update [flags] <profile-id>`

Updates the governance profile specified in `profile-id`. To get this ID, run the
`governance:profile:info` or `governance:profile:list` command.

You can update the governance profile’s general information, rulesets, filter criteria, and
notification configuration. You can use one of the `notify` flags to update the notification
configuration or turn off notifications. Any changes override existing notification configurations.
If you do not use a `notify` flag, no changes are made to the notification configuration.

In addition to the [default flags](https://docs.mulesoft.com/api-governance/#default-options), this command accepts the following flags:

<table><colgroup><col> <col></colgroup><thead><tr><th>Flag</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>--profile-name &lt;profile-name&gt;</code></p></div></div></td><td><div><div><p>The <code>profile-name</code> flag is followed by a string that is the new governance profile name.</p></div></div></td></tr><tr><td><div><div><p><code>--ruleset-gavs &lt;ruleset-gavs&gt;</code></p></div></div></td><td><div><div><p>The <code>ruleset-gavs</code> flag is followed by a list with the asset identifier for each ruleset, formatted as follows: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;,&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code>, where <code>&lt;version&gt;</code> is a specific version or <code>latest</code>. An asset identifier is a unique group ID, asset ID, and version (GAV) that identifies each asset in Exchange. If you use <code>latest</code> as the version, the profile automatically uses the latest version of the ruleset when versions are published after you create the profile.</p></div><div><p>See <a href="#exchange-asset-identifiers">Get Exchange Asset Identifiers</a>.</p></div></div></td></tr><tr><td><div><div><p><code>--criteria &lt;filtertype:filtervalue&gt;,…​</code></p></div></div></td><td><div><div><p>Enables you to apply filters to select the list of APIs to which the profile rulesets apply. Specify a list of comma-separated filters where each filter has a type and value in the format <code>filtertype:filtervalue</code>.</p></div><div><p>Available filters include:</p></div><div><ul><li><p><code>scope</code>: API type. Supported values are: <code>async-api</code>, <code>http-api</code>, or <code>rest-api</code>.</p></li><li><p><code>tag</code>: Tag defined for APIs in Exchange.</p></li><li><p><code>category</code>: Category defined for APIs in Exchange, where the filter value is specified in two parts as <code>categoryName:value</code>.</p></li><li><p><code>env-type</code>: Environment type. Supported values are: <code>any</code>, <code>production</code>, or <code>sandbox</code>.</p></li><li><p><code>env-id</code>: The ID for the environment name in API Manager. You can get this value using <strong>API Manager</strong> &gt; <strong>Environment information</strong>. See <a href="https://docs.mulesoft.com/api-manager/latest/environments-concept">Reviewing Environment Concepts</a>.</p><div><p>If <code>env-type</code> or <code>env-id</code> is used, the <strong>API Instance</strong> filter is set in the profile, so that only APIs that have instances are filtered.</p></div><div><p>To deselect the <strong>API Instance</strong> filter in the profile using the CLI, update the profile using the <code>--criteria</code> flag with neither <code>env-type</code> nor <code>env-id</code>.</p></div></li></ul></div><div><p>Example: tag:tag1,category:category1:value,category:category2:value2,scope:rest-api,scope:async-api,env-type:production</p></div></div></td></tr><tr><td><div><div><p><code>--description &lt;description&gt;</code></p></div></div></td><td><div><div><p>The <code>description</code> flag is followed by a string that is the new governance profile description.</p></div></div></td></tr><tr><td><div><div><p><code>--notify-off</code></p></div></div></td><td><div><div><p>Disables notifications.</p></div></div></td></tr><tr><td><div><div><p><code>--notify-contact</code></p></div></div></td><td><div><div><p>Enables notifications and sets the recipient to the contact set for the API.</p></div></div></td></tr><tr><td><div><div><p><code>--notify-publisher</code></p></div></div></td><td><div><div><p>Enables notifications and sets the recipient to the API publisher.</p></div></div></td></tr><tr><td><div><div><p><code>--notify-others &lt;email ID,email ID,…​&gt;</code></p></div></div></td><td><div><div><p>Enables notifications and sets the recipient to the specified list of email IDs.</p></div></div></td></tr></tbody></table>

**Example commands:**

```copy
anypoint-cli-v4 governance:profile:update 4eaf9176-3ef9-4021-a67c-6e4bc10d3763 --profile-name "MyOrg Best Practices"

anypoint-cli-v4 governance:profile:update 19fb211b-8775-43cc-865a-46228921d6ed --criteria `tag:best,category:API Type:Experience API,scope:rest-api`

anypoint-cli-v4 governance profile update 67eff44a-28a3-43d4-93d9-bddedb92c711 --notify-publisher  --notify-contact --notify-others a@a.a,b@b.com

anypoint-cli-v4 governance profile update 67eff44a-28a3-43d4-93d9-bddedb92c711 --notify-off

anypoint-cli-v4 governance profile update 19fb211b-8775-43cc-865a-46228921d6ed --criteria `tag:best,category:API Type:Experience API,scope:rest-api,env-type:production` --ruleset-gavs 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/latest,68ef9520-24e9-4cf2-b2f5-620025690913/myorg-best-practices/latest
```

**Example output:**

Profile updated 51f9f94c-fb0c-43d4-9895-22c9e64f1537

#### Get Exchange Asset Identifiers

To get the full asset identifier (group ID/asset ID/version) for Exchange assets:

- If you are using Anypoint CLI, run the `exchange:asset:list` command.

- If you are using the Anypoint Platform web UI, select the asset in Exchange and copy the group ID
  and asset ID from the URL. Then, add the version node for the version you are viewing. For
  example, the asset identifier for the OpenAPI Best Practices ruleset in Exchange is
  `68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1`.

## Delete a Governance Profile Using the API Governance CLI

To use the CLI to delete a governance profile, use the following command:

### governance:profile:delete

`> governance:profile:delete [flags] <profile-id>`

Deletes a specific governance profile specified by `profile-id`. To get this ID, run the
`governance:profile:info` or `governance:profile:list` command.

This command accepts the [default flags](https://docs.mulesoft.com/api-governance/#default-options).

**Example command:**

```copy
anypoint-cli-v4 governance:profile:delete 8ffd463f-86b2-4132-afc6-44d179209362
```

**Example output:**

Profile with id 8ffd463f-86b2-4132-afc6-44d179209362 removed

## See Also

- [Identifying APIs to Govern](https://docs.mulesoft.com/api-governance/add-tags)

- [Creating Custom Governance Rulesets](https://docs.mulesoft.com/api-governance/create-custom-rulesets)

- [CLI Commands for API Governance](https://docs.mulesoft.com/api-governance/cli-command-list)
