---
schema_version: "1"
id: 7b6cea40aba8ac7f7d8a5c315241c81e898f4708d14249d1a72750dff9654faf
title: CLI for API Governance
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/anypoint-cli/3.x/api-governance.md
canonical_url: https://docs.mulesoft.com/anypoint-cli/3.x/api-governance
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1d800a00ae9df098b6935870ec116081e33450981a1afb58accfdb5382e8ebd3
description: MuleSoft Documentation Site
release: 3.x
latest: false
---
---
product: Anypoint CLI
version: 3.x
---

# CLI for API Governance

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

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Command</p></td><td><p>Description</p></td></tr><tr><td><p><a href="#governance-api-evaluate">governance api evaluate</a></p></td><td><p>Evaluates filter criteria to determine which rulesets apply to APIs that meet that criteria</p></td></tr><tr><td><p><a href="#governance-api-inspect">governance api inspect</a></p></td><td><p>Inspects an API definition and lists its schemas</p></td></tr><tr><td><p><a href="#governance-api-validate">governance api validate</a></p></td><td><p>Validates an API definition against a specified governance ruleset</p></td></tr><tr><td><p><a href="#governance-document">governance document</a></p></td><td><p>Creates the documentation file for a governance ruleset definition</p></td></tr><tr><td><p><a href="#governance-profile-create">governance profile create</a></p></td><td><p>Creates a governance profile</p></td></tr><tr><td><p><a href="#governance-profile-delete">governance profile delete</a></p></td><td><p>Deletes a governance profile</p></td></tr><tr><td><p><a href="#governance-profile-info">governance profile info</a></p></td><td><p>Lists information for a specific governance profile ID</p></td></tr><tr><td><p><a href="#governance-profile-list">governance profile list</a></p></td><td><p>Lists all governance profiles for an organization</p></td></tr><tr><td><p><a href="#governance-profile-update">governance profile update</a></p></td><td><p>Updates a governance profile</p></td></tr><tr><td><p><a href="#governance-ruleset-clone">governance ruleset clone</a></p></td><td><p>Clones a governance ruleset and applies specified updates to rules</p></td></tr><tr><td><p><a href="#governance-ruleset-info">governance ruleset info</a></p></td><td><p>Lists ruleset rules</p></td></tr><tr><td><p><a href="#governance-ruleset-init">governance ruleset init</a></p></td><td><p>Initializes a governance ruleset definition based on a data schema</p></td></tr><tr><td><p><a href="#governance-ruleset-validate">governance ruleset validate</a></p></td><td><p>Validates a governance ruleset definition’s format</p></td></tr></tbody></table>

## governance api evaluate

`> governance api evaluate [options]`

This command evaluates specified filters to determine the rulesets that would be applied to your
APIs that meet that criteria.

Besides the default options `--help`, `-f/--fields` and `-o/--output` options, this command also
takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>--api=&lt;api&gt;</p></div></div></td><td><div><div><p>The API project against which you want to evaluate. The command uses the criteria in the project’s <code>exchange.json</code> file.</p></div></div></td></tr><tr><td><div><div><p>--criteria &lt;filtertype:filtervalue&gt;,…​</p></div></div></td><td><div><div><p>Enables you to apply filters against which to evaluate to identify rulesets. 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, <code>rest-api</code> or <code>async-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>status</code>: Lifecycle state of stable, development, or deprecated</p></li><li><p><code>env-type</code>: Environment type of any, production, or sandbox</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. APIs in the development lifecycle cannot have instances.</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,status:stable,status:development,status:deprecated,scope:rest-api,scope:async-api,env-type:production</p></div></div></td></tr></tbody></table>

> [!NOTE] This command must be run with either the `criteria` or the `api` option.

**Example commands:**

```copy
anypoint-cli governance api evaluate --criteria `tag:best,category:API Type:Experience API,scope:rest-api`

anypoint-cli governance api evaluate --api ~/Downloads/order-api-1.0.0-raml.zip
```

**Example output:**

Ruleset GAV 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

## governance api inspect

`> governance api inspect [options] <api-definition>`

This command inspects the API definition passed in `api-definition` and lists all its schemas, such
as headers, requests, and response payloads. You can use this schema information in the
`governance ruleset init` command. See [governance ruleset init](#governance-ruleset-init).

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

**Example command:**

```copy
anypoint-cli governance api inspect my-healthcare-api.yaml
```

**Example schema**

```copy
types:
  patientmultipleBirthBoolean:
    properties:
      multipleBirthBoolean:
        description: Whether patient is part of a multiple birth
        type: boolean
  patientmultipleBirthInteger:
    properties:
      multipleBirthInteger:
        description: Whether patient is part of a multiple birth
        type: integer

        .
        .
        .

  PatientEntry:
    type: FHIR_commons.Entry
    properties:
      resource: Patient

  PatientBundle:
    type: FHIR_commons.Bundle
    properties:
      entry?: PatientEntry[]
```

**Example output:**

'patientmultipleBirthBoolean', 'PatientBundle', 'patientmultipleBirthInteger', 'PatientEntry'

## governance api validate

`> governance api validate [options] <api-definition>`

This command validates the API definition passed in `api-definition` against specified rulesets.

You can specify `api-definition` as one of the following:

- An API project ZIP file

- An API project folder

- An asset identifier for an API project, if the `--remote` option is specified. An asset identifier
  is a group ID, asset ID, and version (GAV) that uniquely identifies each asset in Exchange.

You can specify rulesets against which to validate as follows:

- To use an existing `exchange.json` file that defines your API project’s ruleset dependencies,
  ensure that it is included in the folder or ZIP file that you specify in `api-definition`. If the
  `exchange.json` file is present, the command downloads all dependencies and validates against the
  rulesets in the project.

- To validate directly against rulesets published in Exchange, use the `--remote-rulesets` option.

- To validate against local rulesets, use the `--rulesets` option.

> [!NOTE] Duplicate rulesets are not detected, so if you use more than one of the preceding ways of
> identifying rulesets in the same command execution, some rulesets may be validated multiple times.

Besides the default options `--help`, `-f/--fields` and `-o/--output` options, this command also
takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>--rulesets &lt;ruleset-yaml-file1&gt;,&lt;ruleset-yaml-file2&gt;,…​</p></div></div></td><td><div><div><p>Local ruleset definitions. The <code>rulesets</code> option is followed by a comma-separated list of ruleset YAML files.</p></div></div></td></tr><tr><td><div><div><p>--remote-rulesets &lt;ruleset-asset-identifier&gt;,&lt;ruleset-asset-identifier&gt;,…​</p></div></div></td><td><div><div><p>Remote ruleset definitions. The <code>remote-rulesets</code> option is followed by a comma-separated list of ruleset asset identifiers. An asset identifier is a group ID, asset ID, and version (GAV) that uniquely identifies each asset in Exchange. For example: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;,&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code></p></div><div><p>See <a href="#exchange-asset-identifiers">Get Exchange Asset Identifiers (GAVs)</a>.</p></div></div></td></tr><tr><td><div><div><p>--remote</p></div></div></td><td><div><div><p>Flag to indicate that the validation should be done against a published API. The value passed in <code>api-definition</code> is the API’s asset identifier. An asset identifier is a group ID, asset ID, and version (GAV) that uniquely identifies each asset in Exchange. For example: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code></p></div><div><p>See <a href="#exchange-asset-identifiers">Get Exchange Asset Identifiers (GAVs)</a>.</p></div></div></td></tr></tbody></table>

**Example commands:**

```copy
anypoint-cli governance api validate ~/Downloads/order-api-1.0.0-raml.zip

anypoint-cli governance api validate ~/Downloads/order-api-1.0.0-raml

anypoint-cli governance api validate --rulesets /MyRulesets/ruleset1.yaml,/MyRulesets/ruleset2.yaml  ~/Downloads/order-api-1.0.0-raml.zip

anypoint-cli governance api validate --remote-rulesets 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1  ~/Downloads/order-api-1.0.0-raml.zip

anypoint-cli governance api validate --remote-rulesets 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1 --remote 8a840abd-e63a-4f8b-87ab-24052eda2017/order-api/1.0.0
```

**Example output:**

For a definition that is conformant to the ruleset:

Spec conforms with Ruleset

For a definition that is nonconformant to the ruleset:

Conforms: false Number of results: 3 **(1)**

Functional Validations
----------------------

Constraint: http://a.ml/vocabularies/amf/core#declaration-not-found Severity: Violation Message: not
supported scalar for documentation Target: null Range: \[(6,3)-(6,3)\] Location:
file:///Users/myuser/Downloads/order-api-1.0.0-raml/order-api-1.0.0-raml

Conformance Validations **(2)**
-----------------------

Constraint:
file:///exchange\_modules/68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.0/ruleset.yaml#/encodes/validations/api-must-have-documentation
**(3)** Severity: Warning **(4)** Message: Provide the documentation for the API. **(5)** Target:
amf://id#2 **(6)** Range: \[(2,0)-(6,4)\] **(7)** Location:
file:///Users/myuser/Downloads/order-api-1.0.0-raml/order-api-1.0.0-raml **(8)**

Constraint:
file:///exchange\_modules/8a840abd-e63a-4f8b-87ab-24052eda2017/best-practices-ruleset/1.0.0/bestpractices.yaml#/encodes/validations/api-must-have-documentation
Severity: Violation Message: Provide the documentation for the API Target: amf://id#2 Range:
\[(2,0)-(6,4)\] Location: file:///Users/myuser/Downloads/order-api-1.0.0-raml/order-api-1.0.0-raml

<table><tbody><tr><td><i data-value="1"></i><b>1</b></td><td>Total of functional and conformance validation issues found</td></tr><tr><td><i data-value="2"></i><b>2</b></td><td>Conformance issues section</td></tr><tr><td><i data-value="3"></i><b>3</b></td><td>Ruleset and rule to which this set of issues applies</td></tr><tr><td><i data-value="4"></i><b>4</b></td><td>Severity level for the issue</td></tr><tr><td><i data-value="5"></i><b>5</b></td><td>Description of the issue</td></tr><tr><td><i data-value="6"></i><b>6</b></td><td>AMF model node ID; for information on the AMF model, see <a href="https://docs.mulesoft.com/api-governance/create-custom-rulesets">Creating Custom Governance Rulesets</a></td></tr><tr><td><i data-value="7"></i><b>7</b></td><td>Beginning line number and column and end line number and column in the API definition where the issue occurs, where column is the offset from the beginning of the line and numbering for the offset starts at 0</td></tr><tr><td><i data-value="8"></i><b>8</b></td><td>The file in which the issue occurs, either the main file or one of its dependencies</td></tr></tbody></table>

## governance document

`> governance document [options] <ruleset> <doc-file>`

This command creates the documentation for the API Governance ruleset definition ZIP file specified
in `ruleset`. It puts the documentation in the `doc-file` ZIP file for you to upload and publish to
Exchange.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

**Example command:**

```copy
anypoint-cli governance document ~/temp/ruleset.yaml ~/temp/ruleset.doc.zip
```

**Example output:**

validation name \[ 'scalar-parameters' \] Saving to /Users/janedoe/temp/prof-1.doc.zip

## governance profile create

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

This command creates a 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.

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

See [Get Exchange Asset Identifiers (GAVs)](#exchange-asset-identifiers).

Besides the default options `--help`, `-f/--fields` and `-o/--output` options, this command also
takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>--criteria &lt;filtertype:filtervalue&gt;,…​</p></div></div></td><td><div><div><p>Enables you to apply filters to select the list of APIs to which the profile rulesets will 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, <code>rest-api</code> or <code>async-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>status</code>: Lifecycle state of stable, development, or deprecated</p></li><li><p><code>env-type</code>: Environment type of any, production, or sandbox</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. APIs in the development lifecycle cannot have instances.</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,status:stable,status:development,status:deprecated,scope:rest-api,scope:async-api,env-type:production</p></div></div></td></tr><tr><td><div><div><p>--tags &lt;tags&gt; <strong>Deprecated</strong></p></div></div></td><td><div><div><p><strong>The <code>--criteria</code> option replaces the <code>tags</code> option starting with Anypoint CLI version v3.17.0.</strong> In versions prior to v3.17.0, the <code>tags</code> option is followed by a comma separated list of tags to be applied to the new governance profile, formatted as follows: <code>tag1,tag2,tag3</code></p></div></div></td></tr><tr><td><div><div><p>--description &lt;description&gt;</p></div></div></td><td><div><div><p>The <code>description</code> option is followed by a string that is the new governance profile’s description.</p></div></div></td></tr><tr><td><div><div><p>--notify-contact</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>--notify-publisher</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>--notify-others &lt;email ID,email ID,…​&gt;</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 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,status:development,scope:rest-api" --description "Profile for OAS Best Practices"

anypoint-cli 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,status:stable,scope:rest-api" --description "Profile for REST API Best Practices" --notify-publisher  --notify-contact --notify-others a@a.a,b@b.com

anypoint-cli 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,status:stable,scope:rest-api,env-id:0683ce02-cd53-4028-a543-832a38a8af30" --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

## governance profile delete

`> governance profile delete [options] <profile-id>`

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

The `governance profile delete` command accepts only the default options: `--help`, `-f`/`--fields`
and `-o`/`--output`.

**Example command:**

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

**Example output:**

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

## governance profile info

`> governance profile info [options] <profile-id>`

This command lists all information for a governance profile ID.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

**Example command:**

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

**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

## governance profile list

`> governance profile list [options]`

This command lists information for all governance profiles for an organization. You need this
information when updating a governance profile.

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

**Example command:**

```copy
anypoint-cli governance profile list -o text
```

**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

## governance profile update

`> governance profile update [options] <profile-id>`

This command 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` options to update the notification
configuration or turn off notifications. Any changes override existing notification configurations.
If you do not use a `notify` option, no changes are made to the notification configuration.

Besides the default options `--help`, `-f/--fields` and `-o/--output` options, this command also
takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>--profile-name &lt;profile-name&gt;</p></div></div></td><td><div><div><p>The <code>profile-name</code> option is followed by a string that is the new governance profile name.</p></div></div></td></tr><tr><td><div><div><p>--ruleset-gavs &lt;ruleset-gavs&gt;</p></div></div></td><td><div><div><p>The <code>ruleset-gavs</code> option is 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 (GAVs)</a>.</p></div></div></td></tr><tr><td><div><div><p>--criteria &lt;filtertype:filtervalue&gt;,…​</p></div></div></td><td><div><div><p>Enables you to apply filters to select the list of APIs to which the profile rulesets will 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, <code>rest-api</code> or <code>async-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>status</code>: Lifecycle state of stable, development, or deprecated</p></li><li><p><code>env-type</code>: Environment type of any, production, or sandbox</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. APIs in the development lifecycle cannot have instances.</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,status:stable,status:development,status:deprecated,scope:rest-api,scope:async-api,env-type:production</p></div></div></td></tr><tr><td><div><div><p>--tags &lt;tags&gt; <strong>Deprecated</strong></p></div></div></td><td><div><div><p><strong>The <code>--criteria</code> option replaces the <code>tags</code> option starting with Anypoint CLI version v3.17.0.</strong> In versions prior to v3.17.0, the <code>tags</code> option is followed by a comma separated list of tags to be applied to the new governance profile, formatted as follows: <code>tag1,tag2,tag3</code></p></div></div></td></tr><tr><td><div><div><p>--description &lt;description&gt;</p></div></div></td><td><div><div><p>The <code>description</code> option is followed by a string that is the new governance profile description.</p></div></div></td></tr><tr><td><div><div><p>--notify-off</p></div></div></td><td><div><div><p>Disables notifications.</p></div></div></td></tr><tr><td><div><div><p>--notify-contact</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>--notify-publisher</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>--notify-others &lt;email ID,email ID,…​&gt;</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 governance profile update 4eaf9176-3ef9-4021-a67c-6e4bc10d3763 --profile-name "MyOrg Best Practices"

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

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

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

anypoint-cli governance profile update 19fb211b-8775-43cc-865a-46228921d6ed --criteria `tag:best,category:API Type:Experience API,status:production,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

### Limitations

You cannot configure notifications using the `governance profile update` command. After you create a
profile using the CLI, you can configure notifications by editing the profile in the API Governance
console. See
[Update a Governance Profile Using the API Governance Console](https://docs.mulesoft.com/api-governance/create-profiles#update-a-governance-profile-using-the-api-governance-console).

## governance ruleset clone

`> governance ruleset clone [options] <ruleset> <new_title> <new_description>`

This command clones a governance ruleset to create a new custom ruleset and applies specified
updates to rules based on the options. The new ruleset is written to standard output.

The `new-title` parameter gives the title for the new ruleset.

The `new description` parameter gives the description for the new ruleset.

> [!TIP] Run the `governance ruleset info` command before running this command to get the rule ID
> information to use in this command.

Besides the default options `--help`, `-f/--fields` and `-o/--output` options, this command also
takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>--remote</p></div></div></td><td><div><div><p>Indicates that the ruleset to clone is published in Exchange and that the <code>ruleset</code> parameter is the asset identifier for the ruleset. An asset identifier is the group ID, asset ID, and version (GAV) that uniquely identifies each asset in Exchange. For example: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code></p></div><div><p>See <a href="#exchange-asset-identifiers">Get Exchange Asset Identifiers (GAVs)</a>.</p></div></div></td></tr><tr><td><div><div><p>--error=&lt;list_rules_to_move_to_error&gt;</p></div></div></td><td><div><div><p>The <code>error</code> option is followed by the rule IDs for the rules to move to the error severity level section of the ruleset YAML.</p></div></div></td></tr><tr><td><div><div><p>--warning=&lt;list_rules_to_move_to_warning&gt;</p></div></div></td><td><div><div><p>The <code>warning</code> option is followed by the rule IDs for the rules to move to the warning severity level section of the ruleset YAML.</p></div></div></td></tr><tr><td><div><div><p>--info=&lt;list_rules_to_move_to_info&gt;</p></div></div></td><td><div><div><p>The <code>info</code> option is followed by the rule IDs for the rules to move to the info severity level section of the ruleset YAML.</p></div></div></td></tr><tr><td><div><div><p>--remove=&lt;list_rules_to_disable&gt;</p></div></div></td><td><div><div><p>The <code>remove</code> option is followed by the rule IDs for the rules to comment out, and therefore effectively disable, in the ruleset YAML.</p></div></div></td></tr></tbody></table>

**Example commands:**

```copy
anypoint-cli governance ruleset clone ~/Downloads/ruleset.yaml 'New Ruleset from Clone' 'Cloned from ruleset.yaml' --warning=operation-default-response,operation-operationId > mynewruleset.yaml

anypoint-cli governance ruleset clone 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.2 'Custom Anypoint Best Practices' 'Cloned from MuleSoft Anypoint Best Practices' --remote --remove=openapi-tags,operation-tags > my-anypoint-best-practices.yaml
```

## governance ruleset info

`> governance ruleset info [options] <governance-ruleset>`

This command lists the ruleset rules in the ruleset definition passed in the `governance-ruleset`
parameter.

Besides the default options `--help`, `-f/--fields` and `-o/--output` options, this command also
takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>--remote</p></div></div></td><td><div><div><p>Indicates that the ruleset for which to get information is published in Exchange and that the <code>ruleset</code> parameter is the asset identifier for the ruleset. An asset identifier is the group ID, asset ID, and version (GAV) that uniquely identifies an asset in Exchange. For example: <code>&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>. 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 (GAVs)</a>.</p></div></div></td></tr></tbody></table>

**Example commands:**

```copy
anypoint-cli governance ruleset info ~/temp/myruleset.yaml

anypoint-cli governance ruleset info 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.2 --remote

anypoint-cli governance ruleset info 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/latest --remote
```

**Example output:**

Ruleset /Users/myuser/temp/myruleset.yaml Violation operation-default-response Violation
operation-operationId Warning operation-singular-tag Warning tag-description Warning info-contact
Warning info-description Warning info-license Warning license-url Warning openapi-tags Warning
operation-description Warning operation-tags Warning operation-tag-defined

## governance ruleset init

`> governance ruleset init [options] <schema>`

This command initializes a ruleset based on the data schema passed in the `schema` parameter.

Besides the default options `--help`, `-f/--fields` and `-o/--output` options, this command also
takes:

<table><colgroup><col> <col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>--types &lt;types&gt;</p></div></div></td><td><div><div><p>The <code>types</code> option gives the target types to export as rules. You can use the <code>governance api inspect</code> command to identify the types to specify in this option. See <a href="#governance-api-inspect">governance api inspect</a>.</p></div></div></td></tr><tr><td><div><div><p>--name &lt;name&gt;</p></div></div></td><td><div><div><p>The <code>name</code> option is the name of the ruleset. Defaults to <code>GeneratedRuleset</code>.</p></div></div></td></tr></tbody></table>

**Example command:**

```copy
anypoint-cli governance ruleset init --types patientmultipleBirthBoolean,patientBundle,patientmultipleBirthInteger --name=my-ruleset mydataschema
```

## governance ruleset validate

`> governance ruleset validate [options] <governance-ruleset>`

This command validates the ruleset definitions passed using the `governance-ruleset` parameter. You
can pass one of the following as the `governance-ruleset` parameter:

- A ruleset definition YAML file

- A ZIP file that contains an API project with an `exchange.json` file that specifies the ruleset as
  the main file

- A folder that contains an API project with an `exchange.json` file that specifies the ruleset as
  the main file

This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.

**Example commands:**

```copy
anypoint-cli governance ruleset validate ~/temp/myruleset.yaml

anypoint-cli governance ruleset validate ~/temp/myruleset.zip

anypoint-cli governance ruleset validate ~/temp/myrulesetfolder
```

**Example output for a valid ruleset:**

Ruleset conforms with Dialect

**Example output for a nonvalid ruleset:**

Ruleset does not conform with Dialect ModelId: file:///Users/janedoe/temp/prof-1-bad.yaml Profile:
Validation Profile 1.0 Conforms: false Number of results: 1

Level: Violation

- Constraint:
  http://a.ml/amf/default\_document#/declarations/profileNode\_profile\_required\_validation
  Message: Property 'profile' is mandatory Severity: Violation Target:
  file:///Users/janedoe/temp/prof-1-bad.yaml#/encodes Property: http://schema.org/name Range:
  \[(3,0)-(11,19)\] Location: file:///Users/janedoe/temp/prof-1-bad.yaml

### Get Exchange Asset Identifiers (GAVs)

To get the GAVs for Exchange assets:

- If you are using the Exchange CLI, run the `anypoint-cli exchange asset list` command.

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