/v1/databases/{uid}/data/keyReturns one key of a Redis (Valkey) database with its type, TTL, size and value. Only available for Redis databases.
string:valueholds the first 64 KiB;truncatedistruewhen the value is longer.lengthis the size in bytes.hash,set,list,zset,stream:itemsholds one page of about 200 entries andlengthis the element count. When there is more, passnextback as thenextquery parameter.nextis an empty string on the last page. Columns arefield,value(hash),member(set),index,value(list),member,score(zset) andid,fields(stream, with fields as a JSON object).- Values that are not valid UTF-8 are shown with
\xescapes. Each cell is cut at 8 KiB.
The database must be ready. Requires the secrets read permission (owner, admin or
developer role).
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe database's uid.
Query parameters
keystringKey name. Required unless key_b64 is sent.
key_b64stringKey name as standard base64, for binary key names (see raw_b64 in List keys). Overrides key.
dbintegerRedis logical database, 0 to 15. Defaults to 0. Non-numeric values are treated as 0.
Default 0min 0 · max 15
nextstringThe next value from the previous page of this key's value.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The key and one page of its value.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
keystringRequiredKey name. Names that are not valid UTF-8 are shown with \x escapes.
raw_b64stringExact key name as standard base64. Only present when the name is not valid UTF-8.
typestringRequiredRedis type, such as string, hash, list, set, zset or stream.
ttl_msintegerRequiredTime to live in milliseconds. -1 when the key has no expiry.
lengthintegerRequiredString length in bytes, or the number of elements in a collection.
valuestringThe string value (first 64 KiB). Only present for string keys.
truncatedbooleanRequiredtrue when a string value is longer than the 64 KiB returned.
itemsobjectOne page of a collection's elements. Only present for hash, set, list, zset and stream keys.
Show attributesHide attributes
columnsarray of objectsRequiredResult columns, in order.
Show item attributesHide item attributes
namestringRequiredColumn name.
typestringRequiredType name reported by the engine (for example int4 in PostgreSQL or varchar in MySQL). Empty string for Redis and for unknown types.
rowsarray of array of string | nullssRequiredResult rows. Each row is an array of cells in column order. Every value is a string; null is SQL NULL.
row_countintegerRequiredNumber of rows in rows.
truncatedbooleanRequiredtrue when more rows exist than were returned, because of the row cap, the page size or the response size cap.
commandstringPostgreSQL's command tag (for example SELECT 2 or EXPLAIN). For MySQL, SELECT <n>
when the statement returned columns. For Redis SCAN-family commands,
next cursor <n>. Omitted when the result was truncated and otherwise when there is
none.
duration_msintegerRequiredTime taken to run the statement and read the result, in milliseconds.
nextstringRequiredValue to pass as next for the following page. Empty string when there are no more pages.
Errors
| Status | Meaning |
|---|---|
400 | The request failed. Possible messages: key is required, invalid key_b64, invalid page, key browsing is only available for Valkey databases, db must be between 0 and 15, or an error from the server. |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | The database does not exist, or the key does not exist (key not found, it may have expired). |
409 | The data browser cannot run right now. Possible messages: the database must be ready to browse its data, the data viewer is busy, try again in a moment, and couldn't reach the database, check that it's running and try again. |
Errors use the standard error format.