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

# Update Custom Object

> Updates a custom object's data fields. The request body must include a
`data` object — this is a **full replacement** of the object's field data,
not a merge. Include all fields you want the object to have after the update.

**Relationship fields are not accepted in `data`** — use the dedicated
relationship management endpoints instead.

**Required permission:** `company.fmv1_custom_object:update`




## OpenAPI

````yaml /openapi/generated-external-api.yaml put /api/v1/external/companies/{companyId}/custom-objects/{objectType}/{objectId}
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://app.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/external/companies/{companyId}/custom-objects/{objectType}/{objectId}:
    put:
      tags:
        - Field Model Custom Objects
      summary: Update Custom Object
      description: >
        Updates a custom object's data fields. The request body must include a

        `data` object — this is a **full replacement** of the object's field
        data,

        not a merge. Include all fields you want the object to have after the
        update.


        **Relationship fields are not accepted in `data`** — use the dedicated

        relationship management endpoints instead.


        **Required permission:** `company.fmv1_custom_object:update`
      operationId: updateCustomObject
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/objectType'
        - $ref: '#/components/parameters/objectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: object
                  additionalProperties: true
                  description: Field values keyed by referenceId (full replacement)
            examples:
              update:
                summary: Update vehicle fields
                value:
                  data:
                    vehicleMake: Toyota
                    vehicleModel: Camry
                    year: 2025
                    vin: 1HGBH41JXMN109186
                    color: Blue
      responses:
        '200':
          description: Custom object updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomObject'
              examples:
                success:
                  summary: Updated vehicle
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440020
                    companyId: 550e8400-e29b-41d4-a716-446655440000
                    type: vehicle
                    displayName: Toyota Camry
                    data:
                      vehicleMake: Toyota
                      vehicleModel: Camry
                      year: 2025
                      vin: 1HGBH41JXMN109186
                      color: Blue
                    relationships:
                      ownerExposure: 550e8400-e29b-41d4-a716-446655440200
                    createdAt: '2026-01-15T10:30:00.000Z'
                    updatedAt: '2026-01-20T14:00:00.000Z'
                    createdBy: google-oauth2|123456789
                    updatedBy: google-oauth2|987654321
        '400':
          description: Bad Request - Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                relationshipField:
                  summary: Relationship field in data
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: >-
                        Field 'ownerExposure' is a relationship field and cannot
                        be set in data. Use the relationship management
                        endpoints instead.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Custom object not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: Custom object not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Custom object not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    objectType:
      name: objectType
      in: path
      required: true
      schema:
        type: string
      description: >-
        Custom object type in snake_case format (e.g., `vehicle`,
        `building_info`)
    objectId:
      name: objectId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Custom object identifier
  schemas:
    CustomObject:
      type: object
      description: |
        A custom object entity. The `data` field contains regular field values
        and the `relationships` field contains IDs of related entities keyed by
        field reference ID.
      required:
        - id
        - companyId
        - type
        - displayName
        - data
        - relationships
      properties:
        id:
          type: string
          format: uuid
          description: Custom object identifier
        companyId:
          type: string
          format: uuid
          description: Company identifier
        type:
          type: string
          description: The object type in snake_case format
        displayName:
          type: string
          description: Computed display name based on the type's display name expression
        data:
          type: object
          additionalProperties: true
          description: >
            Dynamic field data for the custom object. Keys are field
            `referenceId`s

            defined in the company's field configuration. Only includes regular

            (non-relationship) fields.
        relationships:
          type: object
          additionalProperties: true
          description: >
            Relationship data keyed by field `referenceId`. Values are either a

            single UUID string (for single-cardinality relationships) or an
            array

            of UUID strings (for multi-cardinality relationships).
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: When the custom object was created
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: When the custom object was last updated
        createdBy:
          type: string
          nullable: true
          description: User ID who created the custom object
        updatedBy:
          type: string
          nullable: true
          description: User ID who last updated the custom object
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: Authorization header is required
            bearerTokenNotAllowed:
              summary: Bearer token used instead of API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: External API endpoints require API key authentication
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: INTERNAL_ERROR
                  message: An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````