Skip to main content
POST
/
source
/
generateFlashcards
/
{sourceId}
Generate Flashcards
curl --request POST \
  --url https://api.example.com/source/generateFlashcards/{sourceId} \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "userId": "<string>"
}
'

Description

This endpoint generates a set of flashcards based on a previously ingested learning source. By providing the sourceId of the ingested material, you can quickly create a flashcard set for study or review, tailored to the content of the source.

Example Request

curl -X POST \
  'https://b2b-api-backend-95487.ondigitalocean.app/source/generateFlashcards/{sourceId}' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'api-key: <your-api-key>' \
  -d '{
    "userId": "user-123"
  }'

Example Value (Response)

{
  "flashcard": {
    "flashcard_name": "Algebra Concepts",
    "flashcards": [
      {
        "term": "Variable",
        "definition": "A symbol that represents an unknown value in an equation"
      },
      {
        "term": "Coefficient",
        "definition": "A number that multiplies a variable"
      },
      {
        "term": "Quadratic Equation",
        "definition": "An equation of the form ax² + bx + c = 0 where a ≠ 0"
      }
    ],
    "flashcard_id": "65f4..."
  }
}

Response Fields

  • flashcard.flashcard_name: Name of the flashcard set
  • flashcard.flashcards: Array of flashcard items
    • term: The term or question
    • definition: The definition or answer
  • flashcard.flashcard_id: ID of the created flashcard set

Authentication

api-key
string
required
Your organisation’s API key

Path Parameters

sourceId
string
required
The ID of the source to generate flashcards from

Request Body

userId
string
required
User identifier

Endpoint Details

  • Method: POST
  • Path: /source/generateFlashcards/{sourceId}
  • Authentication: Required
  • Response Status: 200 OK

Request Parameters

  • Path:
    • sourceId: The ID of the source to generate flashcards from
  • Headers:
    • api-key: <your-api-key>
  • Body:
    {
      "userId": "user-123"
    }
    

Further Explanation

  • The response contains all flashcards generated from the source, ready for study or review.