---
# @generated by sylphx-gen 0.1.0 from contracts@e145cc7cf1bc9605f2b27439e5e17ed76a1a2fd7e7021906a013f7565e4a0cd5. Do not edit.
title: "List pop in KV"
description: "`data.kv.list_pop` (POST /v1/kv-list-pops): Pops values from the head of a list (LPOP); an emptied list is removed."
type: reference
product: kv
summary: "Pops values from the head of a list (LPOP); an emptied list is removed."
updated: 2026-09-28
nav: false
---

Pops values from the head of a list (LPOP); an emptied list is removed.

- **Path** `POST https://api.data.sylphx.com/v1/kv-list-pops`
- **Scope** `data:write`
- **Effect** `write` — a successful call changes state.
- **Collection** [kv](/docs/api/kv)
- **Host** `https://api.data.sylphx.com`

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `namespace_id` | `string` | The namespace's id. Required. |
| `key` | `string` | The list's key. Required. |
| `count` | `uint64` | How many values to pop; unset pops one, zero pops none. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `values` | `bytes[]` | The popped values, each base64, head first. |
| `length` | `uint64` | The list's length after the pop. |
| `version` | `uint64` | The list's version after the pop. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.data.sylphx.com/v1/kv-list-pops" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key":"…","namespace_id":"…"}'
```

**TypeScript**

```ts
const response = await sylphx.data.kv.listPop({ key: '…', namespaceId: '…' })
```

**Rust**

```rust
let mut req = sylphx::data::ListPopValueRequest::default();
req.key = "…".to_string();
req.namespace_id = "…".to_string();
let response = sx.data().kv().list_pop(req).await?;
```

**MCP**

```json
{ "method_id": "data.kv.list_pop", "args": {"key":"…","namespace_id":"…"} }
```
