Sets attributes for a worker.
The unique identifier (SID) of the worker to set attributes for.
An object containing the attributes to set for the worker.
Optional configuration parameters for customizing the attribute setting process.
A promise that resolves when the attributes are successfully set for the worker.
FlexSdkError with the following error code(s):
import { createClient } from "@twilio/flex-sdk";import { SetWorkerAttributes } from "@twilio/flex-sdk/actions/Supervisor";async function setWorkerAttributes() { const client = await createClient("SDK_TOKEN"); const setWorkerAttributesAction = new SetWorkerAttributes( "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", { key: "value" } ); await client.execute(setWorkerAttributesAction);} Copy
import { createClient } from "@twilio/flex-sdk";import { SetWorkerAttributes } from "@twilio/flex-sdk/actions/Supervisor";async function setWorkerAttributes() { const client = await createClient("SDK_TOKEN"); const setWorkerAttributesAction = new SetWorkerAttributes( "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", { key: "value" } ); await client.execute(setWorkerAttributesAction);}
Optional
Sets attributes for a worker.
Param: targetWorkerSid
The unique identifier (SID) of the worker to set attributes for.
Param: attributes
An object containing the attributes to set for the worker.
Param: options
Optional configuration parameters for customizing the attribute setting process.
Returns
A promise that resolves when the attributes are successfully set for the worker.
Throws
FlexSdkError with the following error code(s):
Example