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

# Submit Assessment (Headless)

> Submits a full set of answers for server-side grading.
Creates a submission record and returns graded results synchronously.
Fires `submission.graded` webhook with `source: "api"`.




## OpenAPI

````yaml POST /assessments/{id}/submit
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:
  /assessments/{id}/submit:
    post:
      tags:
        - Assessments
      summary: Submit assessment for headless grading
      description: |
        Submits a full set of answers for server-side grading.
        Creates a submission record and returns graded results synchronously.
        Fires `submission.graded` webhook with `source: "api"`.
      operationId: submitAssessment
      parameters:
        - $ref: '#/components/parameters/AssessmentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
      responses:
        '201':
          description: Assessment graded
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/SubmitResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Maximum attempts exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
      security:
        - BearerAuth:
            - write:submissions
components:
  parameters:
    AssessmentId:
      name: id
      in: path
      required: true
      description: Assessment UUID
      schema:
        type: string
        format: uuid
  schemas:
    SubmitRequest:
      type: object
      required:
        - learner_ref
        - answers
      properties:
        learner_ref:
          type: string
        answers:
          $ref: '#/components/schemas/AssessmentAnswers'
        allow_draft:
          type: boolean
          default: false
        metadata:
          type: object
          additionalProperties: true
    Envelope:
      type: object
      properties:
        data: {}
        error:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ErrorObject'
        meta:
          oneOf:
            - type: 'null'
            - type: object
    SubmitResult:
      type: object
      properties:
        submission_id:
          type: string
          format: uuid
        score:
          type: number
        max_score:
          type: number
        percentage:
          type: number
        passed:
          type: boolean
        passing_score_percent:
          type: number
        attempt_number:
          type: integer
        exercise_results:
          type: array
          items:
            type: object
            properties:
              exercise_id:
                type: string
                format: uuid
              total_score:
                type: number
              max_score:
                type: number
              question_results:
                type: array
                items:
                  type: object
                  properties:
                    question_id:
                      type: string
                      format: uuid
                    score:
                      type: number
                    max_score:
                      type: number
                    correct:
                      type: boolean
                    points:
                      type: number
                    feedback:
                      type: object
                      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        data:
          type: 'null'
        error:
          $ref: '#/components/schemas/ErrorObject'
        meta:
          type: 'null'
    AssessmentAnswers:
      type: object
      required:
        - exerciseAnswers
      properties:
        exerciseAnswers:
          type: array
          items:
            type: object
            required:
              - exerciseId
              - questionAnswers
            properties:
              exerciseId:
                type: string
              questionAnswers:
                type: array
                items:
                  type: object
                  required:
                    - questionId
                    - answers
                  properties:
                    questionId:
                      type: string
                    answers:
                      type: array
                      items:
                        type: object
                        additionalProperties: true
    ErrorObject:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  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'
    UnprocessableEntity:
      description: Evaluation or processing failed
      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`.

````