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

# Update record fields

> Update common fields for any record type with proper authorization checks



## OpenAPI

````yaml patch /v1/misc/patch
openapi: 3.0.0
info:
  title: Misc API
  version: 1.0.0
  description: API for miscellaneous utility operations
servers: []
security:
  - bearerAuth: []
tags:
  - name: Misc
    description: Miscellaneous utility operations
paths:
  /v1/misc/patch:
    patch:
      tags:
        - Misc
      summary: Update record fields
      description: >-
        Update common fields for any record type with proper authorization
        checks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchFieldsInput'
            examples:
              active_status:
                summary: Update active status
                value:
                  record_type: accounts
                  record_id: 550e8400-e29b-41d4-a716-446655440000
                  active: false
              description:
                summary: Update description
                value:
                  record_type: products
                  record_id: 550e8400-e29b-41d4-a716-446655440000
                  description: Premium product with extended warranty
              metadata:
                summary: Update metadata
                value:
                  record_type: orders
                  record_id: 550e8400-e29b-41d4-a716-446655440000
                  metadata:
                    source: web
                    campaign: spring_sale
                    priority: high
              multiple_fields:
                summary: Update multiple fields
                value:
                  record_type: suppliers
                  record_id: 550e8400-e29b-41d4-a716-446655440000
                  active: true
                  description: Preferred supplier
                  metadata:
                    rating: 5
                    category: electronics
                    terms: net30
      responses:
        '200':
          description: Fields updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchFieldsResponse'
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: misc.invalid_record_type
                message: Invalid record type provided
                details:
                  record_type: invalid_type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: misc.record_not_found
                message: Record not found
                details:
                  record_id: 550e8400-e29b-41d4-a716-446655440000
        '422':
          description: No fields to update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: misc.no_fields_to_update
                message: No fields provided for update
        '500':
          description: Update failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: misc.update_failed
                message: Failed to update record
components:
  schemas:
    PatchFieldsInput:
      type: object
      required:
        - record_type
        - record_id
      properties:
        record_type:
          type: string
          description: Type of record to update
          example: customers
        record_id:
          type: string
          format: uuid
          description: UUID of the record to update
          example: 550e8400-e29b-41d4-a716-446655440000
        active:
          type: boolean
          description: Active status of the record
          example: true
        description:
          type: string
          description: Description of the record
          example: Updated description
        metadata:
          type: object
          description: Custom metadata for the record
          additionalProperties: true
          example:
            category: premium
            region: europe
            tags:
              - vip
              - priority
    PatchFieldsResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: UUID of the updated record
        active:
          type: boolean
          description: Current active status
        description:
          type: string
          description: Current description
        metadata:
          type: object
          description: Current metadata
          additionalProperties: true
        modified_at:
          type: string
          format: date-time
          description: Last modification timestamp
        modified_by:
          type: string
          format: uuid
          description: UUID of the user who made the modification
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code
          example: misc.invalid_record_type
        message:
          type: string
          description: Error message
          example: Invalid record type provided
        details:
          type: object
          description: Additional error details
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````