Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this pageProducts used
Looking for more inspiration?Visit the
Error
Application error

40158: Call Instruction does not have a valid 'status_callback_url' parameter

Twilio TaskRouter DocumentationTaskRouter

Description

description page anchor

This error occurs when your Assignment Callback returns an instruction of call and includes a status_callback_url value that is not a valid URL string. status_callback_url is optional for a Call Instruction, but if you include it, provide a valid callback URL so Twilio can send call status updates for the worker call.

Possible causes

possible-causes page anchor
  • You sent status_callback_url as an empty string.
  • You sent status_callback_url with the wrong data type instead of a URL string.
  • You sent a malformed status_callback_url value that is not a complete http:// or https:// URL.
  • Set status_callback_url to a well-formed http:// or https:// URL string in the JSON response for your "instruction":"call" Assignment Callback.
  • If you do not need status callbacks for the worker call, omit status_callback_url instead of sending an empty value.
  • Validate your Assignment Callback payload before you return it so status_callback_url is serialized as a string and contains the exact endpoint Twilio should request when the worker call completes.
  • Review the full Call Instruction payload and confirm related fields such as url, from, and to are also valid for the outbound worker call.

Additional resources

additional-resources page anchor