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

# Update Records

> Update records matching query filters



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/records.yaml patch /api/database/records/{tableName}
openapi: 3.0.3
info:
  title: Insforge Records API
  version: 2.0.0
  description: PostgREST-style database record operations
servers: []
security:
  - bearerAuth: []
  - apiKey: []
paths:
  /api/database/records/{tableName}:
    patch:
      tags:
        - Client
      summary: Update Records
      description: Update records matching query filters
      parameters:
        - name: tableName
          in: path
          required: true
          schema:
            type: string
          description: Name of the table
          example: posts
        - name: id
          in: query
          schema:
            type: string
          description: >-
            Filter records by ID (e.g.,
            "?id=eq.123e4567-e89b-12d3-a456-426614174000")
          example: eq.123e4567-e89b-12d3-a456-426614174000
        - name: Prefer
          in: header
          schema:
            type: string
            enum:
              - return=representation
          description: Include to return updated records in response
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              title: Updated Post Title
              content: This content has been updated.
      responses:
        '200':
          description: Records updated
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
              examples:
                without_prefer:
                  summary: Response without Prefer header
                  value: []
                with_prefer:
                  summary: 'Response with Prefer: return=representation'
                  value:
                    - id: 123e4567-e89b-12d3-a456-426614174000
                      title: Updated Post Title
                      content: This content has been updated.
                      createdAt: '2025-01-01T00:00:00Z'
                      updatedAt: '2025-01-21T11:00:00Z'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: VALIDATION_ERROR
                message: Invalid field type
                statusCode: 400
                nextActions: Check field types match table schema
        '404':
          description: No records found to update
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
              example: []
      security:
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling
          example: VALIDATION_ERROR
        message:
          type: string
          description: Human-readable error message
          example: Invalid input data
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        nextActions:
          type: string
          description: Suggested action to resolve the error
          example: Check the request body format
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````