setAgentState is
the one CSTA verb that moves an agent through the work states that a contact
center runs on: logged on, ready, not-ready (with a reason),
after-call-work, and logged off. The distributor offers queued calls
only to agents who are ready. This verb therefore gates delivery. Drive it
from your own agent desktop, a workforce-management integration, or a
supervisor tool over the engine-native CSTA control leg. That is the same
connection that your app already uses for
call control and
routing.
This is the ECMA CSTA (ECMA-269) Set Agent State operation, exposed as the
wire verb setAgentState. It needs the agent_state scope on your CTI
token. The engine refuses the verb for a token without that scope. See
CTI Overview for how to connect and mint a
scoped token.
The agent workstation model
An agent is a routable identity (a skill member) that the ACD can offer calls to. A workstation is the endpoint that the agent answers on: a browser softphone or a real SIP deskphone.login associates the two. It puts
the agent on shift at a workstation and makes them eligible for the skills
that they belong to. Everything after that is a work-state change on that
logged-on agent.
The distributor keeps a live view of every agent’s state. It picks only from
the ready pool. When you move an agent out of ready, the distributor
removes them from selection immediately. When you move them back in, they
become a candidate on the next pass. That is the whole contract between this
verb and the built-in ACD.
login makes the agent eligible. It does not by itself start call
delivery. Set ready explicitly when the agent is actually at the keyboard.
This mirrors real ACD ergonomics: “logged on” and “available” are distinct.
An agent can log in, read handover notes, and only then go ready.setAgentState
string
required
The agent identity to move. This is the ACD agent id (a skill member), not
the workstation or SIP AOR. The engine tenant-checks it against your token’s
workspace.
enum
required
One of
login, logout, ready, not-ready, after-call-work.string
A reason code for
not-ready (e.g. lunch, break, training,
meeting). Free-form and reporting-only. It does not change routing. It
labels why the agent is unavailable, so supervisors and wallboards can
break down idle time. The engine ignores it for the other states.cti event track. Subscribe to it if you build a supervisor
view (see Routing & Events).
Move an agent through a shift
The control leg speaks length-prefixed, tab-separated<verb>\t<args-json>
lines. The first line authenticates with your scoped CTI token. You can send
those frames directly, or use the CTI client from your SDK, which wraps them.
1
Log the agent on at their workstation
Bind the agent to the endpoint that they will answer on. After this, they
belong to their skills, but the distributor does not yet offer them calls.
2
Go ready
Put the agent into the delivery pool. The distributor can now offer them
the next queued call for one of their skills.
3
Step away with a reason
On a break, set
not-ready with an auxReason. The distributor stops
call offers. The reason code drives idle-time reporting.4
Wrap up after a call
When a call clears, set
after-call-work. The agent can then disposition
the call, and no new call lands mid-wrap-up. Return to ready when done.5
Log off at end of shift
logout removes the agent from every skill and frees the workstation.How state drives delivery
When a call queues to a skill, the distributor picks from that skill’s ready members. It uses the skill’s algorithm: expected-agent-delay / most-idle-agent, round-robin, and the other Avaya-style options described in PBX & ACD. An agent innot-ready, after-call-work, or logout is never a candidate. The
distributor does not offer a second call to an agent who is already on one.
If a picked agent does not accept in time, the offer re-queues (RONA), and
the picker moves on. Honest state is what keeps queues flowing.
The platform does not force agents into
after-call-work for you. Your
desktop sets it explicitly after a call clears. If you want automatic
wrap-up, set after-call-work from your cleared event handler on the
CSTA event track. Then transition
back to ready when the agent finishes.Two surfaces, one model. This verb is the engine twin of the state control
built into the contact-center console at
agent.clutchcall.dev. The console
drives its own agents through exactly these states. Use the CSTA verb when an
external app (your CRM desktop, a WFM tool, an ISV integration) owns the
agent’s presence instead. The console and the verb API move the same agents
through the same distributor. See
Contact-center platforms.Honest status
setAgentStateover the CSTA control leg — shipped, withagent_statescope enforcement. It is verified to move agents across nodes in a multi-node deployment.login/ready/not-ready/after-call-work/logout— all drive the distributor’s ready pool as described.auxReason— accepted and carried into reporting. It is a label, not a routing input. A reason code never changes which agent is picked.- Automatic ACW entry on call clear — not automatic. Set it from your
clearedhandler if you want it (see the note above).
Related
CTI Overview
Connect the control leg, mint a scoped CTI token, and read the framing.
Routing & Events
Register as a route point and subscribe to the CSTA event track.
Call Control
Make, hold, transfer, consult, DTMF, and clear the calls that agents
handle.
PBX & ACD
Learn about skills, queues, and how the distributor picks from the ready
pool.
Contact-center platforms
Build a full agent desktop on top of the CSTA verbs.
High availability
Keep agent state and routing alive across node failures.

