Create Connected App (OAuth)
sf_create_connected_appEnable OAuth 2.0 authentication for external applications by creating a Salesforce Connected App. Specify callback URLs, OAuth scopes, and contact email to support web, mobile, or server-to-server integrations.
Instructions
Creates a Connected App in Salesforce to enable OAuth authentication for external applications. Connected Apps are required for any external system that wants to connect to Salesforce via OAuth 2.0. Specify callback URLs for the OAuth flow, OAuth scopes (api, web, full, offline_access, etc.), and contact email. Used for web apps, mobile apps, desktop apps, or server-to-server integrations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | Display label | |
| scopes | Yes | OAuth scopes to request. Use 'chatbot_api' (deploys as the metadata literal 'Chatbot', verified against a live org 2026-07-31) for any external client calling a Salesforce bot/Agentforce agent — without it, Agent API calls using this app's tokens are rejected regardless of the agent's own state. | |
| fullName | Yes | Connected app API name, e.g. 'My_External_App' | |
| startUrl | No | Default start URL after OAuth | |
| consumerKey | No | Custom consumer key (auto-generated if not specified) | |
| description | No | Description | |
| callbackUrls | Yes | OAuth callback URLs, e.g. ['https://myapp.com/oauth/callback'] | |
| contactEmail | Yes | Contact email for the app | |
| accessTokenValidity | No | Access token validity in minutes | |
| refreshTokenValidity | No | Refresh token validity in minutes | |
| enableClientCredentialsFlow | No | Sets isClientCredentialEnabled/isAdminApproved on the deployed ConnectedApp (verified accepted by Metadata API 2026-07-31). NOTE: Salesforce still requires an admin to open Setup → App Manager → Edit Policies and pick the 'Run As' user for Client Credentials Flow, and the Consumer Secret can only ever be viewed/copied from that same Setup UI — neither is exposed by any API. This flag alone does not make the flow usable. PREFER sf_create_external_client_app instead: on External Client Apps, Client Credentials Flow (including its 'Run As' user) IS fully settable via the Metadata API — only the Consumer Secret still requires a one-time Setup UI visit, for either app type. |