Skip to main content
POST
/
v1
/
activities
Create an activity
curl --request POST \
  --url https://api.example.com/v1/activities \
  --header 'Content-Type: application/json' \
  --data '
{
  "lesson_id": "<string>",
  "type": {},
  "variant": "<string>",
  "prompt": "<string>",
  "difficulty": {},
  "count": 123,
  "questions": [
    {}
  ]
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.hawkings.education/llms.txt

Use this file to discover all available pages before exploring further.

Body

lesson_id
string
required
type
enum
required
See The Activity object for the full enum.
variant
string
Required for type: "quiz".
prompt
string
Free-text instruction. Defaults to a sensible derivation from the lesson context.
difficulty
enum
easy | intermediate | hard.
count
integer
For quiz-like activities, number of questions to generate.
questions
Question[]
Pass explicit questions to skip AI generation.

Examples

// AI-generated 5-item true/false quiz
await hk.activities.create({
  lesson_id: "lsn_123",
  type: "quiz",
  variant: "true_false",
  count: 5,
  difficulty: "intermediate",
});

// Hand-authored short-answer
await hk.activities.create({
  lesson_id: "lsn_123",
  type: "short_answer",
  questions: [{ prompt: "Define proper time in three sentences." }],
});

// Generate a 5-min audio recap
await hk.activities.create({
  lesson_id: "lsn_123",
  type: "podcast",
});

Returns

An Activity in ai_status: "pending" unless you passed questions explicitly.