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

# Record Event

> Records a structured interaction event for an in-progress submission.
Use this to stream telemetry from your player to Edpire for analytics
and proctoring.

**`answer_change`** — fires each time a learner modifies their answer
for a question. Requires `question_id`. Atomically increments the
`change_count` counter on the answer row so you can see how many times
a learner revised each answer.

**`node_view`** — learner viewed a specific interactive node within a
question. Pass `node_id` to identify it.

**`paused` / `resumed`** — learner paused or resumed the session (e.g.
navigated away and returned).

**`navigated`** — learner moved between questions or sections. Use the
`payload` field to record `{ from: questionId, to: questionId }`.

**`flagged`** — learner flagged a question for review.




## OpenAPI

````yaml POST /submissions/{id}/events
openapi: 3.1.0
info:
  title: Edpire API
  description: >
    Edpire is a headless assessment engine. This API lets you manage
    assessments,

    submit answers for grading, retrieve results, manage collections, and
    configure

    webhooks for real-time notifications.


    All responses use a consistent envelope: `{ data, error, meta }`.
  version: 1.0.0
  contact:
    name: Edpire Support
    url: https://edpire.com
  license:
    name: Proprietary
servers:
  - url: https://edpire.com/api/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Assessments
    description: Create, list, update, publish, and grade assessments
  - name: Submissions
    description: Retrieve submission details
  - name: Learners
    description: Query learner results
  - name: Collections
    description: Manage ordered groups of assessments
  - name: Webhooks
    description: Register and manage webhook endpoints
  - name: Embed
    description: Mint tokens and load assessments for browser-side rendering
  - name: OpenAPI
    description: API specification
paths:
  /submissions/{id}/events:
    post:
      tags:
        - Submissions
      summary: Log a learner interaction event
      description: |
        Records a structured interaction event for an in-progress submission.
        Use this to stream telemetry from your player to Edpire for analytics
        and proctoring.

        **`answer_change`** — fires each time a learner modifies their answer
        for a question. Requires `question_id`. Atomically increments the
        `change_count` counter on the answer row so you can see how many times
        a learner revised each answer.

        **`node_view`** — learner viewed a specific interactive node within a
        question. Pass `node_id` to identify it.

        **`paused` / `resumed`** — learner paused or resumed the session (e.g.
        navigated away and returned).

        **`navigated`** — learner moved between questions or sections. Use the
        `payload` field to record `{ from: questionId, to: questionId }`.

        **`flagged`** — learner flagged a question for review.
      operationId: recordSubmissionEvent
      parameters:
        - name: id
          in: path
          required: true
          description: Submission ID (must be in_progress)
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmissionEventRequest'
      responses:
        '200':
          description: Event recorded
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          ok:
                            type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - BearerAuth:
            - write:submissions
components:
  schemas:
    SubmissionEventRequest:
      type: object
      required:
        - event_type
      properties:
        event_type:
          type: string
          enum:
            - answer_change
            - node_view
            - paused
            - resumed
            - navigated
            - flagged
          description: Type of interaction event
        question_id:
          type: string
          format: uuid
          description: >-
            Required for answer_change events; identifies the answer row to
            increment
        node_id:
          type: string
          description: >-
            Specific interactive node within the question (e.g. a drag-drop slot
            ID)
        payload:
          type: object
          additionalProperties: true
          description: >-
            Arbitrary event-specific data (e.g. { from, to } for navigated
            events)
    Envelope:
      type: object
      properties:
        data: {}
        error:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ErrorObject'
        meta:
          oneOf:
            - type: 'null'
            - type: object
    ErrorObject:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ErrorResponse:
      type: object
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ErrorObject'
        meta:
          type: 'null'
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        API key starting with `edp_live_`. Pass via `Authorization: Bearer
        edp_live_xxx`.


        Scopes: `read:assessments`, `write:assessments`, `read:results`,
        `write:submissions`.

````