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

# Update the details of a previously filed claim by a cutstomer

> Endpoint to update an existing filed claim



## OpenAPI

````yaml patch /api/v1/claims/{id}/
openapi: 3.0.3
info:
  title: Superpool API
  version: 2.0.0
  description: >-
    Insurance infrastructure for Financial Institutions, Insurers, and
    Insurtechs
  contact:
    name: Unyte Africa LTD.
    url: https://ng.unyte.africa
    email: tech@unyte.com
servers: []
security: []
paths:
  /api/v1/claims/{id}/:
    patch:
      tags:
        - Claims
      summary: Update the details of a previously filed claim by a cutstomer
      description: Endpoint to update an existing filed claim
      operationId: update_claim
      parameters:
        - in: query
          name: claim_number
          schema:
            type: string
          description: >-
            Claim Reference Number issued by the Insurance provider to help
            manage/track claim object
        - in: path
          name: id
          schema:
            type: string
          description: UUID of the claim
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedClaimUpdate'
            examples:
              UpdateRequestAllowingFieldsLikeEmailOrIncidentDate:
                value:
                  claimant_metadata:
                    email: new.email@example.com
                    phone_number: '+1234567890'
                    age: 35
                  claim_details:
                    incident_date: '2024-08-01'
                    incident_description: Updated description of the incident.
                summary: Update request allowing fields like email or incident date
              AttemptToUpdateRestrictedFieldsLikeClaimNumber,FirstName,LastName,Etc.:
                value:
                  claimant_metadata:
                    first_name: Jane
                    last_name: Doe
                  claim_details:
                    claim_id: b17bb95a-21d7-4e9e-9414-7fc39e53c478
                summary: >-
                  Attempt to update restricted fields like claim number,
                  first_name, last_name, etc.
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedClaimUpdate'
            examples:
              UpdateRequestAllowingFieldsLikeEmailOrIncidentDate:
                value:
                  claimant_metadata:
                    email: new.email@example.com
                    phone_number: '+1234567890'
                    age: 35
                  claim_details:
                    incident_date: '2024-08-01'
                    incident_description: Updated description of the incident.
                summary: Update request allowing fields like email or incident date
              AttemptToUpdateRestrictedFieldsLikeClaimNumber,FirstName,LastName,Etc.:
                value:
                  claimant_metadata:
                    first_name: Jane
                    last_name: Doe
                  claim_details:
                    claim_id: b17bb95a-21d7-4e9e-9414-7fc39e53c478
                summary: >-
                  Attempt to update restricted fields like claim number,
                  first_name, last_name, etc.
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedClaimUpdate'
            examples:
              UpdateRequestAllowingFieldsLikeEmailOrIncidentDate:
                value:
                  claimant_metadata:
                    email: new.email@example.com
                    phone_number: '+1234567890'
                    age: 35
                  claim_details:
                    incident_date: '2024-08-01'
                    incident_description: Updated description of the incident.
                summary: Update request allowing fields like email or incident date
              AttemptToUpdateRestrictedFieldsLikeClaimNumber,FirstName,LastName,Etc.:
                value:
                  claimant_metadata:
                    first_name: Jane
                    last_name: Doe
                  claim_details:
                    claim_id: b17bb95a-21d7-4e9e-9414-7fc39e53c478
                summary: >-
                  Attempt to update restricted fields like claim number,
                  first_name, last_name, etc.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Claim'
              examples:
                SuccessfulResponse:
                  value:
                    status: success
                    message: Claim updated successfully.
                    data:
                      id: c45bca2a-b134-4f0e-95a1-5fdea8b662e9
                      claimant:
                        first_name: John
                        last_name: Doe
                        email: new.email@example.com
                        phone_number: '+1234567890'
                        age: 35
                      claim_details:
                        incident_date: '2024-08-01'
                        incident_description: Updated description of the incident.
                  summary: Successful response
          description: Success response with updated claim data.
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
        - ClientKeyAuth: []
components:
  schemas:
    PatchedClaimUpdate:
      type: object
      description: >-
        Handles updating of a claim instance


        We are only allowing updates to the following fields:

        - Customer information - age, email, phone number

        - Claim details - incident date, incident description

        - Witness information - name, contact phone, contact email, statement


        Fields you cannot update:

        - Claim ID

        - First Name and Surname of the claimant - you would have to reach out
        to support team with your verifying documents

        - Claim number provided by the merchant

        - Authority report - report number, report date, filing station - For
        now not supported

        - Supporting documents for a claim (Claim details) - For now not
        supported

        - Claim amount
      properties:
        claimant_metadata:
          $ref: '#/components/schemas/ClaimantMetadata'
        claim_details:
          $ref: '#/components/schemas/ClaimDetails'
        witness_details:
          type: array
          items:
            $ref: '#/components/schemas/Witness'
        authority_report:
          $ref: '#/components/schemas/AuthorityReport'
    Claim:
      type: object
      description: |-
        Serializer for Claim instances.

        This serializer includes fields that are intended to be visible when
        retrieving or listing Claim objects. It provides a human-readable
        representation of the Claim, including status descriptions.
      properties:
        claim_id:
          type: string
          format: uuid
          readOnly: true
        claim_reference_number:
          type: string
        claim_status:
          type: string
        claim_date:
          type: string
          format: date
          readOnly: true
          title: Date at which a claim is created
        claimant:
          type: string
          readOnly: true
        claim_type:
          type: string
          readOnly: true
          nullable: true
        incident_date:
          type: string
          format: date
          nullable: true
          title: Date of Incident
        incident_description:
          type: string
          nullable: true
        claim_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
        estimated_loss:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
        amount_payable:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
        insurer:
          type: string
        product:
          $ref: '#/components/schemas/ClaimProduct'
        policy:
          type: string
          format: uuid
          description: Unique identifier for the policy
        notes:
          type: string
          readOnly: true
          nullable: true
        documents:
          type: string
          readOnly: true
        claim_status_timeline:
          type: array
          items:
            $ref: '#/components/schemas/StatusTimeline'
          readOnly: true
      required:
        - amount_payable
        - claim_amount
        - claim_date
        - claim_id
        - claim_reference_number
        - claim_status
        - claim_status_timeline
        - claim_type
        - claimant
        - documents
        - insurer
        - notes
        - policy
        - product
    ClaimantMetadata:
      type: object
      description: Validates incoming request data for creating a new claim.
      properties:
        first_name:
          type: string
        last_name:
          type: string
        birth_date:
          type: string
          format: date
        email:
          type: string
          format: email
        phone_number:
          type: string
        relationship:
          type: string
          description: The relationship of the claimant to the policyholder
      required:
        - birth_date
        - email
        - first_name
        - last_name
    ClaimDetails:
      type: object
      description: Specifies the data structure for capturing claim details
      properties:
        claim_type:
          $ref: '#/components/schemas/ClaimTypeEnum'
        incident_description:
          type: string
          description: Detailed account of the event that led to the claim
        incident_date:
          type: string
          format: date
        claim_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          description: Estimated amount of the claim in the format "1000.00"
        supporting_documents:
          type: array
          items:
            $ref: '#/components/schemas/ClaimDocument'
          description: >-
            List of supporting documents in the format [{"document_name": "Name
            of Document", "evidence_type": "Type of Evidence", "blob": "Base64
            encoded document"}]
      required:
        - claim_type
        - incident_date
    Witness:
      type: object
      description: >-
        Specifies the data structure for capturing witness information of a
        claim


        There can be 0 - n witnesses for a claim
      properties:
        witness_name:
          type: string
          description: Full name of the witness in the format, "First Name Last Name"
        witness_contact_phone:
          type: string
        witness_contact_email:
          type: string
          format: email
        witness_statement:
          type: string
          description: A brief statement from the witness about the incident
      required:
        - witness_name
        - witness_statement
    AuthorityReport:
      type: object
      description: Specifies the data structure for the Authority Report e.g Police Report
      properties:
        report_number:
          type: string
        report_date:
          type: string
          format: date
        filing_station:
          type: string
      required:
        - report_date
        - report_number
    ClaimProduct:
      type: object
      description: Serilizes the metadata about the product category a claim belongs to
      properties:
        name:
          type: string
          description: Name of the package offered by the insurance provider
          maxLength: 255
        insurance_product_type:
          type: string
      required:
        - insurance_product_type
        - name
    StatusTimeline:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/StatusTimelineStatusEnum'
        time_stamp:
          type: string
          format: date-time
      required:
        - status
        - time_stamp
    ClaimTypeEnum:
      enum:
        - basic
        - premium
        - advanced
        - accident
        - death
        - illness
        - theft
        - other
      type: string
      description: |-
        * `basic` - Basic
        * `premium` - Premium
        * `advanced` - Advanced
        * `accident` - Accident
        * `death` - Death
        * `illness` - Illness
        * `theft` - Theft
        * `other` - Other
    ClaimDocument:
      type: object
      properties:
        document_name:
          type: string
          description: Name of the document uploaded.
          maxLength: 255
        evidence_type:
          allOf:
            - $ref: '#/components/schemas/EvidenceTypeEnum'
          description: |-
            Type of evidence uploaded.

            * `video` - Video
            * `audio` - Audio
            * `document` - Document
            * `picture` - Picture
        document_url:
          type: string
          format: uri
          nullable: true
          title: File Reference
          description: >-
            Reference to the stored document (e.g., Google Cloud Storage blob
            name).
          maxLength: 1024
        uploaded_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - document_name
        - evidence_type
        - uploaded_at
    StatusTimelineStatusEnum:
      enum:
        - accepted
        - approved
        - pending
        - denied
        - paid
        - offer_sent
        - offer_accepted
      type: string
      description: |-
        * `accepted` - Accepted
        * `approved` - Approved
        * `pending` - Pending
        * `denied` - Rejected
        * `paid` - Paid
        * `offer_sent` - Offer sent
        * `offer_accepted` - Offer accepted
    EvidenceTypeEnum:
      enum:
        - video
        - audio
        - document
        - picture
      type: string
      description: |-
        * `video` - Video
        * `audio` - Audio
        * `document` - Document
        * `picture` - Picture
  securitySchemes:
    ClientKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````