Skip to documentation
Browse documentation
API & agents

Search & build a paper

A complete path from a topic to a question paper and mark scheme.

Discover the available filters

Read GET /questions/facets for course, board, module, topic and subtopic values. Use the returned IDs exactly; labels are for display. Choose the learner’s module before broadening a search.

shell
curl "https://api.wingmanmaths.com/v1/questions/facets" \
  -H "Authorization: Bearer $WINGMAN_API_KEY"

Save the selection

POST this shape to /papers, replacing the placeholders with a UUID and the returned pin objects. Keep pin fields unchanged: Wingman checks question content and scheme versions before saving.

Keep the response’s paper.id and paper.revision. Repeating the same creation ID and body returns the same paper. Reusing the ID with different content conflicts. PATCH /papers/{id} saves changes using the current revision.

json
{
  "id": "<new UUID; keep it for retries>",
  "title": "Complex numbers practice",
  "questions": ["<copy each chosen result’s full pin object here>"],
  "writingSpace": "smart",
  "gradeGuide": false
}

Prepare and download

Return both files to the learner. Do not expose your API key in links. A 409 means the exports are not ready or the revision cannot be exported; a 503 means the service is unavailable. Honour Retry-After on capacity errors.

  1. POST {} to /papers/{id}/revisions/{revision}/exports. Allow up to 120 seconds for preparation.
  2. GET /papers/{id}/revisions/{revision}/exports/question-paper with your key and save the PDF.
  3. GET /papers/{id}/revisions/{revision}/exports/mark-scheme with your key and save the matching PDF.