---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/40158#article
headline: "40158: Call Instruction does not have a valid 'status_callback_url' parameter"
url: https://www.twilio.com/docs/api/errors/40158
inLanguage: en
dateModified: 2026-06-08T11:29:20.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 40158: Call Instruction does not have a valid 'status\_callback\_url' parameter

Log Type: APPLICATION

Log Level: ERROR

## Description

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

* 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.

### Possible solutions

* 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

* [Handling Assignment Callbacks](/docs/taskrouter/handle-assignment-callbacks)
* [How TaskRouter Works](/docs/taskrouter/how-taskrouter-works)
* [TaskRouter REST API Reference](/docs/taskrouter/api)
