Configuring OpenAPI Specification for Heroku AppLink
Last updated July 14, 2025
Table of Contents
With Heroku AppLink, you can publish your Heroku app’s OpenAPI spec to Salesforce and generate actions. This article describes how to configure your OpenAPI spec to enable specific actions such as enabling Agentforce actions and define permission sets in Salesforce.
Enable Agentforce Topics and Actions
An agent topic contains actions an Agentforce agent can do.
To enable topics for an action, you must define the topic with the following annotations. If you have one topic defined, you must have at least one action defined as well. See SF Topic and Action Enablement for more information.
Extension | Description |
---|---|
x-sfdc/agent/topic/classificationDescription |
Required. Describes what the topic does. |
x-sfdc/agent/topic/scope |
Required. Sets the boundaries of the topic. |
x-sfdc/agent/topic/instructions |
Required. Sets the guidelines that tell your agent how to handle conversations in the context of the topic. |
x-sfdc/agent/topic/name |
Required. Sets the API name of the topic. It’s recommended to use snake case, starting with a letter, and containing alphanumeric characters, spaces, and underscores. |
To designate API operations as Agentforce agent actions, you must annotate at least one operation with the x-sfdc/agent/action/publishAsAgentAction
parameter set to true
. Agent actions require a schema that specifies the requisite metadata for their creation. This annotation activates the API for agent topics and actions.
Extension | Description |
---|---|
x-sfdc/agent/action/publishAsAgentAction |
Required. true enables the operation as an action. |
x-sfdc/agent/action/isUserInput |
Required if publishAsAgentAction is enabled. true surfaces the field for further user input. |
x-sfdc/agent/action/isDisplayable |
Required if publishAsAgentAction is enabled. true makes the field displayable to the user. |
x-sfdc/privacy/isPii |
Optional. If publishAsAgentAction is enabled, and this attribute is true , PII service is enabled for queries sent under that operation. |
Here’s an example of an OpenAPI spec that enables agent actions and topics:
openapi: 3.1.0
info:
title: Test API
version: '1.0'
x-sfdc:
agent:
topic:
classificationDescription: This API allows agents to book, modify, and cancel hotel reservations, as well as apply loyalty upgrades.
scope: Your job is to assist customers in booking hotel rooms based on their preferences, loyalty status, and availability. You should also be able to recommend upgrades if the customer qualifies.
instructions:
- If the customer asks to create a reservation, check for a check-in date, checkout date, roomType, or any special requests.
- If the preferred room type is unavailable, suggest alternative options with similar amenities.
paths:
/thing/{id}:
parameters:
- name: id
in: path
required: true
description: AI-friendly description
schema:
type: string
x-sfdc:
agent:
action:
isUserInput: true
get:
x-sfdc:
agent:
action:
publishAsAgentAction: true
operationId: get-a-thing
description: AI-friendly description
responses:
'200':
Customize Heroku App Settings
Optionally, you can define the connected app or the permission sets in Salesforce to elevate your user’s permission from the default user
mode to user-plus
mode.
Assign the specified permission set, along with the app’s standard permission set, to the users who need elevated permissions while the app is running. When the SDK is initialized, it combines the user’s Salesforce permissions with the permissions from this set, applying them to DML operations.
Extension | Description |
---|---|
x-sfdc/heroku/authorization/connectedApp |
Optional. Sets the name of the connected app to use. If none specified, we mint a user token required for the user mode. Note: This extension is required if you set x-sfdc/heroku/authorization/permissionSet . |
x-sfdc/heroku/authorization/permissionSet |
Optional. Sets session-based permission sets to use to elevate the user permission. |
Here’s an example of an OpenAPI spec that specifies a connected app and permission set to use:
openapi: 3.0.0
info:
...
paths:
/accounts:
get:
x-sfdc:
heroku:
authorization:
connectedApp: MyConnectedApp
permissionSet: MyPermSet