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

# Get Certificate

> The learner's certificate for a course.

Auth: portal API key + X-Learner-Email header. 404 "Not enrolled in this
course" if the header learner has no enrollment.

Eligibility (all required, no partial credit): every one of the course's
N modules has module_progress.completed_at set (watched, any order) AND
the best attempt passed every module quiz that has a question pool AND,
when the course has a final-exam pool, the final was passed at the 70%
threshold. N is courses.total_modules when set, else the count of
per-module video assets; N == 0 is NEVER eligible (an empty course cannot
certify).

Issued -> 200 {serial, course_id, final_score, issued_at} (first read
under the learner READ plane; final_score is null if the course has no
final exam). Not issued -> compute eligibility live on the owner plane:
lazy-issue when met (idempotent, same path as the grade/progress hooks,
ON CONFLICT DO NOTHING so a race never double-issues), else 200
{eligible: false, missing: [...]} where missing is a subset of
["watched_modules", "module_quizzes", "final_exam"].



## OpenAPI

````yaml /openapi.yaml get /api/v1/learn/courses/{course_id}/certificate
openapi: 3.1.0
info:
  title: Mahara Platform
  description: >
    AI Sales Training Course Generator, a Coursera-style platform.


    ## Authentication


    Every request must carry your API key as a Bearer token:


    `Authorization: Bearer sk_live_your_key_here`


    ## Getting an API key


    API keys are provisioned by our team. They are not self-service, so there is
    no signup page to apply on. To request access, email **sales@myustadia.com**
    and we will issue a key for your account.
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/learn/courses/{course_id}/certificate:
    get:
      tags:
        - B2B Learn
      summary: Get Certificate
      description: >-
        The learner's certificate for a course.


        Auth: portal API key + X-Learner-Email header. 404 "Not enrolled in this

        course" if the header learner has no enrollment.


        Eligibility (all required, no partial credit): every one of the course's

        N modules has module_progress.completed_at set (watched, any order) AND

        the best attempt passed every module quiz that has a question pool AND,

        when the course has a final-exam pool, the final was passed at the 70%

        threshold. N is courses.total_modules when set, else the count of

        per-module video assets; N == 0 is NEVER eligible (an empty course
        cannot

        certify).


        Issued -> 200 {serial, course_id, final_score, issued_at} (first read

        under the learner READ plane; final_score is null if the course has no

        final exam). Not issued -> compute eligibility live on the owner plane:

        lazy-issue when met (idempotent, same path as the grade/progress hooks,

        ON CONFLICT DO NOTHING so a race never double-issues), else 200

        {eligible: false, missing: [...]} where missing is a subset of

        ["watched_modules", "module_quizzes", "final_exam"].
      operationId: get_certificate_api_v1_learn_courses__course_id__certificate_get
      parameters:
        - name: course_id
          in: path
          required: true
          schema:
            type: string
            title: Course Id
        - name: X-Learner-Email
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Learner-Email
        - name: X-Learner-Sig
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Learner-Sig
        - name: X-Learner-Sig-Ts
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Learner-Sig-Ts
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````