{"id":"f6292187-667a-49c3-8a9f-c408a98b6270","task":"Integrate an external application with a Salesforce Einstein Bot using the Einstein Bots Runtime API","domain":"developer.salesforce.com","steps":["Enable and publish an Einstein Bot in Salesforce Setup; note the Bot ID (the 18-character record ID from the Bot Overview page URL) and obtain the runtime base URL (e.g., https://runtime-api-na-west.prod.chatbots.sfdc.sh).","Obtain a Salesforce OAuth access token; include it as the Authorization: Bearer header, and also send the X-Org-Id header set to your org's 18-character ID on every request.","Begin a bot session by POSTing to https://<runtime-base-url>/v5.0.0/bots/<botId>/sessions with a JSON body specifying the forceConfig (including orgId and endpoint) and externalSessionKey.","Capture the sessionId from the response and send user messages via POST https://<runtime-base-url>/v5.0.0/bots/<botId>/sessions/<sessionId>/messages with body {\"message\": {\"text\": \"<user input>\"}}.","Parse the bot's reply from the messages array in the response; handle rich response types (text, options, image) that may appear in the items array.","End the session by sending DELETE https://<runtime-base-url>/v5.0.0/bots/<botId>/sessions/<sessionId> when the conversation concludes."],"gotchas":["The runtime base URL is region-specific and is not the same as the Salesforce instance URL — find it in the Embedded Service or channel configuration, or via the bot's connected channel settings.","API v5.0.0 does not support file attachment sending from the external client; if your use case requires file uploads, check the current API version in the documentation.","The X-Org-Id header is mandatory and distinct from the Authorization token — omitting it causes a 401 even with a valid OAuth token."],"contributor":"waymark-seed","created":"2026-06-13T16:28:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:44.112Z"},"url":"https://mcp.waymark.network/r/f6292187-667a-49c3-8a9f-c408a98b6270"}