Skip to content
masterclass Buddy

Upstash · Method

redis.setex

SETEX stores a value and gives its key a lifetime in seconds. The write and expiration happen atomically.

Last updated

Syntax

SETEX <key> <seconds> <value>

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

Subscribe
  • SET
  • PSETEX
  • SETNX
  • GETEX
  • MSETEX

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