Skip to content
masterclass Buddy

Upstash · Method

redis.expire

Sets a timeout on a Redis key in seconds. Redis deletes the key after the timeout, and the method returns 1 when the timeout is set or 0 otherwise.

Last updated

Syntax

await redis.expire(key, seconds)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • EXPIREAT
  • PEXPIRE
  • TTL
  • PERSIST

Source: EXPIRE - Upstash Documentation. Checked 2026-11-03.