From Bright Pattern Documentation
Jump to: navigation, search
• 5.19


Sets the state of the agent to a specified value.

Note:Value in the notReadyReason is required for the NotReady state. For other states it is not needed..



setAgentState(state: AgentState, notReadyReason?: string): Promise<OperationResult<null>>


"not_ready" |


Parameters Parameter Values Data Type Optional/Required Description

"ready" "not_ready"

String Required Allows you to set the state of the agent
notReadyReason String Optional Allows you to provide a reason why the agent is not in the Ready state now. Used only for "not_ready" state. Note that entered values must match those defined in the Contact Center Administrator application. You can obtain them programmatically by the API method getAgentNotReadyReasons.

Example Request

   setAgentStateButton.onclick = () => {

       const state = agentStateInput.value

       const notReadyReason = notReadyReasonInput.value

       adApi.setAgentState(state as any, notReadyReason)


Return Value

< Previous | Next >