Use Upstash Redis through its REST API to manage keys, hashes, lists, counters, and expiry. The Command action accepts a Redis command for operations beyond the dedicated actions.
Connect to Upstash Redis to perform key-value, hash, list, and utility operations via the REST API.
Get the value of a key from Upstash Redis.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to retrieve
Parameter Type Description keystring The key that was retrieved valuejson The value of the key (string), or null if not found
Set the value of a key in Upstash Redis with an optional expiration time in seconds.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to set valuestring Yes The value to store exnumber No Expiration time in seconds (optional)
Parameter Type Description keystring The key that was set resultstring The result of the SET operation (typically "OK")
Delete a key from Upstash Redis.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to delete
Parameter Type Description keystring The key that was deleted deletedCountnumber Number of keys deleted (0 if key did not exist, 1 if deleted)
List keys matching a pattern in Upstash Redis. Defaults to listing all keys (*).
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token patternstring No Pattern to match keys (e.g., "user:"). Defaults to " " for all keys.
Parameter Type Description patternstring The pattern used to match keys keysarray List of keys matching the pattern countnumber Number of keys found
Execute an arbitrary Redis command against Upstash Redis. Pass the full command as a JSON array (e.g., ["HSET", "myhash", "field1", "value1"]).
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token commandstring Yes Redis command as a JSON array (e.g., ["HSET", "myhash", "field1", "value1"]) or a simple command string (e.g., "PING")
Parameter Type Description commandstring The command that was executed resultjson The result of the Redis command
Set a field in a hash stored at a key in Upstash Redis.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The hash key fieldstring Yes The field name within the hash valuestring Yes The value to store in the hash field
Parameter Type Description keystring The hash key fieldstring The field that was set resultnumber Number of new fields added (0 if field was updated, 1 if new)
Get the value of a field in a hash stored at a key in Upstash Redis.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The hash key fieldstring Yes The field name to retrieve
Parameter Type Description keystring The hash key fieldstring The field that was retrieved valuejson The value of the hash field (string), or null if not found
Get all fields and values of a hash stored at a key in Upstash Redis.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The hash key
Parameter Type Description keystring The hash key fieldsobject All field-value pairs in the hash, keyed by field name fieldCountnumber Number of fields in the hash
Atomically increment the integer value of a key by one in Upstash Redis. If the key does not exist, it is set to 0 before incrementing.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to increment
Parameter Type Description keystring The key that was incremented valuenumber The new value after incrementing
Set a timeout on a key in Upstash Redis. After the timeout, the key is deleted.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to set expiration on secondsnumber Yes Timeout in seconds
Parameter Type Description keystring The key that expiration was set on resultnumber 1 if the timeout was set, 0 if the key does not exist
Get the remaining time to live of a key in Upstash Redis. Returns -1 if the key has no expiration, -2 if the key does not exist.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to check TTL for
Parameter Type Description keystring The key checked ttlnumber Remaining TTL in seconds. Positive integer if the key has a TTL set, -1 if the key exists with no expiration, -2 if the key does not exist.
Prepend a value to the beginning of a list in Upstash Redis. Creates the list if it does not exist.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The list key valuestring Yes The value to prepend to the list
Parameter Type Description keystring The list key lengthnumber The length of the list after the push
Get a range of elements from a list in Upstash Redis. Use 0 and -1 for start and stop to get all elements.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The list key startnumber Yes Start index (0-based, negative values count from end) stopnumber Yes Stop index (inclusive, -1 for last element)
Parameter Type Description keystring The list key valuesarray List of elements in the specified range countnumber Number of elements returned
Check if a key exists in Upstash Redis. Returns true if the key exists, false otherwise.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to check
Parameter Type Description keystring The key that was checked existsboolean Whether the key exists (true) or not (false)
Set the value of a key only if it does not already exist. Returns true if the key was set, false if it already existed.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to set valuestring Yes The value to store if the key does not exist
Parameter Type Description keystring The key that was attempted to set wasSetboolean Whether the key was set (true) or already existed (false)
Increment the integer value of a key by a given amount. Use a negative value to decrement. If the key does not exist, it is set to 0 before the operation.
Inputs and outputsParameter Type Required Description restUrlstring Yes Upstash Redis REST URL restTokenstring Yes Upstash Redis REST Token keystring Yes The key to increment incrementnumber Yes Amount to increment by (use negative value to decrement)
Parameter Type Description keystring The key that was incremented valuenumber The new value after incrementing