Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Salesforce · Agentforce Specialist

Employee or Service Agent, and the Agent API

Agentforce Specialist · Lesson 10 of 14 · 1:20:30

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Salesforce Agentforce Specialist exam. In this lesson: choosing between an employee agent and a service agent, the other agent types, and the Agent API (when to use it, the External Client App and token, sessions and messages, synchronous and streaming replies, and which user the agent runs as). Includes three original practice questions, with Sunmeadow Solar, a fictional solar installer, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of December 2026.

Two new requests

Two new requests reach Sunmeadow's admin. Field technicians want an agent that looks up installations and logs their notes. And the team behind Sunmeadow's own monitoring system wants to send it work, with no chat window at all.

Employee agents

An employee agent helps employees, with company knowledge, tasks, and workflows. It works in Lightning Experience, the mobile app, Slack, and chat on an Experience Cloud site for logged-in users. It runs as the logged-in user, so each employee sees only what they are allowed to see. Creating one needs the Manage AI Agents permission, users need access to it, and it consumes Flex Credits.

Service agents

A service agent serves customers and partners, outside the company. It handles common requests, and escalates the complex ones to people, through messaging, email, or voice. It runs as the agent user, which you grant the minimum it needs. The permission set to manage service agents includes Manage AI Agents, which manages every agent in the org, so grant it sparingly.

How to choose

To choose, ask one question: who is talking to the agent? Employees inside the company need an employee agent, and customers or partners need a service agent. Both are built the same way, in Agentforce Builder, but they run with different users and reach different channels.

Other agent types

Agentforce also offers agents built for a purpose. A lead nurturing agent, formerly called an S D R agent, emails prospects, and runs with its own dedicated user. Others include Sales Coach, Service Assistant, and Setup with Agentforce. The old agent called Agentforce Default is retired, so plan a move to an employee agent.

When to use Agent API

Agent API lets any system that makes REST calls talk to an agent. Use it for a custom website or app, for headless agents that process work with no chat window, for third party platforms and workflows, and for other agents. It does not support the old Agentforce Default agent. And to call an agent from a flow or Apex inside Salesforce, use the invocable action instead.

Setting it up

To use Agent API, Agentforce must be on, with at least one active agent. You create an External Client App with OAuth, for example with the client credentials flow. Its Run As user needs at least API only access. The caller gets a token, then calls your My Domain address.

Sessions and messages

A conversation is a session: you start it with an external session key, a unique ID that helps you trace it in the event logs. You then send messages with the session ID and a sequence ID, end the session when you are done, and can send feedback. Messages can be synchronous, with the whole reply at once, for simple cases. Or they can be streaming, where the text arrives in chunks as it is generated, through server sent events.

Limits and running user

A request times out after one hundred and twenty seconds, and every call consumes credits. A setting called bypass user decides who the agent runs as. When it is true, the agent runs as its agent user, and when it is false, as the user behind the token. You can also send values for the agent's variables through the API.

Recap

Let's recap. Employee agents serve employees and run as the logged-in user, while service agents serve customers and run as the agent user. Ask who is talking to the agent, and the type follows. Other agents serve a purpose, such as lead nurturing, and the old default agent is retired. Agent API connects custom apps, headless processes, other platforms, and other agents, through an External Client App. Conversations are sessions, with synchronous or streaming messages, and bypass user decides who the agent runs as.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Sales reps want an agent in Slack that drafts follow-ups from the records each rep can see. Which agent type fits?

    • A service agent
    • An employee agent
    • A lead nurturing agent
    • The Agentforce Default agent
    Show the answer

    An employee agent

    An employee agent serves employees in Slack, and runs as the logged-in user, so each rep sees only their own records. “A service agent” is wrong, because a service agent serves customers, and runs as the agent user. “A lead nurturing agent” is wrong, since a lead nurturing agent sends emails to prospects, not drafts for reps in Slack. And “The Agentforce Default agent” is wrong, because the old default agent is retired, and its users should move to an employee agent.

  2. Every night, the monitoring system must send hundreds of fault reports to the agent for triage, with no chat window. What fits?

    • An Enhanced Chat channel
    • A Slack connection
    • The email channel
    • Agent API
    Show the answer

    Agent API

    Agent API lets an external system call the agent directly, which is the headless pattern. “An Enhanced Chat channel” is wrong, because Enhanced Chat is a chat window for people on a website. “A Slack connection” is wrong, since a Slack connection serves employees in Slack, not a system that runs at night. And “The email channel” is wrong, because the email channel answers customer emails through Email-to-Case, and does not take fault reports from a system.

  3. A developer wants the app to show the agent’s reply as it is being written, rather than waiting for the full text. What should the developer use?

    • Streaming messages
    • Synchronous messages
    • A new session for each sentence
    • A longer request timeout
    Show the answer

    Streaming messages

    Streaming messages send the text in chunks as it is generated, through server sent events. “Synchronous messages” is wrong, because synchronous messages return the whole reply at once. “A new session for each sentence” is wrong, since a new session for each sentence would lose the conversation, and still not stream anything. And “A longer request timeout” is wrong, because a longer wait does not change how the reply is delivered.