Docs/APIとWebhook/課題

課題

課題は、トレーニングの一部 (カテゴリ、モジュール、トピック、コース、シナリオ) を、ユーザー、チーム、または組織全体に期限とともに紐づけます。同じレコードがSARIF自動割り当てフローも支えます。すべてのエンドポイントは/api/public/v1/assignments下にあります。

エンドポイント

メソッドパススコープ目的
GET/assignmentsassignments:read集約進捗付きで課題をリスト表示します。
GET/assignments/{'{'}id{'}'}assignments:readユーザーごとの進捗を含む単一課題。
POST/assignmentsassignments:write課題を作成します。assignment.createdを発火します。
PATCH/assignments/{'{'}id{'}'}assignments:write期限、必須フラグ、メモ、またはアクティブ状態を更新します。
DELETE/assignments/{'{'}id{'}'}assignments:write非アクティブ化します。進捗レコードは保持されます。

受領者とコンテンツの語彙

すべての課題はassigneeType + assigneeIdペア、およびcontentArea + targetType + targetIdトリプルを持ちます。有効な値は以下のとおりです:

フィールド有効値targetId / assigneeIdの意味
assigneeTypeuser, team, orguserteamの場合、assigneeIdは対応するUUIDです。orgの場合、IDはあなたの組織IDです。
contentAreapractice, learnpracticeは実践型チャレンジ、learnはコースとシナリオです。
practicetargetTypecategory, module, topic文字列スラッグ、例: webowasp-top-10sql-injection
learntargetTypecourse, scenario文字列スラッグ、例: owasp-top-10-2025phishing-call-2025
いずれの領域でもtargetTypecustom-courseカスタムコースのUUID (カスタムコースを参照)。コースのアイテムが、完了のために追跡される練習トピックや学習シナリオを決定します。

課題をリスト表示

アクティブと非アクティブを含む組織内のすべての課題を、非正規化された進捗集計とともに返します。

GET /api/public/v1/assignments
Authorization: Bearer scs_live_…

レスポンス

[
  {
    "id": "d7c8a1b2-3e45-4f67-89ab-cd0123456789",
    "contentArea": "practice",
    "assigneeType": "team",
    "assigneeId": "4f8d3e2a-71cb-4d09-9ad7-5b8c7e1f0a32",
    "assigneeName": "Payments",
    "targetType": "topic",
    "targetId": "sql-injection",
    "targetTitle": "SQL Injection",
    "deadline": "2026-06-12T23:59:59Z",
    "isMandatory": true,
    "isActive": true,
    "isOverdue": false,
    "avgProgress": 42.5,
    "totalAssignees": 12,
    "completedAssignees": 3,
    "createdAt": "2026-05-29T08:00:00Z"
  }
]

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

課題を取得

リストエントリと同じフィールドに加え、割り当て者の表示名、オプションのメモ、コンプライアンスレポートに適したユーザーごとの進捗配列を返します。

GET /api/public/v1/assignments/{assignmentId}
Authorization: Bearer scs_live_…

レスポンス

{
  "id": "d7c8a1b2-3e45-4f67-89ab-cd0123456789",
  "contentArea": "practice",
  "assigneeType": "team",
  "assigneeId": "4f8d3e2a-71cb-4d09-9ad7-5b8c7e1f0a32",
  "assigneeName": "Payments",
  "targetType": "topic",
  "targetId": "sql-injection",
  "targetTitle": "SQL Injection",
  "deadline": "2026-06-12T23:59:59Z",
  "isMandatory": true,
  "isActive": true,
  "isOverdue": false,
  "note": "Follow-up to the May audit finding.",
  "assignedByName": "API Key: CI Ingestion",
  "avgProgress": 42.5,
  "totalAssignees": 12,
  "completedAssignees": 3,
  "createdAt": "2026-05-29T08:00:00Z",
  "userProgress": [
    {
      "userId": "b1a4d7c2-9e58-4f3a-83cd-2c6f1a90e7b4",
      "name": "Jane Smith",
      "email": "jane.smith@acme.com",
      "totalChallenges": 8,
      "completedChallenges": 8,
      "progressPercent": 100,
      "completedAt": "2026-06-04T10:18:42Z",
      "isOverdue": false
    }
  ]
}

curl -sS -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/assignments/d7c8a1b2-3e45-4f67-89ab-cd0123456789

課題を作成

課題を作成し、assignment.createdを発火します。受領者がチームまたは組織の場合、ユーザーごとの進捗行が作成時にすべてのメンバーに対して具現化されるため、GET /assignments/{id}のレスポンスは即座に完全になります。

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

リクエストボディ

フィールドタイプ必須意味
assigneeTypestringはいuserteam、またはorg
assigneeIduuidはいタイプに応じてユーザーID、チームID、または組織ID。
contentAreastringはいpractice または learn
targetTypestringはい上記の語彙表を参照してください。
targetIdstringはいカテゴリ、モジュール、トピック、コース、またはシナリオのスラッグまたはID。
deadlineISO 8601はいUTCでの期日と時刻。
isMandatoryboolいいえデフォルトはtrue。必須でない課題はコンプライアンスレポートをブロックしません。
notestringいいえダッシュボードで受領者に表示される自由テキスト。

レスポンス

{
  "id": "d7c8a1b2-3e45-4f67-89ab-cd0123456789",
  "contentArea": "practice",
  "assigneeType": "team",
  "assigneeId": "4f8d3e2a-71cb-4d09-9ad7-5b8c7e1f0a32",
  "assigneeName": "Payments",
  "targetType": "topic",
  "targetId": "sql-injection",
  "targetTitle": "SQL Injection",
  "deadline": "2026-06-12T23:59:59Z",
  "isMandatory": true,
  "isActive": true,
  "isOverdue": false,
  "avgProgress": 0,
  "totalAssignees": 12,
  "completedAssignees": 0,
  "createdAt": "2026-05-29T08:00:00Z"
}

curl -sS -X POST \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assigneeType": "team",
    "assigneeId": "4f8d3e2a-71cb-4d09-9ad7-5b8c7e1f0a32",
    "contentArea": "practice",
    "targetType": "topic",
    "targetId": "sql-injection",
    "deadline": "2026-06-12T23:59:59Z",
    "isMandatory": true,
    "note": "Follow-up to the May audit finding."
  }' \
  https://api.limeplate.com/api/public/v1/assignments

課題を更新

deadlineisMandatorynoteisActiveの任意のサブセットを送信できます。省略されたフィールドはそのまま残ります。DELETEの非破壊的等価物としてisActive: falseを使用してください。

PATCH /api/public/v1/assignments/{assignmentId}
Authorization: Bearer scs_live_…
Content-Type: application/json

リクエストボディ

フィールドタイプ意味
deadlineISO 8601新しい期日。
isMandatorybool必須フラグを切り替えます。
notestringメモを置き換えます。クリアするには空文字列を送信してください。
isActivebool進捗に影響を与えずにアクティブ化または非アクティブ化します。

レスポンス

{
  "message": "Assignment updated"
}

curl -sS -X PATCH \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "deadline": "2026-06-26T23:59:59Z",
    "note": "Extended after sprint planning."
  }' \
  https://api.limeplate.com/api/public/v1/assignments/d7c8a1b2-3e45-4f67-89ab-cd0123456789

課題を非アクティブ化

isActivefalseに設定します。課題は受領者の「マイ課題」ビューに表示されなくなり、コンプライアンスメトリクスへの寄与を停止しますが、過去の進捗レコードは保持され、過去期間のレポートが引き続き解決されます。

DELETE /api/public/v1/assignments/{assignmentId}
Authorization: Bearer scs_live_…

レスポンス

{
  "message": "Assignment deactivated"
}

curl -sS -X DELETE \
  -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/assignments/d7c8a1b2-3e45-4f67-89ab-cd0123456789

Webhookイベント

POST /assignments経由で課題を作成すると、assignment.createdが一度発火します。単一の受領者が基礎ターゲットで100%進捗に達すると、そのユーザーに対してassignment.completedが発火します — チームと組織の課題の場合、これは100%に達するメンバーごとに1イベントを意味し、課題全体に対して1イベントではありません。両方のイベントには課題IDと受領者アイデンティティが含まれます。/docs/api/webhooks経由で購読し、署名を検証してください。