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

# Push Node State

> Git-like full-state push operation.

This endpoint implements the declarative API where clients send the complete
desired state, and the server handles diffing and object reuse automatically.

Similar to `git push`, the client describes the end state they want, and the
server figures out what changed and creates an optimal commit.

Features:
- Automatic object reuse for unchanged content
- Complete state snapshots in each commit
- Branch support for collaborative workflows
- Validation of state schema



## OpenAPI

````yaml put /orgs/{org_id}/nodes/{node_id}/tree/{branch}/push
openapi: 3.1.0
info:
  title: Flow API
  description: Content-addressing backend with Git-like versioning
  version: 1.0.0
servers:
  - url: https://api.yertle.com
    description: Production
security: []
paths:
  /orgs/{org_id}/nodes/{node_id}/tree/{branch}/push:
    put:
      tags:
        - nodes
      summary: Push Node State
      description: >-
        Git-like full-state push operation.


        This endpoint implements the declarative API where clients send the
        complete

        desired state, and the server handles diffing and object reuse
        automatically.


        Similar to `git push`, the client describes the end state they want, and
        the

        server figures out what changed and creates an optimal commit.


        Features:

        - Automatic object reuse for unchanged content

        - Complete state snapshots in each commit

        - Branch support for collaborative workflows

        - Validation of state schema
      operationId: push_node_state_orgs__org_id__nodes__node_id__tree__branch__push_put
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Org Id
        - name: node_id
          in: path
          required: true
          schema:
            type: string
            title: Node Id
        - name: branch
          in: path
          required: true
          schema:
            type: string
            title: Branch
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PushStateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushStateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PushStateRequest:
      properties:
        message:
          type: string
          title: Message
          description: Commit message describing the changes
        state:
          additionalProperties: true
          type: object
          title: State
          description: Complete desired state of the node
        expected_head_commit:
          type: string
          title: Expected Head Commit
          description: >-
            The commit ID the client's state is based on. Push is rejected with
            409 if this doesn't match the branch's current head.
      type: object
      required:
        - message
        - state
        - expected_head_commit
      title: PushStateRequest
      description: Request model for Git-like full-state push operations.
    PushStateResponse:
      properties:
        commit_id:
          type: string
          title: Commit Id
          description: ID of the created commit
        node_id:
          type: string
          title: Node Id
          description: Node ID that was updated
        branch:
          type: string
          title: Branch
          description: Branch that was updated
        message:
          type: string
          title: Message
          description: Commit message
        objects_created:
          type: integer
          title: Objects Created
          description: Number of new objects created
        objects_reused:
          type: integer
          title: Objects Reused
          description: Number of existing objects reused
        previous_commit:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Commit
          description: Previous commit ID on this branch
        connection_id_mappings:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Connection Id Mappings
          description: Mapping from temp connection IDs to real UUIDs
      type: object
      required:
        - commit_id
        - node_id
        - branch
        - message
        - objects_created
        - objects_reused
      title: PushStateResponse
      description: Response model for Git-like full-state push operations.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````