# Ledgers & records

Distinct resources governed by consumer-defined contracts.

Canonical page: /docs/ledgers

## Create and select

Create a ledger with an optional name and an initial contract. A new default contract accepts bounded JSON. Names do not assign a workflow or record type. Select the stable ledger ID for subsequent operations.

```shell
op-sys ledgers create --name example
op-sys selection update --ledger <ledger-id>
```

- [Detailed contract and examples](/docs/raw/manuals/ledger-core.md)

## Find a ledger

Use ledgers.list to enumerate readable ledgers, or ledgers.search to match an exact name and metadata you define. Search works in the selected local store or hosted workspace. Each result identifies authority or retained replica data. It never searches private record contents or grants access.

Search accepts optional ledger_ids or collection_id, filter, limit and cursor. Omitting scope searches all readable ledgers. Continue with only next_cursor as cursor, including after an empty page. Catalogue or permission changes require restarting an incomplete search. To retrieve records after choosing ledgers, use records.list for one ledger or records.search across the selected local store or hosted workspace.

```shell
op-sys --output json ledgers search --filter '{"name":"example"}' --limit 25
```

- [Search ledgers](/docs/reference/op_sys_ledgers_search)
- [Collections and record retrieval](/docs/collections)

## Accepted history

The authority validates each contribution under the admitted contract and current permissions. Accepted records have stable IDs and acceptance facts. Pending contributions remain separate from accepted history. Inspect ledgers and contracts before writing.

- [Detailed contract and examples](/docs/raw/manuals/ledger-contributions.md)

## Related guides

- [How ledgers work](/docs/raw/ledger-core.md)
