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

# Apply ops to a subject's record

> Apply an ordered op batch to a subject's document — refused if a whole-path write
violates an attached path's regime; idempotent on a replayed ``op_id``.



## OpenAPI

````yaml /openapi.json post /api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/deltas
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 14.0.2
servers: []
security: []
paths:
  /api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/deltas:
    post:
      tags:
        - states
      summary: Apply ops to a subject's record
      description: >-
        Apply an ordered op batch to a subject's document — refused if a
        whole-path write

        violates an attached path's regime; idempotent on a replayed ``op_id``.
      operationId: post_api_states_name_records_target_kind_target_name_kind_key_deltas
      parameters:
        - in: path
          name: name
          required: true
          schema:
            type: string
        - in: path
          name: target_kind
          required: true
          schema:
            type: string
        - in: path
          name: target_name
          required: true
          schema:
            type: string
        - in: path
          name: kind
          required: true
          schema:
            type: string
        - in: path
          name: key
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/ApplyResult'
                required:
                  - data
                type: object
          description: Success.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Resource not found.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Request failed validation.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ApplyResult:
      additionalProperties: false
      description: >-
        The outcome of an ``apply``: whether it ``applied`` (a replayed op-id or
        an

        empty batch is ``False``; a batch whose every op guard-skips still
        reports

        ``applied=True`` with the ops in ``skipped``), the resulting ``data``
        and ``seq``

        when it did, and the ``skipped`` ops (each a reason record) a guard held
        back.
      properties:
        applied:
          title: Applied
          type: boolean
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Data
        seq:
          anyOf:
            - type: number
            - type: 'null'
          default: null
          title: Seq
        skipped:
          items:
            additionalProperties: true
            type: object
          title: Skipped
          type: array
      required:
        - applied
      title: ApplyResult
      type: object
    Error:
      properties:
        code:
          description: >-
            Stable machine-readable reason a client keys a dedicated error state
            on, present on refusals that opt in (e.g. a 501 not-configured
            refusal). Optional: absent when the error carries only a
            human-readable message.
          type: string
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````