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

# Queue Risk Score Calculation

> Queue a job to calculate the risk score for a personal auto policy using telematics data. This endpoint returns a `job_id`, which can be used to track the job status and retrieve the result once the calculation is complete (usually within a minute).



## OpenAPI

````yaml post /v1/risk-score/ppa-telematics
openapi: 3.1.0
info:
  title: Vehicle Crashes API
  summary: 'This is the documentation for the Matrisk Data API. '
  version: 1.0.0
servers: []
security: []
tags:
  - name: Aggregated Crashes
    description: >-
      Provides aggregated crash data to support risk analysis and scoring
      models.
  - name: CA Garaging Risk Score
    description: >-
      Risk score derived from the garaging location of **commercial auto** (CA)
      vehicles. Helps evaluate potential risks based on where vehicles are
      stored or parked.
  - name: CA Telematics Risk Score
    description: >-
      Risk score generated using telematics data from **commercial auto**
      vehicles.
  - name: PPA Garaging Risk Score
    description: >-
      Risk score based on the garaging location of **personal passenger auto**
      (PPA) vehicles, assessing the safety and risk factors associated with
      where the vehicle is kept.
  - name: PPA Telematics Risk Score
    description: >-
      Risk score based on telematics data from **personal passenger auto** (PPA)
      vehicles.
  - name: API Key
    description: >-
      Operations related to managing API keys for authentication and
      authorization purposes.
paths:
  /v1/risk-score/ppa-telematics:
    post:
      tags:
        - PPA Telematics Risk Score
      summary: Queue Risk Score Calculation
      description: >-
        Queue a job to calculate the risk score for a personal auto policy using
        telematics data. This endpoint returns a `job_id`, which can be used to
        track the job status and retrieve the result once the calculation is
        complete (usually within a minute).
      operationId: queue_telematics_ppa_risk_score
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_PPA_Telematics_Risk_Score-queue_telematics_ppa_risk_score
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStatus'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Body_PPA_Telematics_Risk_Score-queue_telematics_ppa_risk_score:
      properties:
        file:
          type: string
          format: binary
          title: File
          description: |
            **Expected CSV Format**

            1. **Filename & Format**  
               - Must be a CSV file (`.csv` extension).  
               - The file cannot be empty and cannot contain rows with null (empty) values.

            2. **Required Columns**  
               - **latitude** (`float`) WGS84 format (e.g. `37.7749`)
               - **longitude** (`float`) WGS84 format (e.g. `-122.4194`)
               - **timestamp** (`datetime` in ISO 8601 format, e.g. `2023-01-15T13:45:30Z`)

               **Optional Column**  
               - **vehicle_id** (`string`,`integer` or `null`) if not provided, the vehicle_id will be set to `vehicle_1`

                You can download a sample file [here](https://crash-data-prod.nyc3.cdn.digitaloceanspaces.com/website-assets/data-samples/sample-ppa-telematics.csv).

            3. **Data Validation & Constraints**  
               - Extra columns are ignored.  
               - Every row must have valid values in each required column (no nulls or missing values).  
               - **latitude** and **longitude** are used to join external risk data, so they should be accurate real-world coordinates in WGS84 format.
               - **timestamp** must be parseable in strict ISO 8601 format.  
               - Files failing these validations are rejected.
               - The file must be less than 1GB.
               - Files are deleted after request is processed.
        version:
          type: string
          const: v1
          title: Version
          description: Version of the risk scoring model used.
          examples:
            - v1
        policy_holder_id:
          type: string
          title: Policy Holder Id
          description: Unique identifier for the policyholder.
          examples:
            - policy-holder-123
          coerce_numbers_to_str: true
      type: object
      required:
        - file
        - version
        - policy_holder_id
      title: Body_PPA Telematics Risk Score-queue_telematics_ppa_risk_score
    JobStatus:
      properties:
        job_id:
          type: string
          title: Job Id
          description: Unique identifier for the batch job
          examples:
            - job_2fb5792c
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
            - expired
          title: Status
          description: Current status of the job
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error message if job failed
          examples:
            - ''
      type: object
      required:
        - job_id
        - status
        - error_message
      title: JobStatus
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````