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

# Append records

> Append one or more records to the log. Each record has a key (used for
partitioning scans) and a value (arbitrary bytes, both base64-encoded in
JSON).

Set `awaitDurable` to `true` to block until the records are persisted to
durable storage. When `false` (the default), the server acknowledges the
write as soon as records are buffered in memory.




## OpenAPI

````yaml /openapi/log.yaml post /api/v1/log/append
openapi: 3.1.0
info:
  title: OpenData Log API
  version: 1.0.0
  description: HTTP API for the OpenData Log service — an append-only, key-partitioned log.
servers:
  - url: http://localhost:3001
    description: Local development server
security: []
paths:
  /api/v1/log/append:
    post:
      summary: Append records
      description: |
        Append one or more records to the log. Each record has a key (used for
        partitioning scans) and a value (arbitrary bytes, both base64-encoded in
        JSON).

        Set `awaitDurable` to `true` to block until the records are persisted to
        durable storage. When `false` (the default), the server acknowledges the
        write as soon as records are buffered in memory.
      operationId: append
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppendRequest'
            example:
              records:
                - key: dGVzdC1rZXk=
                  value: dGVzdC12YWx1ZQ==
              awaitDurable: false
      responses:
        '200':
          description: Records appended successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppendResponse'
              example:
                status: success
                recordsAppended: 1
                startSequence: 42
        '400':
          description: Invalid input (malformed JSON or missing fields).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AppendRequest:
      type: object
      description: Request body for appending records to the log.
      properties:
        records:
          type: array
          items:
            $ref: '#/components/schemas/Record'
          description: One or more records to append.
        awaitDurable:
          type: boolean
          default: false
          description: Whether to wait for durable persistence before responding.
      required:
        - records
    AppendResponse:
      type: object
      description: Response after successfully appending records.
      properties:
        status:
          type: string
          example: success
        recordsAppended:
          type: integer
          format: int32
          description: Number of records written.
        startSequence:
          type: integer
          format: uint64
          description: Sequence number assigned to the first appended record.
      required:
        - status
        - recordsAppended
        - startSequence
    ErrorResponse:
      type: object
      description: Error response returned for all error cases.
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          description: Human-readable error message.
      required:
        - status
        - message
    Record:
      type: object
      description: A single log record containing a key and a value.
      properties:
        key:
          type: string
          format: byte
          description: Partition key, base64-encoded.
        value:
          type: string
          format: byte
          description: Record payload, base64-encoded.
      required:
        - key
        - value

````