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

# Create a record once

> Creates a record under an id the caller chose. A repeat of the same id is answered 409 with the stored record and never overwrites it or the edits made since. Takes the same body as create record, with config_id in the body.



## OpenAPI

````yaml /api-reference/endpoint/records/openapi.json post /records/record-once
openapi: 3.1.0
info:
  title: Records API
  version: 1.1.0
  description: >-
    Record configurations (schemas, views, versions) and the records that
    conform to them. Record IDs are server-generated, config IDs are
    client-supplied (`^[a-zA-Z0-9_-]+$`). Configs and records are updated with
    PUT: a config update applies only the fields sent, a record update merges
    `data`. Editing a config schema does not retroactively re-validate existing
    records. Publish a config version to snapshot the stored config; list and
    read versions to see its history.
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Record Configs
    description: >-
      Manage record configuration schemas. Each configuration defines the
      structure (fields, types, validation rules) that records must conform to.
  - name: Records
    description: >-
      Manage individual data records. Each record belongs to exactly one
      configuration and its data is validated against that configuration's
      schema.
  - name: Record Config Collections
    description: Groups of record configs.
  - name: Record Config Versions
    description: Published snapshots of a record config.
  - name: Record History
    description: The change history of a record.
  - name: Record Assessment
  - name: Strategy and Simulation
  - name: Record Metrics
paths:
  /records/record-once:
    post:
      tags:
        - Records
      summary: Create a record once
      description: >-
        Creates a record under an id the caller chose. A repeat of the same id
        is answered 409 with the stored record and never overwrites it or the
        edits made since. Takes the same body as create record, with config_id
        in the body.
      operationId: createRecordOnce
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordCreate'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        '400':
          description: Request refused or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RecordCreate:
      type: object
      description: >-
        The config_id is taken from the URL path and does not need to be
        repeated in the body. `data` is optional (defaults to an empty object)
        but is validated against the config schema when present.
      properties:
        id:
          type: string
          readOnly: true
          description: >-
            Server-generated record ID (10-character nanoid). Any `id` sent in
            the request body is ignored.
        data:
          type: object
          additionalProperties: true
          description: >-
            Field values validated against the configuration schema. Required
            schema fields must be present. Values are type-checked against the
            schema. Null values are accepted for optional fields. Extra keys not
            in the schema are allowed. If omitted, an empty object is used.
        space_id:
          type: string
          description: Optional space ID to associate the record with a specific space.
        folder:
          type: string
          description: Optional folder to organize the record into.
      example:
        data:
          rating: 4.5
          category: feature
          comment: <p>Great product, would love dark mode.</p>
    Response:
      type: object
      properties:
        status_code:
          type: integer
          description: HTTP status code echoed in the response body.
        body:
          type: object
          description: Response payload.
    ErrorResponse:
      type: object
      properties:
        status_code:
          type: integer
        body:
          type: object
          properties:
            error:
              type: string
              description: Human-readable error message.
      example:
        status_code: 400
        body:
          error: field 'rating' is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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