Twilio

Twilio Error 20404

Twilio Error 20404 is an HTTP 404 REST failure. Twilio can't find the resource — an undefined or deleted SID, wrong path casing, or incorrect base URL.

Updated Jul 1, 2026

The short answer

Twilio Error 20404 ("Resource Not Found") is a REST API failure returned with HTTP 404 when Twilio cannot find the resource your request targets. The usual cause is a SID that doesn't exist (often an undefined/empty variable), was deleted, or a wrong path, resource casing, or product base URL. Fix it by sending the exact SID to the correct documented endpoint.

Twilio Error 20404 is a REST API error returned alongside an HTTP 404 status. Per Twilio's official error dictionary, it "occurs when you request a resource that Twilio cannot find" — the path you called does not map to anything that exists under your account.

What causes Twilio Error 20404?

The request reached Twilio fine (so this is not an auth or network failure), but the resource it points to isn't there. Common causes:

  • The SID doesn't exist or was deleted. You passed an AccountSid, ServiceSid, CallSid, MessageSid, VerificationSid, etc. that Twilio has no record of, or that previously existed and has since been removed/expired.
  • A SID is empty or undefined. The single most common real-world trigger: an unset environment variable interpolated into the path. The Twilio Node SDK will happily build a URL like /Services/undefined/Verifications, and Twilio returns 20404. (See twilio-node #709.)
  • Wrong resource name or casing. Twilio's API is case-sensitive. Calls is valid; calls or TwilioCalls are not and return 20404.
  • Malformed request path — a missing path segment, an extra slash, or a typo in the endpoint.
  • Wrong product host / base URL. Core voice/SMS resources (Calls, Messages) use https://api.twilio.com; Verify uses https://verify.twilio.com/v2; only Messaging Service management resources (Services, senders, number pools) use https://messaging.twilio.com/v1 — sending or fetching an individual Message still goes through api.twilio.com. Calling the right path on the wrong host yields 20404.

How do I fix Twilio Error 20404?

  1. Read the full error message — it usually names the bad path. Twilio echoes the URL it couldn't resolve, e.g. The requested resource /Services/undefined/Verifications was not found. The literal undefined/empty segment tells you exactly which value is missing.
  2. Confirm every SID in the path is present and non-empty. Log your variables before the call. If you use environment variables, verify they're actually loaded in the running process:
if (!process.env.TWILIO_VERIFY_SERVICE_SID) {
throw new Error("TWILIO_VERIFY_SERVICE_SID is not set");
}
const v = await client.verify.v2
.services(process.env.TWILIO_VERIFY_SERVICE_SID)
.verifications.create({ to: "+15558675310", channel: "sms" });
  1. Use the exact SID returned by the create/list response. Don't hand-type or transform SIDs. Copy the value Twilio gave you (account SIDs start with AC, Verify Services with VA, Messaging Services with MG, Calls with CA, Messages with SM/MM).
  2. Match the documented resource name and casing exactly. Capitalize resource segments as shown in the API reference (Calls, Messages, Verifications).
  3. Point at the correct product base URL. Verify uses verify.twilio.com, core voice/SMS uses api.twilio.com, and Messaging Service management calls use messaging.twilio.com — but individual Message sends and fetches always go through api.twilio.com, even when the message was sent via a Messaging Service.
  4. Don't fetch resources that no longer exist. A Verify Verification can't be fetched once it's approved or expired — validate codes with the Verification Check endpoint or start a new verification instead of re-fetching a stale SID.

If you reach Twilio through Courier, this error surfaces when the Twilio credentials or SIDs configured on the provider are stale or wrong — re-check the Account SID and any Service SIDs in your Courier Twilio integration against the live values in the Twilio Console.

FAQ

Common questions

Yes. Twilio returns error code 20404 with an HTTP 404 status. The 20404 is Twilio's specific code meaning the requested REST API resource could not be found under your account.

One API, every provider

Stop debugging raw provider errors

Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.

Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.