OpenAPI Extensions to Automatically Create Agent Actions

Add optional OpenAPI extensions to your OpenAPI document to automatically create agent actions when you deploy.

To validate and test documents to make sure that they work with your AuraEnabled Apex controller methods, make sure that the MuleSoft for Agentforce API Design Extension in the MuleSoft for Agentforce Extension Pack (beta) is installed.

Extension Description
x-sfdc/agent/action/publishAsAgentAction Required. Set this attribute to true to enable the operation as an action.
x-sfdc/privacy/isPii Optional. If publishAsAgentAction is enabled, set this attribute to true to enable PII service for queries sent under that operation.
x-sfdc/agent/action/isUserInput Required if publishAsAgentAction is enabled. Set this attribute to true to surface the field to the user for further input.
x-sfdc/agent/action/isDisplayable Required if publishAsAgentAction is enabled. Set this attribute to true for the field to be displayable to the user.

These OpenAPI extensions are boolean fields you can add to a resource path in your OpenAPI document. For example:

...
paths:
  /AccountController/createAccount:
    description: Default description for the path.
    post:
      description: Default description for the operation.
      operationId: createAccount
      x-sfdc:
        agent:
          action:
            publishedAsAgentAction: true
      requestBody:
        description: Default description for the requestBody.
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                accountName:
                  type: string
      responses:
        "200":
          description: Status Code 200
          content:
            application/json:
              schema:
                type: string
...

Confirm the Availability of Agent Actions

If you add the OpenAPI extensions, confirm that the agent actions based on the deployed API are available in your org.

  1. From Setup, in the Quick Find box, enter Agentforce Assets and select it.
  2. Click the Actions tab, then filter the list by searching for AuraEnabled.
  3. To create additional agent actions, click New Agent Action.

See Also