Yaqeen Developers
Public API & Model Context Protocol

Build with Yaqeen.

Bring published learning content, trusted citations and the AI tutor into your application—or connect them directly to an MCP client.

4 API operations4 MCP toolsVersion 1.0.0
Live · v1Public API tested. ChatGPT and Claude connected.
API base URLhttps://public-api.yaqeenguide.com/api/v1

Read published courses and approved canonical sources, or ask educational questions in English and Arabic. There are no public corpus-search, publishing, administration, course-generation or progress-writing endpoints.

01 · Authentication

An account, then an access token.

You need a Yaqeen account, not a Supabase dashboard account. A personal script can create an account and sign in through Supabase Auth without using Yaqeen's login form. There is no separate Yaqeen /login endpoint.

Supabase Auth project
https://okcctzpfpreziuxnyepk.supabase.co
Publishable key
sb_publishable_id9PIk1ukSPQmt1-KO2Cbg_b_aPXU0G

These connection values are public. They identify the project; they do not grant account access. Keep passwords, access tokens and refresh tokens private.

1. Create your account once

If you already have a Yaqeen account, skip to sign-in. Check your inbox and click the confirmation link before signing in. Email confirmation is required. You do not need to use the website’s signup form.

curl "https://okcctzpfpreziuxnyepk.supabase.co/auth/v1/signup" \
  -H "apikey: sb_publishable_id9PIk1ukSPQmt1-KO2Cbg_b_aPXU0G" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"YOUR_ACCOUNT_PASSWORD"}' 

2. Sign in to get your tokens

The response contains access_token, refresh_token and expires_in. Use only access_token for API requests. The publishable key identifies the Auth project; it is not your API access token.

curl "https://okcctzpfpreziuxnyepk.supabase.co/auth/v1/token?grant_type=password" \
  -H "apikey: sb_publishable_id9PIk1ukSPQmt1-KO2Cbg_b_aPXU0G" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"YOUR_ACCOUNT_PASSWORD"}' 

3. Refresh when the access token expires

Store both replacement tokens securely. If refresh fails, sign in again. The Supabase SDK can refresh automatically.

curl "https://okcctzpfpreziuxnyepk.supabase.co/auth/v1/token?grant_type=refresh_token" \
  -H "apikey: sb_publishable_id9PIk1ukSPQmt1-KO2Cbg_b_aPXU0G" \
  -H "Content-Type: application/json" \
  -d '{"refresh_token":"YOUR_CURRENT_REFRESH_TOKEN"}' 

Password login is for your own account or script. Partner apps should use a user-authorized sign-in flow instead of collecting users' passwords. Google sign-in also works through the interactive Supabase flow; use its Supabase access token, not a Google token. A Google-only account needs a configured password for password login.

API keys and machine credentials are not available in this release. Never use a Supabase secret/service-role key, refresh token or publishable key as the Yaqeen bearer token. Supabase Auth errors use Supabase's error format.

02 · Quick start

Make your first request.

Set YAQIN_ACCESS_TOKEN privately to the token returned by sign-in, then list published courses. Every API operation requires an active signed-in account.

curl "https://public-api.yaqeenguide.com/api/v1/courses?limit=25" \
  -H "Authorization: Bearer $YAQIN_ACCESS_TOKEN"

To test in Swagger, select Authorize, paste only your access_token (without the Bearer prefix), then choose an operation → Try it out → Execute.

Expect HTTP 200 and JSON containing items, total, offset and limit. Use a returned course ID to fetch its detail. External browser integrations need their exact origin approved for CORS.

03 · HTTP reference

Four operations. One contract.

Paths below are relative to the API base URL. Field types, defaults, required flags and constraints are generated from the actual OpenAPI contract.

GET/courses

List published courses

Bearer token required · JSON · HTTP 200 on success

curl "https://public-api.yaqeenguide.com/api/v1/courses?limit=25&offset=0" \
  -H "Authorization: Bearer $YAQIN_ACCESS_TOKEN"

Query parameters

FieldType & details
offsetoptionalinteger

Number of courses to skip. Pagination can shift when publication changes.

min: 0; default: 0
limitoptionalinteger

Maximum number of courses in this page.

min: 1; max: 100; default: 25
trackoptionalstring | null

Filter or contextualize by learning journey.

values: explore, first-steps, deepen
Response fields · CoursePage
FieldType & details
itemsrequiredCourseSummary[]

Published courses in this page, ordered by course ID.

totalrequiredinteger

Total matching courses, before pagination.

offsetrequiredinteger

Number of courses to skip. Pagination can shift when publication changes.

limitrequiredinteger

Maximum number of courses in this page.

Illustrative JSON response
{
  "items": [
    {
      "id": "example-course",
      "title": {
        "en": "Example course",
        "ar": "دورة نموذجية"
      },
      "summary": {
        "en": "Illustrative response.",
        "ar": "استجابة توضيحية."
      },
      "subject": "belief",
      "tracks": [
        "explore"
      ],
      "level": 1,
      "minutes": 4,
      "cover": null,
      "status": "published"
    }
  ],
  "total": 1,
  "offset": 0,
  "limit": 25
}
Full nested schemas & error responses ↗
GET/courses/{course_id}

Read a published course and its approved sources

Bearer token required · JSON · HTTP 200 on success

curl "https://public-api.yaqeenguide.com/api/v1/courses/YOUR_COURSE_ID" \
  -H "Authorization: Bearer $YAQIN_ACCESS_TOKEN"

Path parameters

FieldType & details
course_idrequiredstring

Course identifier. Course reads require a published course.

Response fields · PublicCourse
FieldType & details
idrequiredstring

titlerequiredBi

English/Arabic title.

summaryrequiredBi

English/Arabic summary.

subjectrequiredstring

tracksrequiredstring[]

Supported learning journeys.

levelrequiredinteger

Positive numeric learning level.

minutesrequiredinteger

Estimated reading time in minutes.

coveroptionalstring | null

statusrequiredstring

value: published
cardsrequiredCard[]

Course content cards. Preserve their order and source references.

explain_backoptionalExplain | null

Optional explain-back prompt and key ideas.

quizoptionalQuiz[] | null

Optional course quiz.

sources_by_idrequiredmap<string, PublicSource>

Approved citations keyed by source ID.

Illustrative JSON response
{
  "id": "example-course",
  "title": {
    "en": "Example course",
    "ar": "دورة نموذجية"
  },
  "summary": {
    "en": "Illustrative response.",
    "ar": "استجابة توضيحية."
  },
  "subject": "belief",
  "tracks": [
    "explore"
  ],
  "level": 1,
  "minutes": 4,
  "cover": null,
  "status": "published",
  "cards": [
    {
      "id": "example-card",
      "kind": "concept",
      "title": {
        "en": "Example card"
      },
      "body": {
        "en": "Illustrative content."
      },
      "sources": [
        "example-source"
      ]
    }
  ],
  "explain_back": null,
  "quiz": null,
  "sources_by_id": {
    "example-source": {
      "id": "example-source",
      "kind": "reference",
      "ref_en": "Example reference",
      "ref_ar": null,
      "text_en": "Canonical source wording appears here.",
      "text_ar": null,
      "translation": null,
      "translation_status_en": null,
      "origin": null,
      "url": null,
      "grading": null,
      "review_status": "approved",
      "eligibility": null
    }
  }
}
Full nested schemas & error responses ↗
GET/sources/{source_id}

Read an approved source

Bearer token required · JSON · HTTP 200 on success

curl "https://public-api.yaqeenguide.com/api/v1/sources/YOUR_SOURCE_ID" \
  -H "Authorization: Bearer $YAQIN_ACCESS_TOKEN"

Path parameters

FieldType & details
source_idrequiredstring

Approved canonical source identifier.

Response fields · PublicSource
FieldType & details
idrequiredstring

kindrequiredstring

ref_enoptionalstring | null

English source attribution.

ref_aroptionalstring | null

Arabic source attribution.

text_enoptionalstring | null

Stored English wording, if available.

text_aroptionalstring | null

Stored Arabic wording, if available.

translationoptionalstring | null

translation_status_enoptionalstring | null

English translation review status; do not invent a missing translation.

originoptionalstring | null

urloptionalstring | null

gradingoptionalstring | null

Source grading, when provided.

review_statusrequiredstring

Keep this visible. HTTP tutoring can include eligible unreviewed passages.

values: approved, unreviewed
eligibilityoptionalstring | null

Illustrative JSON response
{
  "id": "example-source",
  "kind": "reference",
  "ref_en": "Example reference",
  "ref_ar": null,
  "text_en": "Canonical source wording appears here.",
  "text_ar": null,
  "translation": null,
  "translation_status_en": null,
  "origin": null,
  "url": null,
  "grading": null,
  "review_status": "approved",
  "eligibility": null
}
Full nested schemas & error responses ↗
POST/tutor/ask

Ask the tutor and receive cited evidence

Bearer token required · JSON · HTTP 200 on success

curl "https://public-api.yaqeenguide.com/api/v1/tutor/ask" \
  -H "Authorization: Bearer $YAQIN_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"question":"What is wudu?","lang":"en"}'

JSON request body

FieldType & details
questionrequiredstring

The learner's question.

min characters: 1; max characters: 1500
langoptionalstring

Answer language: English or Arabic.

default: "en"; values: en, ar
course_idoptionalstring | null

Course identifier. Course reads require a published course.

card_idoptionalstring | null

Optional course-card context.

min characters: 1; max characters: 100
practiceoptionalboolean

Request temporary AI practice questions, or the returned questions. These are not approved course material.

default: false
practice_avoidoptionalstring[]

Previous practice prompts to avoid repeating.

max items: 1000; each item: max characters: 800
trackoptionalstring | null

Filter or contextualize by learning journey.

values: explore, first-steps, deepen
historyoptionalTurn[]

Previous user/assistant messages, in conversation order.

max items: 20

lesson_id is a legacy alias for course_id; send only one. Unknown top-level fields are rejected.

Response fields · TutorAnswer
FieldType & details
tierrequiredstring

Answer tier. Handle unknown values safely.

answerrequired(TextBlock | SourceBlock)[]

Ordered tutor answer blocks. Source-block IDs resolve in the sources map.

sourcesrequiredmap<string, PublicSource>

Citations keyed by source ID.

referraloptionalmap<string, string> | null

Optional referral rather than a direct answer.

follow_upsoptionalstring[]

Suggested follow-up questions.

ai_generatedrequiredboolean

Whether the response is AI-generated.

safety_outcomeoptionalstring | null

Refusal, referral or other safety result; HTTP 200 alone does not mean a direct answer.

practiceoptionalPracticeQuestion[] | null

Request temporary AI practice questions, or the returned questions. These are not approved course material.

practice_fallbackoptionalboolean

Whether practice used fallback behavior.

default: false
Illustrative JSON response
{
  "tier": "B",
  "answer": [
    {
      "type": "text",
      "text": "An illustrative tutor answer."
    },
    {
      "type": "source",
      "id": "example-source"
    }
  ],
  "sources": {
    "example-source": {
      "id": "example-source",
      "kind": "reference",
      "ref_en": "Example reference",
      "ref_ar": null,
      "text_en": "Canonical source wording appears here.",
      "text_ar": null,
      "translation": null,
      "translation_status_en": null,
      "origin": null,
      "url": null,
      "grading": null,
      "review_status": "approved",
      "eligibility": null
    }
  },
  "referral": null,
  "follow_ups": [],
  "ai_generated": true,
  "safety_outcome": null,
  "practice": null,
  "practice_fallback": false
}
Full nested schemas & error responses ↗

Preserve the evidence. Keep source attribution, grading, review/translation status and referrals visible. Do not invent missing translations. Drafts, archives and Coming soon courses are unavailable. Course detail may return 409 if its sources await approval; source reads return 404 without an approved canonical record.

Render tutor answer blocks in order, resolving source IDs through the response's sources map. Check tier, ai_generated and safety_outcome: HTTP 200 can contain a refusal or referral. Label AI answers and temporary practice exercises. HTTP tutoring may cite eligible unreviewed library passages that cannot be fetched through the canonical source endpoint; MCP tutoring uses approved sources only.

04 · MCP

The same capabilities, as tools.

Use a remote client that supports Streamable HTTP. All four tools are anonymous and rate-limited. No account, OAuth registration, callback, client secret or bearer token is needed.

MCP server URLhttps://public-api.yaqeenguide.com/api/v1/mcp/
  1. Add the server URL to your MCP client.Keep the final slash; hosted Claude's slashless form is also accepted.
  2. Select authentication: None.Recreate old OAuth connections without authentication.
  3. Select a tool.The client discovers all four tools. Start by listing published courses.
ToolArgumentsReturns
list_coursesoffset, limit, optional trackThe published course page
get_coursecourse_idCourse content and approved citations
get_sourcesource_idAn approved canonical source
ask_tutorrequest: the HTTP tutor input objectA cited tutor answer; spends model quota

Example MCP tools/call parameters · a course read

{"name":"list_courses","arguments":{"offset":0,"limit":3}}

Tool schemas come from tools/list. Results use structuredContent and content blocks. Check result.isError, even with HTTP 200. Quota/content failures include JSON text with error and numeric status; transport throttling returns HTTP 429 with Retry-After. Invalid arguments may return plain MCP error text.

No sign-in is required for MCP.Authorization headers are ignored. The tools expose published courses and approved sources; tutoring uses those sources in-process and has no account or private learner progress.

Guest limits use the viewer IP (IPv6 /64), with shared service caps. Users behind the same NAT or hosted connector share limits. Every MCP HTTP request counts, including initialization and tool listing. Check HTTP 429 and Retry-After, and result.isError for model quota failures. Quota-storage outages fail closed.

05 · Operations

Limits, errors and retries.

These are configurable defaults, not a pricing plan. Limits are shared across an account's tokens, clients and IP addresses, using fixed UTC minute/day windows.

AllowancePer accountAcross service
API requests / MCP HTTP requests per minute60500
Model operations / minute, shared with the app12500
Model token reservations / UTC day10,000,000100,000,000

Each tutor request reserves 200,000 model tokens as a conservative ceiling, not measured usage. Reads reserve no model tokens; failed operations are not refunded. Every MCP HTTP request counts. MCP per-account column values apply per guest IP (IPv6 /64); shared model limits also cover app/API activity. Default tutoring caps allow up to 50 guest calls/day and 500 shared calls/day. Maximum request body: 64 KiB.

HTTP statusWhat to do
400Correct invalid input. Unknown top-level tutor fields are rejected.
401Supply a valid token; refresh or sign in again.
403Account unavailable or access denied. Resolve access before retrying.
404Course/source unavailable.
409Course citations awaiting approval.
413Reduce the body below 64 KiB.
429Wait for the allowance or model budget to reset.
500 / 503Use bounded backoff for temporary server, auth, quota or model failures.
{"error":{"code":"rate_limited","message":"Public API request limit exceeded."}}

Check error.code instead of matching message text. For rate_limited, wait the HTTP Retry-After seconds. A quota_exceeded daily budget can remain exhausted until the next UTC day. Tutor calls have no idempotency key: retries can spend quota again. Responses use Cache-Control: no-store.

MCP transport can additionally return 421 for an untrusted host. HTTP API authentication errors use 401/403; MCP needs no authentication. Outages use 503. Keep credentials out of URLs, logs, source code and prompts.

06 · Contract & downloads

A guide to read. A schema to build with.

This HTML guide explains the integration. The schema reference covers every nested type and response. Swagger lets you authorize and execute requests. OpenAPI JSON is the machine-readable export for client generation and tools.

  • Patch · 1.0.1: compatible fixes and documentation corrections.
  • Minor · 1.1.0: optional additions. Tolerate new output fields and unknown free-form status/code strings.
  • Major · 2.0.0: incompatible changes use /api/v2 and /api/v2/mcp/, with a migration guide and announced retirement date.
Verification · 6 October 2026
  • All four Public API operations, normal password login and token refresh passed with a new learner account. Tutor output included resolvable citations.
  • Local anonymous MCP checks passed for initialization, all four tools, guest/shared request limits, model caps and forged-header rejection.
  • Anonymous production MCP needs a deployment smoke test. Historical OAuth checks no longer describe the current connection flow.

Closed enums and documented input limits stay compatible within a major version. Quota/policy changes are announced separately. No v1 retirement date is set. The MCP protocol version is negotiated separately from product contract 1.0.0. Client compatibility requires a real production connection test.