**Source URL:** https://limited.veevavault.dev/medical/omnichannel/api-reference/26.1/methods/onagentstatuschange

# onAgentStatusChange()

Notifies Vault when an agent's status has changed and sets the `AgentStatus`.

## Parameters

<FieldTable>
| Name | Type | Description |
| --- | --- | --- |
| `agentStatus`<Requiredness type="required" /> | `AgentStatus` | The user's telephony status. Allowed values are `AgentStatus.AVAILABLE` and `AgentStatus.OFFLINE`. If not provided, the default is `AgentStatus.OFFLINE`. |
</FieldTable>

## Example

<CodeExample title="">
```javascript
import { omniconnectEvent, AgentStatus} from "./vault-medical-omniconnect-25.1.2-release12649.js";

// Agent status set to OFFLINE
function userStatusChangeToOffline() {
    omniconnectEvent.onAgentStatusChange()
}

// Agent status set to AVAILABLE
function userStatusChangeToAvailable() {
    omniconnectEvent.onLogin(AgentStatus.AVAILABLE)
}
```
</CodeExample>

---

**Previous:** [onLogout()](/medical/omnichannel/api-reference/26.1/methods/onlogout)  
