Schools API
Kelola data sekolah (tenant). Setiap API client terikat dengan satu sekolah โ data terisolasi otomatis.
Base URL: https://sekolahku.sains.dev/api/v1
bash โ contoh request
curl -X GET https://sekolahku.sains.dev/api/v1/schools \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/json"
List Schools
Create School
POST
โถ
/schools
Buat sekolah baru
Hanya superadmin. Buat sekolah baru dan sekaligus generate API client.
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | Nama sekolah |
| npsn | string(8) | optional | Nomor NPSN (8 digit) |
| status | string | required | negeri atau swasta |
| level | string | required | sd, smp, sma, smk, slb |
| city | string | optional | Kota/Kabupaten |
| province | string | optional | Provinsi |
| dapodik_server_url | string | optional | URL server Dapodik |
| dapodik_username | string | optional | Username Dapodik |
| dapodik_password | string | optional | Password Dapodik |
| create_api_client | boolean | optional | Generate API client secara otomatis (default: false) |
๐งช Try It
Get School
GET
โถ
/schools/{id}
Detail sekolah
Ambil detail satu sekolah. Superadmin bisa lihat semua; client biasa hanya sekolah miliknya.
Update School
PUT
โถ
/schools/{id}
Update sekolah
Update data sekolah. Field sama dengan create.
Delete School
DELETE
โถ
/schools/{id}
Hapus sekolah
Hapus sekolah (soft delete). Hanya superadmin.