Docs/APIとWebhook/カスタムコース

カスタムコース

カスタムコースは、SecureCodingHubコンテンツカタログから抽出された、学習者向けの厳選されたトピックとシナリオのシーケンスです。一度作成されると、カスタムコースは組み込みトピックやカテゴリと同じように割り当てることができます。動詞に応じてcustom-courses:readまたはcustom-courses:writeが必要です。

エンドポイント

メソッドパススコープ目的
GET/custom-coursescustom-courses:read組織内のすべてのカスタムコースをリスト表示します。
GET/custom-courses/{'{'}id{'}'}custom-courses:read順序付けされたアイテム付きの単一カスタムコースを取得します。
POST/custom-coursescustom-courses:write新しいカスタムコースを作成します。
PATCH/custom-courses/{'{'}id{'}'}custom-courses:writeメタデータの更新やアイテムリストの置き換えを行います。
DELETE/custom-courses/{'{'}id{'}'}custom-courses:writeカスタムコースをソフト非アクティブ化します。

すべてのパスはhttps://api.limeplate.com/api/public/v1相対です。

アイテムモデル

すべてのカスタムコースには、itemsの順序付けされたリストが含まれます。各アイテムは、カタログからのトピックまたはシナリオへの参照です — 識別子についてはコンテンツカタログを参照してください。

フィールドタイプ意味
itemTypestring"topic" (sql-injectionのような練習トピック) または"scenario" (学習モードシナリオ) のいずれか。
itemIdstringトピックまたはシナリオのカタログID。
orderIndexinteger学習者UIでのゼロベースの表示順。値が小さいものが先に表示されます。

PATCHでは、アイテムをそのままにするにはitemsフィールドを省略し、上書きするには完全な置き換えリストを送信してください。部分的なアイテム更新はありません — 保存したい順序で全シーケンスを再送信してください。

カスタムコースをリスト表示

組織内のアクティブなカスタムコースごとに1エントリを、最近更新された順にソートして返します。

GET /api/public/v1/custom-courses
Authorization: Bearer scs_live_…

レスポンス

[
  {
    "id": "8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02",
    "name": "Backend Onboarding — Q2",
    "description": "Required reading for new backend hires.",
    "icon": "shield",
    "color": "#3b82f6",
    "itemCount": 6,
    "usageCount": 12,
    "createdByUserId": "1a2b3c4d-5e6f-7081-9203-4d5e6f708192",
    "createdByName": "Jane Smith",
    "createdAt": "2026-04-10T09:22:14Z",
    "updatedAt": "2026-05-18T15:01:47Z"
  }
]

curl -sS \
  -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/custom-courses

カスタムコースを取得

コースとその順序付けされたアイテムを展開して返します。resolvedTitleは、読み取り時点での基礎トピックまたはシナリオの人間が読めるタイトルです — 2回目のカタログ検索なしでレンダリングするのに便利です。

GET /api/public/v1/custom-courses/{customCourseId}
Authorization: Bearer scs_live_…

レスポンス

{
  "id": "8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02",
  "name": "Backend Onboarding — Q2",
  "description": "Required reading for new backend hires.",
  "icon": "shield",
  "color": "#3b82f6",
  "items": [
    {
      "id": "c1d2e3f4-5060-7081-9203-4d5e6f708192",
      "itemType": "topic",
      "itemId": "sql-injection",
      "resolvedTitle": "SQL Injection",
      "orderIndex": 0
    },
    {
      "id": "d2e3f405-6070-8192-0304-5e6f70819203",
      "itemType": "scenario",
      "itemId": "auth-bypass-walkthrough",
      "resolvedTitle": "Auth Bypass Walkthrough",
      "orderIndex": 1
    },
    {
      "id": "e3f40506-7081-9203-0405-6f7081920304",
      "itemType": "topic",
      "itemId": "xss",
      "resolvedTitle": "Cross-Site Scripting",
      "orderIndex": 2
    }
  ],
  "usageCount": 12,
  "createdByUserId": "1a2b3c4d-5e6f-7081-9203-4d5e6f708192",
  "createdByName": "Jane Smith",
  "createdAt": "2026-04-10T09:22:14Z",
  "updatedAt": "2026-05-18T15:01:47Z"
}

curl -sS \
  -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/custom-courses/8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02

カスタムコースを作成

コースを作成し、詳細ビューを返します。APIキーの組織が新しいコースを所有し、キーを発行したユーザーが作成者として記録されます。

POST /api/public/v1/custom-courses
Authorization: Bearer scs_live_…
Content-Type: application/json

リクエストボディ

{
  "name": "Backend Onboarding — Q2",
  "description": "Required reading for new backend hires.",
  "icon": "shield",
  "color": "#3b82f6",
  "items": [
    { "itemType": "topic",    "itemId": "sql-injection",          "orderIndex": 0 },
    { "itemType": "scenario", "itemId": "auth-bypass-walkthrough", "orderIndex": 1 },
    { "itemType": "topic",    "itemId": "xss",                    "orderIndex": 2 }
  ]
}

nameは必須で、組織内で一意でなければなりません。descriptioniconcolorは任意です — colorは任意のCSS hex文字列を受け取ります。itemsは作成時に空でも構いません。後でPATCH経由で入力できます。

レスポンス

カスタムコースを取得と同じ形状。

curl -sS -X POST \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Backend Onboarding — Q2",
    "description": "Required reading for new backend hires.",
    "icon": "shield",
    "color": "#3b82f6",
    "items": [
      { "itemType": "topic", "itemId": "sql-injection", "orderIndex": 0 },
      { "itemType": "topic", "itemId": "xss",           "orderIndex": 1 }
    ]
  }' \
  https://api.limeplate.com/api/public/v1/custom-courses

カスタムコースを更新

リクエスト上のすべてのフィールドは任意です。変更したいフィールドのみを渡してください。itemsを送信すると、アイテムリスト全体が置き換えられます — 並べ替えるには、新しいorderIndex値ですべてのアイテムを再送信してください。

PATCH /api/public/v1/custom-courses/{customCourseId}
Authorization: Bearer scs_live_…
Content-Type: application/json

リクエストボディ

{
  "name": "Backend Onboarding — Q3",
  "items": [
    { "itemType": "topic",    "itemId": "sql-injection", "orderIndex": 0 },
    { "itemType": "topic",    "itemId": "ssrf",          "orderIndex": 1 },
    { "itemType": "scenario", "itemId": "jwt-tampering", "orderIndex": 2 }
  ]
}

レスポンス

更新された詳細オブジェクト。

curl -sS -X PATCH \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Backend Onboarding — Q3" }' \
  https://api.limeplate.com/api/public/v1/custom-courses/8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02

カスタムコースを削除

コースをソフト非アクティブ化します。GET /custom-coursesと学習者UIに表示されなくなります。コースを参照していた既存の課題は引き続き履歴進捗を追跡しますが、新しい受領者には配信されません。

DELETE /api/public/v1/custom-courses/{customCourseId}
Authorization: Bearer scs_live_…

レスポンス

{ "message": "Custom course deactivated" }

curl -sS -X DELETE \
  -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/custom-courses/8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02

カスタムコースの割り当て

カスタムコースは、割り当てられるまで学習者に配信されません。targetType: "custom-course"targetIdをカスタムコースIDに設定して課題を使用してください:

curl -sS -X POST \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assigneeType": "user",
    "assigneeId": "1a2b3c4d-5e6f-7081-9203-4d5e6f708192",
    "contentArea": "practice",
    "targetType": "custom-course",
    "targetId": "8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02",
    "deadline": "2026-06-15T00:00:00Z",
    "isMandatory": true
  }' \
  https://api.limeplate.com/api/public/v1/assignments

学習者はorderIndex順でアイテムを見ます。練習トピックと学習シナリオはそれぞれの進捗エンドポイントで追跡されます — 進捗を参照してください。