sshvarzman-salesforce/claude-skills

sf-agent-api-setup

Agent API onboarding — External Client App (ECA), OAuth client credentials flow, token minting, and agent ID retrieval.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/sshvarzman-salesforce/claude-skills --skill sf-agent-api-setup

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Agent API Setup and Authentication

Use This Skill When

  • Standing up access to the Agentforce Agent API (einstein/ai-agent/v1) for the first time.
  • Creating the External Client App (ECA) and choosing OAuth scopes and flow settings.
  • Minting a bearer token via the client credentials flow.
  • Resolving the correct base endpoint (api.salesforce.com vs api.gov.salesforce.com) and My Domain URL.
  • Finding the agent ID from the Legacy or new Agentforce Builder.

Prerequisites

  • Agentforce enabled with at least one activated agent.
  • Agent API is not supported for agents of type "Agentforce (Default)".
  • A Run As user with at least API Only access for the client credentials flow.

Quick Start (Setup Path)

Follow these steps in order. For screen-by-screen ECA settings and the full token/response reference, see reference.md.

1. Create the External Client App

Setup → External Client Apps Manager → New External Client App. Set name + contact email, enable OAuth, and add these scopes:

  • api — Manage user data via APIs
  • refresh_token, offline_access — Perform requests at any time
  • chatbot_api — Access chatbot services
  • sfap_api — Access the Salesforce API Platform

Enable Client Credentials Flow and Issue JWT-based access tokens for named users. Deselect the three "Require secret / Require PKCE" options. Then on the Policy tab, enable Client Credentials Flow and set Run As to an API-only user.

2. Get the consumer key and secret

App Settings tab → OAuth Settings → Consumer Key and Secret. Copy both. Never commit these.

3. Mint a token (client credentials)

bash
curl https://{MY_DOMAIN_URL}/services/oauth2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={CONSUMER_KEY}' \
--data-urlencode 'client_secret={CONSUMER_SECRET}'

Copy access_token from the JSON response. This bearer token is required on every Agent API call.

4. Get the agent ID

  • Legacy Agentforce Builder: open the Agent Overview page in Setup; copy the 18-character ID at the end of the URL (for example 0XxSB000000IPCr0AO).
  • New Agentforce Builder: the bot ID is the agent ID. Query BotDefinition:
sql
SELECT Id, DeveloperName FROM BotDefinition WHERE DeveloperName = 'Agentforce_Service_Agent'

Or via CLI: sf data query --query "SELECT Id, DeveloperName, AgentType FROM BotDefinition"

5. Make your first call

bash
curl --location -X POST https://api.salesforce.com/einstein/ai-agent/v1/agents/{AGENT_ID}/sessions \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--data '{
  "externalSessionKey": "{RANDOM_UUID}",
  "instanceConfig": { "endpoint": "https://{MY_DOMAIN_URL}" },
  "streamingCapabilities": { "chunkTypes": ["Text"] },
  "bypassUser": true
}'

Endpoint Reference

PurposeBase URL
Standardhttps://api.salesforce.com/einstein/ai-agent/v1
Government Cloudhttps://api.gov.salesforce.com/einstein/ai-agent/v1

instanceConfig.endpoint must be your My Domain URL (https://xxx.my.salesforce.com), not the Lightning URL (*.lightning.force.com).

Guardrails

  • Store the consumer secret and access token server-side only; never ship them to a browser or commit them to source control.
  • Use the My Domain URL for instanceConfig.endpoint — using the Lightning URL causes EngineConfigLookupException (HTTP 500).
  • bypassUser: true runs as the agent-assigned user; false runs as the token user. Pick deliberately based on data-access requirements.
  • Government Cloud orgs must use api.gov.salesforce.com everywhere — the standard host returns 404.
  • Tokens are short-lived; build refresh into the client rather than pasting a static token.

Deliverables

  • Configured ECA with the four required scopes and client credentials flow enabled.
  • A documented token-minting command/secret-storage plan.
  • The resolved agent ID and My Domain URL captured for the target org.
  • A verified first Start Session response.

Additional Resources

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
sshvarzman-salesforce
커뮤니티

activating-datacloud

Salesforce Data Cloud Act phase. Use this skill when the user manages activations, activation targets, data actions, or downstream delivery of Data Cloud audiences and data. TRIGGER when: user manages activations, activation targets, data actions, or downstream delivery of Data Cloud audiences and data. DO NOT TRIGGER when: the task is segment creation (use segmenting-datacloud), data retrieval/search work (use retrieving-datacloud), or STDM/session tracing (use observing-agentforce).

설치 수
1
GitHub Stars
0
업데이트
10월 15일
sshvarzman-salesforce
커뮤니티

agentforce-skills-research

Research Agentforce configuration patterns — topics, actions, instructions, CLTs, knowledge, planner behavior. Searches Salesforce docs, Trailhead, internal repos (git.soma), Slack channels, and Google Docs to find working examples, known issues, and best practices.

설치 수
1
GitHub Stars
0
업데이트
10월 15일
sshvarzman-salesforce
커뮤니티

harmonizing-datacloud

Salesforce Data Cloud Harmonize phase. Use this skill when the user works with DMOs, mappings, relationships, identity resolution, unified profiles, data graphs, or universal IDs. TRIGGER when: user works with DMOs, mappings, relationships, identity resolution, unified profiles, data graphs, or universal IDs. DO NOT TRIGGER when: the task is only about streams/DLOs (use preparing-datacloud), segments/insights (use segmenting-datacloud), retrieval/search (use retrieving-datacloud), or STDM/sessio

설치 수
1
GitHub Stars
0
업데이트
10월 15일
sshvarzman-salesforce
커뮤니티

preparing-datacloud

Salesforce Data Cloud Prepare phase. Use this skill when the user creates or manages Data Cloud data streams, DLOs, transforms, or Document AI configurations. TRIGGER when: user creates or manages Data Cloud data streams, DLOs, transforms, or Document AI configurations, or asks about ingestion into Data Cloud. DO NOT TRIGGER when: the task is connection setup only (use connecting-datacloud), DMOs and identity resolution (use harmonizing-datacloud), or query/search work (use retrieving-datacloud)

설치 수
1
GitHub Stars
0
업데이트
10월 15일