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

# Records

> Records are the fundamental unit of an S2 stream: ordered entries with a sequence number, timestamp, and optional headers and body made of arbitrary bytes.

S2 streams allow you to [`append`](/concepts/appends) records at the tail, and [`read`](/concepts/reads) starting from any position in the stream.

<div style={{fontFamily: 'monospace', fontSize: '14px', background: 'var(--tw-prose-pre-bg, #1e1e1e)', color: '#d4d4d4', borderRadius: '8px', padding: '20px', lineHeight: '1.8'}}>
  <span style={{color: '#8B5CF6'}}>seq\_num:</span> 42<br />
  <span style={{color: '#f59e0b'}}>timestamp:</span> 1713812735000<br />

  <hr style={{border: 'none', borderTop: '1px solid #444', margin: '8px 0'}} />

  <span style={{color: '#22d3ee'}}>headers:</span><br />
    role: agent<br />
    response-type: tool-call<br />
    format: json<br />

  <hr style={{border: 'none', borderTop: '1px solid #444', margin: '8px 0'}} />

  <span style={{color: '#4ade80'}}>body:</span><br />
    {`{"event": "click", "x": 42}`}
</div>

## Anatomy of a record

<ResponseField name="Sequence number">
  Strictly increasing position within the stream.

  Always assigned by S2.
</ResponseField>

<ResponseField name="Timestamp">
  Arrival timestamp in milliseconds, when assigned by S2 (default).

  It can also be [client-specified](/concepts/configs).
</ResponseField>

<ResponseField name="Headers">
  Name-value pairs, similar to HTTP headers.

  Both the name and value can be arbitrary bytes.
</ResponseField>

<ResponseField name="Body">
  The core payload of a record.

  Arbitrary bytes.
</ResponseField>

## Size

A single record can be up to 1 MiB in [metered bytes](/platform/limits#records).

## See also

<CardGroup cols={3}>
  <Card title="Appends" icon="pen" href="/concepts/appends">
    Understand append acknowledgements, batching, and durability.
  </Card>

  <Card title="Reads" icon="list-timeline" href="/concepts/reads">
    Scan from sequence numbers, timestamps, and tail offsets.
  </Card>

  <Card title="Data plane API" icon="globe" href="/api/protocol#data-plane">
    Compare the append, read, and check-tail endpoints.
  </Card>
</CardGroup>
