---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/21652#article
headline: "21652: Maximum subject length is 40 characters"
url: https://www.twilio.com/docs/api/errors/21652
inLanguage: en
dateModified: 2026-03-25T13:47:45.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 21652: Maximum subject length is 40 characters

Log Level: ERROR

## Description

Use a subject that is 40 characters or fewer. Twilio returns this error when the subject text in your message exceeds that limit.

### Possible causes

* The subject line you sent is longer than 40 characters.
* Dynamic text pushed the final subject over the limit after your application built the message request.

### Possible solutions

* Shorten the subject to 40 characters or fewer before you send the message.
* Review the final rendered subject in your application and trim or abbreviate any text that makes it exceed the limit.

#### Additional resources

* [Messages resource](/docs/messaging/api/message-resource)
