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

# Create Event

> Creates a new Field Model V1 event for the company.

The request body is a flat JSON object where keys are field `referenceId`s
defined in the company's field configuration. Use the
[Get Configuration](/api-reference/field-model/events/overview) endpoint
to discover available fields.

**Required base fields:** `eventType`, `eventCoverageType`, `eventInsureds`
(array of exposure IDs).

**Optional base fields:** `eventStatus` (defaults to `Open`),
`eventReferenceId` (auto-generated if omitted), `policyId` (mapped to the
`eventPolicy` Join field inside `fieldModelV1Data`).

**Date fields** must be submitted as objects: `{ "date": "YYYY-MM-DD", "timezone": "America/New_York" }` — plain date strings are not accepted.

**Required permission:** `company.claim:create` or `company.incident:create`
(determined by `eventType`)




## OpenAPI

````yaml /openapi/generated-external-api.yaml post /api/v1/external/companies/{companyId}/events
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:
    post:
      tags:
        - Field Model Events
      summary: Create Event
      description: >
        Creates a new Field Model V1 event for the company.


        The request body is a flat JSON object where keys are field
        `referenceId`s

        defined in the company's field configuration. Use the

        [Get Configuration](/api-reference/field-model/events/overview) endpoint

        to discover available fields.


        **Required base fields:** `eventType`, `eventCoverageType`,
        `eventInsureds`

        (array of exposure IDs).


        **Optional base fields:** `eventStatus` (defaults to `Open`),

        `eventReferenceId` (auto-generated if omitted), `policyId` (mapped to
        the

        `eventPolicy` Join field inside `fieldModelV1Data`).


        **Date fields** must be submitted as objects: `{ "date": "YYYY-MM-DD",
        "timezone": "America/New_York" }` — plain date strings are not accepted.


        **Required permission:** `company.claim:create` or
        `company.incident:create`

        (determined by `eventType`)
      operationId: createEventV1
      parameters:
        - $ref: '#/components/parameters/companyId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              description: Flat JSON object with field referenceIds as keys
            examples:
              basic:
                summary: Create claim with required fields
                value:
                  eventType: Claim
                  eventCoverageType: Professional Liability
                  eventInsureds:
                    - 550e8400-e29b-41d4-a716-446655440200
              withOptionalFields:
                summary: Create incident with optional fields
                value:
                  eventType: Incident
                  eventCoverageType: Board Defense
                  eventInsureds:
                    - 550e8400-e29b-41d4-a716-446655440200
                  eventStatus: Open
                  policyId: 550e8400-e29b-41d4-a716-446655440100
                  lossDescription: Water damage to building
                  lossDate:
                    date: '2025-01-10'
                    timezone: America/New_York
      responses:
        '201':
          description: Event created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The ID of the created event
              examples:
                success:
                  summary: Event created
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440300
        '400':
          description: Bad Request - Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingEventType:
                  summary: Missing eventType
                  value:
                    error:
                      code: InvalidFieldModelV1Data
                      message: >-
                        eventType is required and must be one of: claim,
                        incident (case-insensitive)
                missingInsureds:
                  summary: Missing eventInsureds
                  value:
                    error:
                      code: InvalidFieldModelV1Data
                      message: >-
                        eventInsureds is required and must be a non-empty array
                        of insured IDs
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
  schemas:
    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.

````