The April 2022 Connect release has added an API call to do this finally!
There is now a PutUserStatus operation that will update a given agents status.
The call to the operation in javascript is:
const AWS = require('aws-sdk');
const connect = new AWS.Connect();
let params = {
AgentStatusId: 'STRING_VALUE', /* required */
InstanceId: 'STRING_VALUE', /* required */
UserId: 'STRING_VALUE' /* required */
};
connect.putUserStatus(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
where:
UserId is the guid identifier of the user.
InstanceId is the guid identifier of the Amazon Connect instance.
AgentStatusId — the guid identifier of the agent status. This can be retrieved via the listAgentStatuses operation.
More info here:
https://docs.aws.amazon.com/connect/latest/APIReference/API_PutUserStatus.html