> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cyborg.co/llms.txt
> Use this file to discover all available pages before exploring further.

# List IDs

Returns every item ID in the index.

```go theme={null}
func (e *EncryptedIndex) ListIDs(ctx context.Context) (*ListIDsResponse, error)
```

### Returns

`*ListIDsResponse` with `Ids []string` (all IDs in the index) and `Count int32`.

### Errors

<AccordionGroup>
  <Accordion title="*AuthenticationError">
    The `apiKey` is invalid (HTTP `401`).
  </Accordion>

  <Accordion title="*ServiceError / *TransportError">
    The service returns `5xx` or can't be reached.
  </Accordion>
</AccordionGroup>

See [Errors](../errors).

### Example Usage

```go theme={null}
res, err := index.ListIDs(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Println(res.Count, slices.Contains(res.Ids, "doc1"))
// Output: 3 true

// Fetch items in batches of 100
for i := 0; i < len(res.Ids); i += 100 {
    batch, err := index.Get(ctx, res.Ids[i:min(i+100, len(res.Ids))], nil)
    if err != nil {
        log.Fatal(err)
    }
    _ = batch
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.