---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/21624#article
headline: "21624: Invalid validity period value"
url: https://www.twilio.com/docs/api/errors/21624
inLanguage: en
dateModified: 2026-06-09T11:00:42.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 21624: Invalid validity period value

Log Type: APPLICATION

Log Level: ERROR

## Description

You provided an invalid value for the `ValidityPeriod` parameter when creating a Message resource. Set `ValidityPeriod` to an integer from 1 to 36000 seconds.

### Possible causes

* `ValidityPeriod` is less than 1
* `ValidityPeriod` is greater than 36000
* `ValidityPeriod` is not an integer value
* Your application passes `ValidityPeriod` in an unsupported format, such as a string with non-numeric characters or a decimal value

### Possible solutions

* Update your request so `ValidityPeriod` is an integer between 1 and 36000
* Validate the `ValidityPeriod` value in your application before you send the API request
* Remove `ValidityPeriod` from the request if you do not need to override the default message validity behavior
* Review the code that builds your Messaging API request and confirm the `ValidityPeriod` parameter is mapped correctly

#### Additional resources

* [Programmable Messaging API reference](/docs/messaging/api)
* [Message resource](/docs/messaging/api/message-resource)
