Skip to content

List namespaces

GET /v4/namespace/{type}

List all namespaces of specified type. The path parameter type specifies the namespace type (storage or stream).

Response schema

FieldTypeDescription
dataarray<Namespace>Array of namespace information.
durationstringTime taken to process the request, returned in a human-readable format (e.g., "1.234567ms").

Namespace object

FieldTypeDescription
namestringThe name of the namespace.
workspacestringThe workspace this namespace belongs to.
created_atstring (date-time)When this namespace was created.
updated_atstring (date-time)When this namespace was last updated.
txinteger<int64>Latest transaction ID in this namespace.
statobject<string,integer>Statistics about the namespace (key counts, size, etc.).

Example

sh
curl --location 'https://api.litebase.io/v4/namespace/storage' \
--header "Authorization: Bearer $LITEBASE_API_KEY"

Response:

json
HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": [
        {
            "name": "sample",
            "workspace": "default",
            "created_at": "2024-03-20T10:30:00Z",
            "updated_at": "2024-03-20T10:35:00Z",
            "tx": 2,
            "stat": {
                "key_count": 2,
                "size_bytes": 1024
            }
        }
    ],
    "duration": "1.234567ms"
}