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

# Get Lawsuit

> Returns the lawsuit associated with an event. Each event has at most one lawsuit.

**Required permission:** `company.event:export`




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/external/companies/{companyId}/events/{eventId}/lawsuit
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/external/companies/{companyId}/events/{eventId}/lawsuit:
    get:
      tags:
        - Lawsuits
      summary: Get Lawsuit
      description: >
        Returns the lawsuit associated with an event. Each event has at most one
        lawsuit.


        **Required permission:** `company.event:export`
      operationId: getLawsuit
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/eventId'
      responses:
        '200':
          description: Lawsuit details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lawsuit'
              examples:
                success:
                  summary: Lawsuit retrieved
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440001
                    companyId: 660e8400-e29b-41d4-a716-446655440000
                    eventId: 770e8400-e29b-41d4-a716-446655440000
                    caseNumber: CASE-2026-001
                    caseName: Smith v. Jones Insurance Co.
                    lawsuitFiledDate: '2026-01-10T00:00:00.000Z'
                    suitServedDate: '2026-01-15T00:00:00.000Z'
                    trialDate: '2026-06-01T00:00:00.000Z'
                    venueName: District Court of Springfield
                    venueAddress:
                      value: 100 Court St, Springfield, IL 62701
                      structuredValue:
                        streetNumber: '100'
                        streetName: Court St
                        city: Springfield
                        state:
                          short: IL
                          long: Illinois
                        postalCode: '62701'
                    judgeName: Hon. Sarah Williams
                    plaintiffs:
                      - John Smith
                      - Mary Smith
                    plaintiffAttorneyId: 880e8400-e29b-41d4-a716-446655440000
                    plaintiffLawFirmId: 990e8400-e29b-41d4-a716-446655440000
                    plaintiffAddress: null
                    settlementDemand: '250000'
                    settlementType: 'N'
                    arbitrationInvolved: 'No'
                    dateDefenseCounselAdded: '2026-01-20T00:00:00.000Z'
                    expertDefense: Dr. Expert Defense
                    expertPlaintiff: Dr. Expert Plaintiff
                    declaratoryJudgementFiledDate: null
                    createdAt: '2026-01-10T10:30:00.000Z'
                    updatedAt: '2026-02-01T14:20:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Lawsuit not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                lawsuitNotFound:
                  summary: Lawsuit not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Lawsuit not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    eventId:
      name: eventId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Event identifier
  schemas:
    Lawsuit:
      type: object
      description: A lawsuit associated with an event
      properties:
        id:
          type: string
          format: uuid
          description: Lawsuit identifier
        companyId:
          type: string
          format: uuid
          description: Company identifier
        eventId:
          type: string
          format: uuid
          description: Associated event identifier
        caseNumber:
          type: string
          nullable: true
          description: Court case number
        caseName:
          type: string
          nullable: true
          description: Name of the case
        lawsuitFiledDate:
          type: string
          format: date-time
          nullable: true
          description: Date lawsuit was filed (ISO 8601)
        suitServedDate:
          type: string
          format: date-time
          nullable: true
          description: Date suit was served (ISO 8601)
        trialDate:
          type: string
          format: date-time
          nullable: true
          description: Scheduled trial date (ISO 8601)
        venueName:
          type: string
          nullable: true
          description: Name of the court venue
        venueAddress:
          allOf:
            - $ref: '#/components/schemas/LawsuitAddress'
          nullable: true
          description: Address of the court venue
        judgeName:
          type: string
          nullable: true
          description: Name of the presiding judge
        plaintiffs:
          type: array
          items:
            type: string
          nullable: true
          description: List of plaintiff names
        plaintiffAttorneyId:
          type: string
          format: uuid
          nullable: true
          description: Attorney representing the plaintiff
        plaintiffLawFirmId:
          type: string
          format: uuid
          nullable: true
          description: Law firm representing the plaintiff
        plaintiffAddress:
          allOf:
            - $ref: '#/components/schemas/LawsuitAddress'
          nullable: true
          description: Address of the plaintiff
        settlementDemand:
          type: string
          nullable: true
          description: Settlement demand amount
        settlementType:
          type: string
          nullable: true
          description: >-
            Settlement type code (S=Settlement, N=No Settlement, L=Litigated,
            C=Closed)
        arbitrationInvolved:
          type: string
          nullable: true
          description: Whether arbitration is involved (Yes/No)
        dateDefenseCounselAdded:
          type: string
          format: date-time
          nullable: true
          description: Date defense counsel was added (ISO 8601)
        expertDefense:
          type: string
          nullable: true
          description: Defense expert information
        expertPlaintiff:
          type: string
          nullable: true
          description: Plaintiff expert information
        declaratoryJudgementFiledDate:
          type: string
          format: date-time
          nullable: true
          description: Date declaratory judgement was filed (ISO 8601)
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: When the lawsuit was created (ISO 8601)
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: When the lawsuit was last updated (ISO 8601)
    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
    LawsuitAddress:
      type: object
      description: Address with display value and optional structured components
      properties:
        value:
          type: string
          description: Display string for the address
        structuredValue:
          type: object
          description: Parsed address components
          properties:
            streetNumber:
              type: string
            streetName:
              type: string
            city:
              type: string
            county:
              type: string
            state:
              type: object
              properties:
                short:
                  type: string
                long:
                  type: string
            country:
              type: string
            postalCode:
              type: string
            name:
              type: string
            neighborhood:
              type: string
            sublocality:
              type: string
            location:
              type: object
              properties:
                lat:
                  type: number
                lng:
                  type: number
            timezone:
              type: string
      required:
        - value
  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.

````