## List a Namespace's Keys **get** `/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys` Lists a namespace's keys. ### Path Parameters - `account_id: string` Identifier. - `namespace_id: string` Namespace identifier tag. ### Query Parameters - `cursor: optional string` Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. A valid value for the cursor can be obtained from the `cursors` object in the `result_info` structure. - `limit: optional number` Limits the number of keys returned in the response. The cursor attribute may be used to iterate over the next batch of keys if there are more than the limit. - `prefix: optional string` Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `success: true` Whether the API call was successful. - `true` - `result: optional array of Key` - `name: string` A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL. - `expiration: optional number` The time, measured in number of seconds since the UNIX epoch, at which the key will expire. This property is omitted for keys that will not expire. - `metadata: optional unknown` Arbitrary JSON that is associated with a key. - `result_info: optional object { count, cursor }` - `count: optional number` Total results returned based on your list parameters. - `cursor: optional string` Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. A valid value for the cursor can be obtained from the cursors object in the result_info structure. ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/storage/kv/namespaces/$NAMESPACE_ID/keys \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "name": "My-Key", "expiration": 1577836800, "metadata": {} } ], "result_info": { "count": 1, "cursor": "6Ck1la0VxJ0djhidm1MdX2FyDGxLKVeeHZZmORS_8XeSuhz9SjIJRaSa2lnsF01tQOHrfTGAP3R5X1Kv5iVUuMbNKhWNAXHOl6ePB0TUL8nw" } } ```