{
  "openapi": "3.1.0",
  "info": {
    "title": "Kelase Edukonten API",
    "version": "1.0.0-draft.2",
    "description": "Menemukan, melihat, dan (fase berikutnya) membuka konten Edukonten dari sistem partner mana pun. Lingkungan: production. Semua waktu UTC ISO 8601. Setiap respons memuat request_id (header X-Request-Id). Alamat API adalah path /partner-api pada host situs; tidak ada subdomain terpisah."
  },
  "servers": [
    {
      "url": "https://{host}/partner-api",
      "description": "Host situs deployment Edukonten (production atau sandbox)",
      "variables": {
        "host": {
          "default": "edukonten.example",
          "description": "Host situs; sandbox memakai host situs deployment sandbox."
        }
      }
    }
  ],
  "paths": {
    "/oauth/token": {
      "post": {
        "operationId": "issueToken",
        "summary": "Ambil access token (client credentials)",
        "description": "Autentikasi HTTP Basic dengan client_id dan client_secret. Token berlaku 15 menit, tanpa refresh token. Backend partner meminta token baru bila habis; secret tidak boleh ada di browser, APK, atau EXE.",
        "security": [
          {
            "basic": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "const": "client_credentials"
                  },
                  "scope": {
                    "description": "Daftar scope dipisah spasi; tidak boleh di luar scope client.",
                    "type": "string"
                  }
                },
                "required": [
                  "grant_type"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string",
                      "const": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "scope": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "access_token",
                    "token_type",
                    "expires_in",
                    "scope"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Identitas client dan scope token",
        "x-required-scope": null,
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "client_id": {
                          "type": "string"
                        },
                        "partner_id": {
                          "type": "string"
                        },
                        "partner_name": {
                          "type": "string"
                        },
                        "environment": {
                          "type": "string",
                          "enum": [
                            "sandbox",
                            "production"
                          ]
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "client_id",
                        "partner_id",
                        "partner_name",
                        "environment",
                        "scopes",
                        "channels"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contents": {
      "get": {
        "operationId": "listContents",
        "summary": "Daftar konten untuk satu sekolah",
        "description": "Hanya konten terbit. Default licensed_only=true. Status akses bersifat indikatif dan tidak menggantikan otorisasi launch.",
        "x-required-scope": "contents:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "external_school_id",
            "in": "query",
            "required": true,
            "description": "ID sekolah di sistem partner (dipetakan oleh Kelase).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "education_level",
            "in": "query",
            "required": false,
            "description": "Jenjang, mis. SD.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "grade",
            "in": "query",
            "required": false,
            "description": "Kelas.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "description": "Mata pelajaran.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "Topik.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "curriculum",
            "in": "query",
            "required": false,
            "description": "Kurikulum.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "description": "Jenis konten.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          },
          {
            "name": "interaction_mode",
            "in": "query",
            "required": false,
            "description": "Mode interaksi, mis. whole_class.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Bahasa, mis. id-ID.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            }
          },
          {
            "name": "device_support",
            "in": "query",
            "required": false,
            "description": "Dukungan perangkat.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "offline_support",
            "in": "query",
            "required": false,
            "description": "Hanya yang dinyatakan mendukung (true) atau tidak (false) offline. Konten tanpa pernyataan tidak cocok.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Hanya versi aktif yang dibuat pada atau setelah waktu ini (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            }
          },
          {
            "name": "licensed_only",
            "in": "query",
            "required": false,
            "description": "Hanya konten yang tersedia untuk sekolah (default true). false menyertakan konten terkunci bila kebijakan client mengizinkan.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "title, -title, updated, -updated, atau relevance (khusus pencarian).",
            "schema": {
              "type": "string",
              "enum": [
                "title",
                "-title",
                "updated",
                "-updated",
                "relevance"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Nomor halaman mulai 1.",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,6}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Jumlah per halaman 1–100 (default 20).",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,6}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "description": "ID opaque konten.",
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "summary": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "content_type": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "education_levels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "grades": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subjects": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "thumbnail_url": {
                            "description": "Belum tersedia (null). URL publik thumbnail menyusul.",
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "version": {
                            "type": "string"
                          },
                          "interaction_modes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "access_status": {
                            "description": "Indikatif. Hak memutar hanya ditentukan saat launch.",
                            "type": "string",
                            "enum": [
                              "available",
                              "locked"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "summary",
                          "content_type",
                          "education_levels",
                          "grades",
                          "subjects",
                          "thumbnail_url",
                          "version",
                          "interaction_modes",
                          "updated_at",
                          "access_status"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "limit": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "total": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contents/search": {
      "get": {
        "operationId": "searchContents",
        "summary": "Cari konten",
        "description": "Pencarian tanpa membedakan huruf pada judul, tag, topik, mata pelajaran, dan deskripsi; semua kata harus cocok. Urutan bawaan: relevansi.",
        "x-required-scope": "contents:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "external_school_id",
            "in": "query",
            "required": true,
            "description": "ID sekolah di sistem partner (dipetakan oleh Kelase).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "education_level",
            "in": "query",
            "required": false,
            "description": "Jenjang, mis. SD.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "grade",
            "in": "query",
            "required": false,
            "description": "Kelas.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "description": "Mata pelajaran.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "Topik.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "curriculum",
            "in": "query",
            "required": false,
            "description": "Kurikulum.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          },
          {
            "name": "content_type",
            "in": "query",
            "required": false,
            "description": "Jenis konten.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          },
          {
            "name": "interaction_mode",
            "in": "query",
            "required": false,
            "description": "Mode interaksi, mis. whole_class.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Bahasa, mis. id-ID.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20
            }
          },
          {
            "name": "device_support",
            "in": "query",
            "required": false,
            "description": "Dukungan perangkat.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "offline_support",
            "in": "query",
            "required": false,
            "description": "Hanya yang dinyatakan mendukung (true) atau tidak (false) offline. Konten tanpa pernyataan tidak cocok.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Hanya versi aktif yang dibuat pada atau setelah waktu ini (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            }
          },
          {
            "name": "licensed_only",
            "in": "query",
            "required": false,
            "description": "Hanya konten yang tersedia untuk sekolah (default true). false menyertakan konten terkunci bila kebijakan client mengizinkan.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "title, -title, updated, -updated, atau relevance (khusus pencarian).",
            "schema": {
              "type": "string",
              "enum": [
                "title",
                "-title",
                "updated",
                "-updated",
                "relevance"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Nomor halaman mulai 1.",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,6}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Jumlah per halaman 1–100 (default 20).",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,6}$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Kata kunci: judul, tag, topik, deskripsi (semua kata harus cocok).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "description": "ID opaque konten.",
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "summary": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "content_type": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "education_levels": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "grades": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subjects": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "thumbnail_url": {
                            "description": "Belum tersedia (null). URL publik thumbnail menyusul.",
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "version": {
                            "type": "string"
                          },
                          "interaction_modes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "access_status": {
                            "description": "Indikatif. Hak memutar hanya ditentukan saat launch.",
                            "type": "string",
                            "enum": [
                              "available",
                              "locked"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "summary",
                          "content_type",
                          "education_levels",
                          "grades",
                          "subjects",
                          "thumbnail_url",
                          "version",
                          "interaction_modes",
                          "updated_at",
                          "access_status"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "limit": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "total": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "pagination",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contents/{id}": {
      "get": {
        "operationId": "getContent",
        "summary": "Detail konten",
        "description": "Tidak memuat URL aset privat atau URL launch permanen. Gunakan endpoint launch untuk membuka konten.",
        "x-required-scope": "contents:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "external_school_id",
            "in": "query",
            "required": true,
            "description": "ID sekolah di sistem partner (dipetakan oleh Kelase).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "learning_objectives": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "education": {
                          "type": "object",
                          "properties": {
                            "levels": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "grades": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "subjects": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "topics": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "curriculum": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "levels",
                            "grades",
                            "subjects",
                            "topics",
                            "curriculum"
                          ],
                          "additionalProperties": false
                        },
                        "content_type": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "version": {
                          "type": "string"
                        },
                        "language": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "estimated_minutes": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "interaction_modes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "device_support": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "offline_support": {
                          "anyOf": [
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "capabilities": {
                          "description": "null = tidak diketahui; tidak pernah dilaporkan true tanpa pernyataan.",
                          "type": "object",
                          "properties": {
                            "touch": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "multitouch": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "fullscreen": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "audio": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "webgl": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "touch",
                            "multitouch",
                            "fullscreen",
                            "audio",
                            "webgl"
                          ],
                          "additionalProperties": false
                        },
                        "embedding": {
                          "type": "object",
                          "properties": {
                            "iframe": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "android_webview": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "windows_webview2": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "browser": {
                              "anyOf": [
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "iframe",
                            "android_webview",
                            "windows_webview2",
                            "browser"
                          ],
                          "additionalProperties": false
                        },
                        "access": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "available",
                                "locked"
                              ]
                            },
                            "license_required": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "status",
                            "license_required"
                          ],
                          "additionalProperties": false
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "title",
                        "description",
                        "learning_objectives",
                        "education",
                        "content_type",
                        "version",
                        "language",
                        "estimated_minutes",
                        "interaction_modes",
                        "device_support",
                        "offline_support",
                        "capabilities",
                        "embedding",
                        "access",
                        "updated_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/entitlements/check": {
      "post": {
        "operationId": "checkEntitlement",
        "summary": "Periksa hak akses (informasi sementara)",
        "description": "Tidak menerbitkan hak playback; launch memeriksa ulang. Konten tidak ditemukan atau tidak boleh dilihat sekolah: 404. Jalur lisensi perangkat butuh device_id dan device_proof (sekali pakai). Penolakan lisensi berstatus 200 dengan entitled=false dan reason.",
        "x-required-scope": "entitlements:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "external_school_id": {
                    "description": "ID sekolah di sistem partner.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "content_id": {
                    "description": "ID konten (edc_...).",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "role": {
                    "description": "Role pengguna menurut assertion partner.",
                    "type": "string",
                    "enum": [
                      "teacher",
                      "student"
                    ]
                  },
                  "interaction_mode": {
                    "description": "whole_class (satu layar kelas) atau individual (tiap perangkat siswa).",
                    "type": "string",
                    "enum": [
                      "whole_class",
                      "individual"
                    ]
                  },
                  "channel": {
                    "description": "Kanal integrasi yang akan dipakai; harus diizinkan untuk client.",
                    "type": "string",
                    "enum": [
                      "web_iframe",
                      "web_top_level",
                      "android_webview",
                      "windows_webview2",
                      "ios_wkwebview",
                      "electron"
                    ]
                  },
                  "device_id": {
                    "description": "ID perangkat terdaftar (dev_...).",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "device_proof": {
                    "description": "Bukti kepemilikan perangkat; sekali pakai.",
                    "type": "object",
                    "properties": {
                      "challenge_id": {
                        "description": "challenge_id dari /v1/devices/{id}/challenge.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "nonce": {
                        "description": "nonce dari challenge.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "signature": {
                        "description": "Tanda tangan ECDSA P-256 SHA-256 (IEEE P1363, base64url) atas pesan kanonik edukonten-device-proof-v1.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "challenge_id",
                      "nonce",
                      "signature"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "external_school_id",
                  "content_id",
                  "role",
                  "interaction_mode",
                  "channel"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "entitled": {
                          "type": "boolean"
                        },
                        "license_type": {
                          "description": "NONE = konten tidak memerlukan lisensi.",
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "SCHOOL",
                                "DEVICE",
                                "HYBRID",
                                "NONE"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "valid_until": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reason": {
                          "description": "Alasan penolakan; null bila entitled.",
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "policy_version": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "entitled",
                        "license_type",
                        "valid_until",
                        "reason",
                        "policy_version"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/register": {
      "post": {
        "operationId": "registerDevice",
        "summary": "Daftarkan perangkat",
        "description": "Memakai kode aktivasi sekali pakai milik sekolah. Pendaftaran ulang instalasi yang sama dengan kunci yang sama idempoten (200) dan tidak mengambil slot. Kunci privat tidak pernah dikirim.",
        "x-required-scope": "devices:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "external_school_id": {
                    "description": "ID sekolah di sistem partner.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "installation_id": {
                    "description": "ID instalasi acak yang dibuat perangkat (8–120 karakter ASCII).",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "activation_code": {
                    "description": "Kode aktivasi sekali pakai dari admin.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "public_key": {
                    "description": "Kunci publik ECDSA P-256, SPKI base64. Kunci privat tidak pernah dikirim.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "platform": {
                    "description": "mis. windows, android.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                  },
                  "device_type": {
                    "description": "mis. interactive_whiteboard.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  }
                },
                "required": [
                  "external_school_id",
                  "installation_id",
                  "activation_code",
                  "public_key",
                  "platform",
                  "device_type"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "device_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "revoked"
                          ]
                        },
                        "external_school_id": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "device_type": {
                          "type": "string"
                        },
                        "registered_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "revoked_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_seen_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "device_id",
                        "status",
                        "external_school_id",
                        "platform",
                        "device_type",
                        "registered_at",
                        "revoked_at",
                        "last_seen_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "Dibuat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "device_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "revoked"
                          ]
                        },
                        "external_school_id": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "device_type": {
                          "type": "string"
                        },
                        "registered_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "revoked_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_seen_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "device_id",
                        "status",
                        "external_school_id",
                        "platform",
                        "device_type",
                        "registered_at",
                        "revoked_at",
                        "last_seen_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Error 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/{id}/challenge": {
      "post": {
        "operationId": "createDeviceChallenge",
        "summary": "Minta challenge bukti perangkat",
        "description": "Challenge berlaku 120 detik, terikat ke konteks (sekolah, konten, role, mode) dan sekali pakai. Pesan yang ditandatangani: edukonten-device-proof-v1, challenge_id, nonce, audience, device_id, expires_at (Unix ms), context_hash, dipisah baris baru.",
        "x-required-scope": "devices:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "external_school_id": {
                    "description": "ID sekolah di sistem partner.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "content_id": {
                    "description": "ID konten (edc_...).",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "role": {
                    "description": "Role pengguna menurut assertion partner.",
                    "type": "string",
                    "enum": [
                      "teacher",
                      "student"
                    ]
                  },
                  "interaction_mode": {
                    "description": "whole_class (satu layar kelas) atau individual (tiap perangkat siswa).",
                    "type": "string",
                    "enum": [
                      "whole_class",
                      "individual"
                    ]
                  }
                },
                "required": [
                  "external_school_id",
                  "content_id",
                  "role",
                  "interaction_mode"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Dibuat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "challenge_id": {
                          "type": "string"
                        },
                        "nonce": {
                          "type": "string"
                        },
                        "audience": {
                          "type": "string"
                        },
                        "device_id": {
                          "type": "string"
                        },
                        "expires_at": {
                          "description": "Pesan yang ditandatangani memakai Unix ms dari waktu ini.",
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "context_hash": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "challenge_id",
                        "nonce",
                        "audience",
                        "device_id",
                        "expires_at",
                        "context_hash"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contents/{id}/launch": {
      "post": {
        "operationId": "launchContent",
        "summary": "Buka konten (menerbitkan tiket launch)",
        "description": "Header Idempotency-Key wajib. Menerbitkan sesi dan tiket sekali pakai (berlaku 120 detik) di fragment launch_url. Pengulangan dengan key dan payload yang sama mengembalikan tiket yang sama selama belum ditebus; sesudah itu 409 TICKET_ALREADY_USED, dan partner meminta launch baru dengan key baru. Penolakan lisensi: 403 dengan error.reason. Kuota sesi paket: 409 SESSION_LIMIT_REACHED.",
        "x-required-scope": "contents:launch",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "external_school_id": {
                    "description": "ID sekolah di sistem partner.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "external_user_id": {
                    "description": "ID pengguna di sistem partner (assertion partner). Disimpan hanya sebagai pseudonim.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "role": {
                    "description": "Role pengguna menurut assertion partner.",
                    "type": "string",
                    "enum": [
                      "teacher",
                      "student"
                    ]
                  },
                  "device_id": {
                    "description": "ID perangkat terdaftar (dev_...).",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "device_proof": {
                    "description": "Bukti kepemilikan perangkat; sekali pakai.",
                    "type": "object",
                    "properties": {
                      "challenge_id": {
                        "description": "challenge_id dari /v1/devices/{id}/challenge.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "nonce": {
                        "description": "nonce dari challenge.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "signature": {
                        "description": "Tanda tangan ECDSA P-256 SHA-256 (IEEE P1363, base64url) atas pesan kanonik edukonten-device-proof-v1.",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "challenge_id",
                      "nonce",
                      "signature"
                    ],
                    "additionalProperties": false
                  },
                  "context": {
                    "description": "Konteks pemutaran.",
                    "type": "object",
                    "properties": {
                      "interaction_mode": {
                        "type": "string",
                        "enum": [
                          "whole_class",
                          "individual"
                        ]
                      },
                      "external_class_id": {
                        "anyOf": [
                          {
                            "description": "ID kelas di sistem partner.",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "external_assignment_id": {
                        "anyOf": [
                          {
                            "description": "ID penugasan di sistem partner.",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "interaction_mode"
                    ],
                    "additionalProperties": false
                  },
                  "display": {
                    "description": "Cara konten ditampilkan.",
                    "type": "object",
                    "properties": {
                      "mode": {
                        "description": "Kanal integrasi; harus diizinkan untuk client.",
                        "type": "string",
                        "enum": [
                          "web_iframe",
                          "web_top_level",
                          "android_webview",
                          "windows_webview2",
                          "ios_wkwebview",
                          "electron"
                        ]
                      },
                      "parent_origin": {
                        "description": "Origin halaman induk (tepat: skema, host, port) untuk web_iframe dan terdaftar di mitra. null untuk kanal lain.",
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 200
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "mode",
                      "parent_origin"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "external_school_id",
                  "external_user_id",
                  "role",
                  "context",
                  "display"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "session_id": {
                          "type": "string"
                        },
                        "launch_url": {
                          "description": "URL player dengan tiket sekali pakai di fragment. Berlaku sebentar; jangan disimpan sebagai tautan tugas.",
                          "type": "string"
                        },
                        "ticket_expires_in": {
                          "description": "Detik.",
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "session_expires_at": {
                          "description": "Batas mutlak terjauh sesi; tidak melewati akhir lisensi.",
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "display": {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "enum": [
                                "web_iframe",
                                "web_top_level",
                                "android_webview",
                                "windows_webview2",
                                "ios_wkwebview",
                                "electron"
                              ]
                            },
                            "allow_fullscreen": {
                              "type": "boolean"
                            },
                            "handoff_nonce": {
                              "description": "Hanya web_iframe: dikirim host ke player lewat postMessage (edukonten.handoff) untuk membuktikan origin induk.",
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "allow_fullscreen",
                            "handoff_nonce"
                          ],
                          "additionalProperties": false
                        },
                        "content_version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "session_id",
                        "launch_url",
                        "ticket_expires_in",
                        "session_expires_at",
                        "display",
                        "content_version"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "Dibuat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "session_id": {
                          "type": "string"
                        },
                        "launch_url": {
                          "description": "URL player dengan tiket sekali pakai di fragment. Berlaku sebentar; jangan disimpan sebagai tautan tugas.",
                          "type": "string"
                        },
                        "ticket_expires_in": {
                          "description": "Detik.",
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "session_expires_at": {
                          "description": "Batas mutlak terjauh sesi; tidak melewati akhir lisensi.",
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "display": {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "type": "string",
                              "enum": [
                                "web_iframe",
                                "web_top_level",
                                "android_webview",
                                "windows_webview2",
                                "ios_wkwebview",
                                "electron"
                              ]
                            },
                            "allow_fullscreen": {
                              "type": "boolean"
                            },
                            "handoff_nonce": {
                              "description": "Hanya web_iframe: dikirim host ke player lewat postMessage (edukonten.handoff) untuk membuktikan origin induk.",
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "mode",
                            "allow_fullscreen",
                            "handoff_nonce"
                          ],
                          "additionalProperties": false
                        },
                        "content_version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "session_id",
                        "launch_url",
                        "ticket_expires_in",
                        "session_expires_at",
                        "display",
                        "content_version"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Error 403",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Error 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Error 410",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Error 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/content-events": {
      "post": {
        "operationId": "recordContentEvent",
        "summary": "Catat event penggunaan",
        "description": "Partner, sekolah, perangkat, dan konten diturunkan dari sesi (bukan dari badan). Sesi harus sudah dimulai (tiket ditebus). Event adalah telemetri dan tidak memberi hak akses. Mark bersifat monoton: opened dan read hanya sekali per sesi. Header Idempotency-Key bila ada harus sama dengan event_id.",
        "x-required-scope": "events:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "description": "ID event unik per partner (1–128: huruf, angka, . _ : -). Pengulangan identik adalah duplikat; isi berbeda: 409.",
                    "type": "string",
                    "pattern": "^[A-Za-z0-9._:-]{1,128}$"
                  },
                  "event_type": {
                    "description": "content.read = tanda baca eksplisit; bukan bukti penguasaan, penyelesaian, atau nilai.",
                    "type": "string",
                    "enum": [
                      "content.opened",
                      "content.read",
                      "content.closed"
                    ]
                  },
                  "session_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "content_id": {
                    "description": "Harus sama dengan konten sesi.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "occurred_at": {
                    "description": "Waktu kejadian (UTC). Tidak di masa depan, tidak sebelum sesi dimulai, dan paling lambat 24 jam setelah sesi berakhir.",
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                  },
                  "metadata": {
                    "description": "Objek datar, maks. 10 kunci dan 1 KB.",
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "event_id",
                  "event_type",
                  "session_id",
                  "content_id",
                  "occurred_at"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "event_id": {
                          "type": "string"
                        },
                        "accepted": {
                          "type": "boolean"
                        },
                        "duplicate": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "event_id",
                        "accepted",
                        "duplicate"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "Dibuat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "event_id": {
                          "type": "string"
                        },
                        "accepted": {
                          "type": "boolean"
                        },
                        "duplicate": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "event_id",
                        "accepted",
                        "duplicate"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Error 400",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Error 409",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Error 422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions/{id}/marks": {
      "get": {
        "operationId": "getSessionMarks",
        "summary": "Status mark sesi",
        "description": "opened_at dan read_at (nullable). Sesi tenant lain: 404.",
        "x-required-scope": "events:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "session_id": {
                          "type": "string"
                        },
                        "opened_at": {
                          "description": "Pertama kali runtime utama siap tampil. Tidak pernah di-reset.",
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "read_at": {
                          "description": "Pertama kali ditandai dibaca secara eksplisit. Bukan penyelesaian.",
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "session_id",
                        "opened_at",
                        "read_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions/{id}/close": {
      "post": {
        "operationId": "closeSession",
        "summary": "Tutup sesi",
        "description": "Idempoten. Sesi milik tenant lain: 404.",
        "x-required-scope": "sessions:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "session_id": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "issued",
                            "active",
                            "closed",
                            "expired",
                            "revoked"
                          ]
                        },
                        "closed_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "session_id",
                        "state",
                        "closed_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/{id}": {
      "get": {
        "operationId": "getDevice",
        "summary": "Status perangkat",
        "x-required-scope": "devices:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "device_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "revoked"
                          ]
                        },
                        "external_school_id": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "device_type": {
                          "type": "string"
                        },
                        "registered_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "revoked_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_seen_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "device_id",
                        "status",
                        "external_school_id",
                        "platform",
                        "device_type",
                        "registered_at",
                        "revoked_at",
                        "last_seen_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/devices/{id}/revoke": {
      "post": {
        "operationId": "revokeDevice",
        "summary": "Cabut registrasi perangkat",
        "description": "Permintaan launch dan penebusan baru dari perangkat ini ditolak.",
        "x-required-scope": "devices:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Berhasil",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "device_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "revoked"
                          ]
                        },
                        "external_school_id": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "device_type": {
                          "type": "string"
                        },
                        "registered_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "revoked_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "last_seen_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "device_id",
                        "status",
                        "external_school_id",
                        "platform",
                        "device_type",
                        "registered_at",
                        "revoked_at",
                        "last_seen_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error 401",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Error 404",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Error 429",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Error 503",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basic": {
        "type": "http",
        "scheme": "basic",
        "description": "client_id:client_secret, hanya untuk /oauth/token."
      },
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token. Scope: contents:read, contents:launch, entitlements:read, events:write, devices:read, devices:write, sessions:write."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "reason": {
                "description": "Alasan penolakan hak akses yang lebih rinci, bila ada.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "request_id",
              "retryable"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  },
  "x-integration-channels": [
    "web_iframe",
    "web_top_level",
    "android_webview",
    "windows_webview2",
    "ios_wkwebview",
    "electron"
  ]
}