Skip to main content
POST
/
v1
/
vectors
/
list_ids
List IDs
curl --request POST \
  --url https://api.example.com/v1/vectors/list_ids
List all item IDs currently stored in the encrypted index.

Authentication

Required - API key via X-API-Key header:
X-API-Key: cyborg_your_api_key_here
You can get an API key from the CyborgDB Admin Dashboard. For more info, follow this guide.

Request Body

{
  "index_name": "my_index",
  "index_key": "64_character_hex_string_representing_32_bytes"
}

Response

{
  "ids": [
    "item_1",
    "item_2",
    "item_3",
    "item_4",
    "item_5"
  ],
  "count": 5
}

Exceptions

  • 401: Authentication failed (invalid API key) or wrong index_key on SDK-supplied indexes — see error model
  • 404: Index not found
  • 422: Invalid request parameters
  • 500: Internal server error

Example Usage

Basic List IDs:
curl -X POST "http://localhost:8000/v1/vectors/list_ids" \
     -H "X-API-Key: cyborg_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "my_index",
       "index_key": "your_64_character_hex_key_here"
     }'
With jq processing:
# Get total count
count=$(curl -s -X POST "http://localhost:8000/v1/vectors/list_ids" \
     -H "X-API-Key: cyborg_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "my_index",
       "index_key": "your_64_character_hex_key_here"
     }' | jq '.count')

echo "Index contains $count items"

# List all IDs
curl -s -X POST "http://localhost:8000/v1/vectors/list_ids" \
     -H "X-API-Key: cyborg_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "my_index",
       "index_key": "your_64_character_hex_key_here"
     }' | jq -r '.ids[]'
Check if specific ID exists:
# Check if item exists
id_to_check="item_123"
exists=$(curl -s -X POST "http://localhost:8000/v1/vectors/list_ids" \
     -H "X-API-Key: cyborg_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "my_index",
       "index_key": "your_64_character_hex_key_here"
     }' | jq --arg id "$id_to_check" '.ids | contains([$id])')

if [ "$exists" = "true" ]; then
    echo "Item $id_to_check exists in the index"
else
    echo "Item $id_to_check not found"
fi
This endpoint is useful for auditing index contents, verifying data integrity, and implementing custom batch processing workflows.
For large indexes with many items, consider implementing pagination on the client side by processing the returned IDs in batches.