Menu

Expand
Rate this page:

Worker Reservation Resource

Worker Reservations represent the current and past reservations for a Worker. Current Reservations can be accepted using the Reservation instance resource.

WorkerReservation properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that created the WorkerReservation resource.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

reservation_status
enum:status Not PII

The current status of the reservation. Can be: pending, accepted, rejected, timeout, canceled, or rescinded.

sid
sid<WR> Not PII

The unique string that we created to identify the WorkerReservation resource.

task_sid
sid<WT> Not PII

The SID of the reserved Task resource.

worker_name
string Not PII

The friendly_name of the Worker that is reserved.

worker_sid
sid<WK> Not PII

The SID of the reserved Worker resource.

workspace_sid
sid<WS> Not PII

The SID of the Workspace that this worker is contained within.

url
url Not PII

The absolute URL of the WorkerReservation resource.

links
uri_map Not PII

The URLs of related resources.

Fetch a WorkerReservation resource

get
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations/{Sid}
Parameters
Parameters in REST API format
workspace_sid
Path
get sid<WS> Not PII

The SID of the Workspace with the WorkerReservation resource to fetch.

worker_sid
Path
get sid<WK> Not PII

The SID of the reserved Worker resource with the WorkerReservation resource to fetch.

sid
Path
get sid<WR> Not PII

The SID of the WorkerReservation resource to fetch.

Example 1
Loading Code Sample...
        
        

        Fetch Reservation

        Read multiple WorkerReservation resources

        get
        https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations
        Parameters
        Parameters in REST API format
        workspace_sid
        Path
        get sid<WS> Not PII

        The SID of the Workspace with the WorkerReservation resources to read.

        worker_sid
        Path
        get sid<WK> Not PII

        The SID of the reserved Worker resource with the WorkerReservation resources to read.

        reservation_status
        Optional
        get enum:status Not PII

        Returns the list of reservations for a worker with a specified ReservationStatus. Can be: pending, accepted, rejected, timeout, canceled, or rescinded.

        Example 1
        Loading Code Sample...
              
              

              Read Reservation

              Update a WorkerReservation resource

              post
              https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Reservations/{Sid}

              To indicate that a Worker has accepted or rejected a Reservation, you make an HTTP POST request to a Reservation instance resource URI.

              You can issue a simple Accept or Reject request. You can also issue an Instruction, like Dequeueing or Calling, similar to Responding to an Assignment Callback.

              Tasks are automatically canceled after 10 rejections.

              See Manually accepting or rejecting a reservation for more information.

              Parameters
              Parameters in REST API format
              workspace_sid
              Path
              post sid<WS> Not PII

              The SID of the Workspace with the WorkerReservation resources to update.

              worker_sid
              Path
              post sid<WK> Not PII

              The SID of the reserved Worker resource with the WorkerReservation resources to update.

              sid
              Path
              post sid<WR> Not PII

              The SID of the WorkerReservation resource to update.

              reservation_status
              Optional
              post enum:status Not PII

              The new status of the reservation. Can be: pending, accepted, rejected, timeout, canceled, or rescinded.

              worker_activity_sid
              Optional
              post sid<WA> Not PII

              The new worker activity SID if rejecting a reservation.

              instruction
              Optional
              post string Not PII

              The assignment instruction for the reservation.

              dequeue_post_work_activity_sid
              Optional
              post sid<WA> Not PII

              The SID of the Activity resource to start after executing a Dequeue instruction.

              dequeue_from
              Optional
              post string Not PII

              The caller ID of the call to the worker when executing a Dequeue instruction.

              dequeue_record
              Optional
              post string Not PII

              Whether to record both legs of a call when executing a Dequeue instruction or which leg to record.

              dequeue_timeout
              Optional
              post integer Not PII

              The timeout for call when executing a Dequeue instruction.

              dequeue_to
              Optional
              post string Not PII

              The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the E.164 formatted phone number, depending on the destination.

              dequeue_status_callback_url
              Optional
              post url Not PII

              The callback URL for completed call event when executing a Dequeue instruction.

              call_from
              Optional
              post string Not PII

              The Caller ID of the outbound call when executing a Call instruction.

              call_record
              Optional
              post string Not PII

              Whether to record both legs of a call when executing a Call instruction.

              call_timeout
              Optional
              post integer Not PII

              The timeout for a call when executing a Call instruction.

              call_to
              Optional
              post string Not PII

              The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the E.164 formatted phone number, depending on the destination.

              call_url
              Optional
              post url Not PII

              TwiML URI executed on answering the worker's leg as a result of the Call instruction.

              call_status_callback_url
              Optional
              post url Not PII

              The URL to call for the completed call event when executing a Call instruction.

              call_accept
              Optional
              post boolean Not PII

              Whether to accept a reservation when executing a Call instruction.

              redirect_call_sid
              Optional
              post sid<CA> Not PII

              The Call SID of the call parked in the queue when executing a Redirect instruction.

              redirect_accept
              Optional
              post boolean Not PII

              Whether the reservation should be accepted when executing a Redirect instruction.

              redirect_url
              Optional
              post url Not PII

              TwiML URI to redirect the call to when executing the Redirect instruction.

              to
              Optional
              post string Not PII

              The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the E.164 formatted phone number, depending on the destination.

              from
              Optional
              post string Not PII

              The caller ID of the call to the worker when executing a Conference instruction.

              status_callback
              Optional
              post url Not PII

              The URL we should call using the status_callback_method to send status information to your application.

              status_callback_method
              Optional
              post http_method Not PII

              The HTTP method we should use to call status_callback. Can be: POST or GET and the default is POST.

              status_callback_event
              Optional
              post enum:call_status[] Not PII

              The call progress events that we will send to status_callback. Can be: initiated, ringing, answered, or completed.

              timeout
              Optional
              post integer Not PII

              The timeout for a call when executing a Conference instruction.

              record
              Optional
              post boolean Not PII

              Whether to record the participant and their conferences, including the time between conferences. Can be true or false and the default is false.

              muted
              Optional
              post boolean Not PII

              Whether the agent is muted in the conference. Defaults to false.

              beep
              Optional
              post string Not PII

              Whether to play a notification beep when the participant joins or when to play a beep. Can be: true, false, onEnter, or onExit. The default value is true.

              start_conference_on_enter
              Optional
              post boolean Not PII

              Whether to start the conference when the participant joins, if it has not already started. Can be: true or false and the default is true. If false and the conference has not started, the participant is muted and hears background music until another participant starts the conference.

              end_conference_on_exit
              Optional
              post boolean Not PII

              Whether to end the conference when the agent leaves.

              wait_url
              Optional
              post url Not PII

              The URL we should call using the wait_method for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. Learn more about hold music.

              wait_method
              Optional
              post http_method Not PII

              The HTTP method we should use to call wait_url. Can be GET or POST and the default is POST. When using a static audio file, this should be GET so that we can cache the file.

              early_media
              Optional
              post boolean Not PII

              Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is true.

              max_participants
              Optional
              post integer Not PII

              The maximum number of participants allowed in the conference. Can be a positive integer from 2 to 250. The default value is 250.

              conference_status_callback
              Optional
              post url Not PII

              The URL we should call using the conference_status_callback_method when the conference events in conference_status_callback_event occur. Only the value set by the first participant to join the conference is used. Subsequent conference_status_callback values are ignored.

              conference_status_callback_method
              Optional
              post http_method Not PII

              The HTTP method we should use to call conference_status_callback. Can be: GET or POST and defaults to POST.

              conference_status_callback_event
              Optional
              post enum:conference_event[] Not PII

              The conference status events that we will send to conference_status_callback. Can be: start, end, join, leave, mute, hold, speaker.

              conference_record
              Optional
              post string Not PII

              Whether to record the conference the participant is joining or when to record the conference. Can be: true, false, record-from-start, and do-not-record. The default value is false.

              conference_trim
              Optional
              post string Not PII

              Whether to trim leading and trailing silence from your recorded conference audio files. Can be: trim-silence or do-not-trim and defaults to trim-silence.

              recording_channels
              Optional
              post string Not PII

              The recording channels for the final recording. Can be: mono or dual and the default is mono.

              recording_status_callback
              Optional
              post url Not PII

              The URL that we should call using the recording_status_callback_method when the recording status changes.

              recording_status_callback_method
              Optional
              post http_method Not PII

              The HTTP method we should use when we call recording_status_callback. Can be: GET or POST and defaults to POST.

              conference_recording_status_callback
              Optional
              post url Not PII

              The URL we should call using the conference_recording_status_callback_method when the conference recording is available.

              conference_recording_status_callback_method
              Optional
              post http_method Not PII

              The HTTP method we should use to call conference_recording_status_callback. Can be: GET or POST and defaults to POST.

              region
              Optional
              post string Not PII

              The region where we should mix the recorded audio. Can be:us1, ie1, de1, sg1, br1, au1, or jp1.

              sip_auth_username
              Optional
              post string Not PII

              The SIP username used for authentication.

              sip_auth_password
              Optional
              post string Not PII

              The SIP password for authentication.

              dequeue_status_callback_event
              Optional
              post string[] Not PII

              The call progress events sent via webhooks as a result of a Dequeue instruction.

              post_work_activity_sid
              Optional
              post sid<WA> Not PII

              The new worker activity SID after executing a Conference instruction.

              end_conference_on_customer_exit
              Optional
              post boolean Not PII

              Whether to end the conference when the customer leaves.

              beep_on_customer_entrance
              Optional
              post boolean Not PII

              Whether to play a notification beep when the customer joins.

              if_match
              Header
              post string Not PII

              The If-Match HTTP request header

              Example 1
              Loading Code Sample...
                    
                    

                    Accept a Reservation

                    Example 2
                    Loading Code Sample...
                          
                          

                          Reject a Reservation

                          Example 3
                          Loading Code Sample...
                                
                                

                                Dequeue a Reservation

                                Example 4
                                Loading Code Sample...
                                      
                                      

                                      Call a Reservation

                                      Rate this page:

                                      Need some help?

                                      We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                      Loading Code Sample...
                                            
                                            
                                            

                                            Thank you for your feedback!

                                            Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                            Sending your feedback...
                                            🎉 Thank you for your feedback!
                                            Something went wrong. Please try again.

                                            Thanks for your feedback!

                                            thanks-feedback-gif