> ## 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 Event

> Updates a Field Model V1 event. The request body is a flat JSON object
with field `referenceId`s as keys — the same shape as the create request.

**This is a full replacement** of the event's field data, not a merge.
Include all fields you want the event to have after the update.

The `eventType` field is required in the body for permission resolution.

**Required permission:** `claim:update` or `incident:update`
(determined by `eventType`)




## OpenAPI

````yaml /openapi/generated-external-api.yaml put /api/v1/external/companies/{companyId}/events/{eventId}
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}/events/{eventId}:
    put:
      tags:
        - Field Model Events
      summary: Update Event
      description: >
        Updates a Field Model V1 event. The request body is a flat JSON object

        with field `referenceId`s as keys — the same shape as the create
        request.


        **This is a full replacement** of the event's field data, not a merge.

        Include all fields you want the event to have after the update.


        The `eventType` field is required in the body for permission resolution.


        **Required permission:** `claim:update` or `incident:update`

        (determined by `eventType`)
      operationId: updateEventV1
      parameters:
        - $ref: '#/components/parameters/companyId'
        - name: eventId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Event identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              description: >-
                Flat JSON object with field referenceIds as keys (full
                replacement)
            examples:
              updateFields:
                summary: Update event fields
                value:
                  eventType: Claim
                  eventCoverageType: Professional Liability
                  eventInsureds:
                    - 550e8400-e29b-41d4-a716-446655440200
                  lossDescription: Updated - severe water damage to building
                  lossDate:
                    date: '2025-01-10'
                    timezone: America/New_York
      responses:
        '200':
          description: Event updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventV1Detail'
              examples:
                success:
                  summary: Updated event
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440300
                    companyId: 550e8400-e29b-41d4-a716-446655440000
                    policyId: 550e8400-e29b-41d4-a716-446655440100
                    fieldModelV1Data:
                      eventType: Claim
                      eventCoverageType: Professional Liability
                      eventPolicy: 550e8400-e29b-41d4-a716-446655440100
                      lossDescription: Updated - severe water damage to building
                      lossDate:
                        date: '2025-01-10'
                        timezone: America/New_York
                    createdAt: '2025-01-15T10:30:00.000Z'
                    createdBy: google-oauth2|123456789
                    updatedAt: '2025-01-20T14:00:00.000Z'
                    updatedBy: google-oauth2|987654321
        '400':
          description: Bad Request - Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingEventType:
                  summary: Missing eventType
                  value:
                    error:
                      code: INVALID_EVENT_TYPE
                      message: >-
                        eventType is required and must be one of: claim,
                        incident (case-insensitive)
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Event not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                eventNotFound:
                  summary: Event not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Event not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
  schemas:
    EventV1Detail:
      type: object
      description: A Field Model V1 event entity with dynamic field data.
      required:
        - id
        - companyId
        - fieldModelV1Data
      properties:
        id:
          type: string
          format: uuid
          description: Event identifier
        companyId:
          type: string
          format: uuid
          description: Company identifier
        policyId:
          type: string
          format: uuid
          nullable: true
          description: >
            Associated policy ID. Convenience field surfaced at the top level
            for

            backwards compatibility — the value is read from

            `fieldModelV1Data.eventPolicy`, where it is stored as a `Join:
            Policy`

            field.
        fieldModelV1Data:
          type: object
          additionalProperties: true
          description: |
            Dynamic field data for the event. Keys are field `referenceId`s
            defined in the company's field configuration. Includes base fields
            like `eventType`, `eventCoverageType`, and `eventPolicy` (the Join
            field that stores the associated policy ID, also surfaced at the top
            level as `policyId`) as well as any custom fields.
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: When the event was created
        createdBy:
          type: string
          nullable: true
          description: User ID who created the event
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: When the event was last updated
        updatedBy:
          type: string
          nullable: true
          description: User ID who last updated the event
    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.

````