Introduction
This documentation aims to provide all the information you need to work with our API.
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
Authenticating requests
This API is not authenticated.
Classes
Get a list of all classes.
requires authentication
This endpoint returns a list of all classes, including their associated grade and staff members.
Example request:
curl --request GET \
--get "http://localhost/api/v1/classes" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/classes"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"data": [
{
"id": 1,
"name": "Mathematics",
"grade_id": 1,
"grade": {
"id": 1,
"name": "Elementary"
},
"staff": [
{
"id": 1,
"name": "John Doe"
}
]
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new class.
requires authentication
This endpoint allows you to create a new class by providing its name, grade, and an optional list of staff members.
Example request:
curl --request POST \
"http://localhost/api/v1/classes" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Class A\",
\"grade_id\": 1,
\"staff_ids\": \"[1, 2, 3]\"
}"
const url = new URL(
"http://localhost/api/v1/classes"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Class A",
"grade_id": 1,
"staff_ids": "[1, 2, 3]"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true,
"data": {
"name": "Class A",
"grade_id": 1,
"updated_at": "2025-08-02T01:00:00.000000Z",
"created_at": "2025-08-02T01:00:00.000000Z",
"id": 1
}
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get details for a specific class.
requires authentication
This endpoint returns the details for a single class, including its associated grade and staff members.
Example request:
curl --request GET \
--get "http://localhost/api/v1/classes/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/classes/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"data": {
"id": 1,
"name": "Mathematics",
"grade_id": 1,
"grade": {
"id": 1,
"name": "Elementary"
},
"staff": [
{
"id": 1,
"name": "John Doe"
}
]
}
}
Example response (404):
{
"message": "No query results for model [App\\Models\\ClassModel] 100"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing class.
requires authentication
This endpoint updates an existing class, including its name, grade, and attached staff members.
Example request:
curl --request PUT \
"http://localhost/api/v1/classes/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Class B\",
\"grade_id\": 2,
\"staff_ids\": \"[4, 5]\"
}"
const url = new URL(
"http://localhost/api/v1/classes/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Class B",
"grade_id": 2,
"staff_ids": "[4, 5]"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"success": true,
"data": {
"id": 1,
"name": "Class B",
"grade_id": 2,
"updated_at": "2025-08-02T01:05:00.000000Z",
"created_at": "2025-08-02T01:00:00.000000Z"
}
}
Example response (404):
{
"message": "No query results for model [App\\Models\\ClassModel] 1"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"grade_id": [
"The selected grade id is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a class.
requires authentication
This endpoint deletes a specific class from the database.
Example request:
curl --request DELETE \
"http://localhost/api/v1/classes/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/classes/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (204):
Empty response
Example response (404):
{
"message": "No query results for model [App\\Models\\ClassModel] 100"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
POST api/v1/register
Example request:
curl --request POST \
"http://localhost/api/v1/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"vmqeopfuudtdsufvyvddq\",
\"email\": \"kunde.eloisa@example.com\",
\"password\": \"4[*UyPJ\\\"}6\",
\"role\": \"admin\"
}"
const url = new URL(
"http://localhost/api/v1/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "vmqeopfuudtdsufvyvddq",
"email": "kunde.eloisa@example.com",
"password": "4[*UyPJ\"}6",
"role": "admin"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/login
Example request:
curl --request POST \
"http://localhost/api/v1/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"qkunze@example.com\",
\"password\": \"O[2UZ5ij-e\\/dl4m{o,\"
}"
const url = new URL(
"http://localhost/api/v1/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "qkunze@example.com",
"password": "O[2UZ5ij-e\/dl4m{o,"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/logout
Example request:
curl --request POST \
"http://localhost/api/v1/logout" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/logout"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/user
Example request:
curl --request GET \
--get "http://localhost/api/v1/user" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/user"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/attendances
Example request:
curl --request POST \
"http://localhost/api/v1/attendances" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"staff_id\": 17
}"
const url = new URL(
"http://localhost/api/v1/attendances"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"staff_id": 17
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/attendances
Example request:
curl --request GET \
--get "http://localhost/api/v1/attendances" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/attendances"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/dashboard
Example request:
curl --request GET \
--get "http://localhost/api/v1/dashboard" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/dashboard"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/earnings-summary
Example request:
curl --request GET \
--get "http://localhost/api/v1/earnings-summary" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/earnings-summary"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/confirm-password
Example request:
curl --request POST \
"http://localhost/api/v1/confirm-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"password\": \"O[2UZ5ij-e\\/dl4m{o,\"
}"
const url = new URL(
"http://localhost/api/v1/confirm-password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"password": "O[2UZ5ij-e\/dl4m{o,"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/profile
Example request:
curl --request GET \
--get "http://localhost/api/v1/profile" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/profile"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PUT api/v1/profile
Example request:
curl --request PUT \
"http://localhost/api/v1/profile" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"vmqeopfuudtdsufvyvddq\"
}"
const url = new URL(
"http://localhost/api/v1/profile"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "vmqeopfuudtdsufvyvddq"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/profile/update
Example request:
curl --request POST \
"http://localhost/api/v1/profile/update" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name=vmqeopfuudtdsufvyvddq"\
--form "email=kunde.eloisa@example.com"\
--form "avatar=@C:\Users\pc\AppData\Local\Temp\php9DE5.tmp" const url = new URL(
"http://localhost/api/v1/profile/update"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', 'vmqeopfuudtdsufvyvddq');
body.append('email', 'kunde.eloisa@example.com');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/payments/class/{class_id}
Example request:
curl --request GET \
--get "http://localhost/api/v1/payments/class/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/payments/class/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/payments/suspended/{studentId}
Example request:
curl --request GET \
--get "http://localhost/api/v1/payments/suspended/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/payments/suspended/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/payments/statuses
Example request:
curl --request GET \
--get "http://localhost/api/v1/payments/statuses" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/payments/statuses"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/transactions
Example request:
curl --request GET \
--get "http://localhost/api/v1/transactions" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/transactions"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/transactions
Example request:
curl --request POST \
"http://localhost/api/v1/transactions" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"student_id\": 11613.31890586,
\"total_amount\": 11613.31890586,
\"status\": \"consequatur\",
\"payment_method\": \"consequatur\",
\"payments\": [
{
\"id\": \"consequatur\",
\"amountToPay\": 45,
\"remise\": 56
}
]
}"
const url = new URL(
"http://localhost/api/v1/transactions"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"student_id": 11613.31890586,
"total_amount": 11613.31890586,
"status": "consequatur",
"payment_method": "consequatur",
"payments": [
{
"id": "consequatur",
"amountToPay": 45,
"remise": 56
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/transactions/{id}
Example request:
curl --request GET \
--get "http://localhost/api/v1/transactions/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/transactions/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get payments for a specific transaction.
Example request:
curl --request GET \
--get "http://localhost/api/v1/transactions/consequatur/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/transactions/consequatur/payments"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/school-settings
Example request:
curl --request GET \
--get "http://localhost/api/v1/school-settings" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/school-settings"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/school-settings
Example request:
curl --request POST \
"http://localhost/api/v1/school-settings" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "name=vmqeopfuudtdsufvyvddq"\
--form "address=consequatur"\
--form "phone=mqeopfuudtdsufvyv"\
--form "email=buckridge.adell@example.org"\
--form "website=niihfqcoynlazghdtqtqx"\
--form "logo=@C:\Users\pc\AppData\Local\Temp\php9E9A.tmp" const url = new URL(
"http://localhost/api/v1/school-settings"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', 'vmqeopfuudtdsufvyvddq');
body.append('address', 'consequatur');
body.append('phone', 'mqeopfuudtdsufvyv');
body.append('email', 'buckridge.adell@example.org');
body.append('website', 'niihfqcoynlazghdtqtqx');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/school-settings/logo
Example request:
curl --request POST \
"http://localhost/api/v1/school-settings/logo" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "logo=@C:\Users\pc\AppData\Local\Temp\php9E9B.tmp" const url = new URL(
"http://localhost/api/v1/school-settings/logo"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('logo', document.querySelector('input[name="logo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/school-settings/logo
Example request:
curl --request GET \
--get "http://localhost/api/v1/school-settings/logo" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/school-settings/logo"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/school-years
Example request:
curl --request GET \
--get "http://localhost/api/v1/school-years" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/school-years"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/school-years
Example request:
curl --request POST \
"http://localhost/api/v1/school-years" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"consequatur\",
\"start_year\": 17,
\"end_year\": 17,
\"is_active\": true
}"
const url = new URL(
"http://localhost/api/v1/school-years"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "consequatur",
"start_year": 17,
"end_year": 17,
"is_active": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
FeeTypes
Display a listing of the resource.
Example request:
curl --request GET \
--get "http://localhost/api/v1/fee-types" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/fee-types"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"name": "Tuition",
"amount": 500,
"frequency": "monthly"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store a newly created resource in storage.
Example request:
curl --request POST \
"http://localhost/api/v1/fee-types" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Tuition\",
\"amount\": \"500\",
\"frequency\": \"monthly\",
\"description\": \"Dolores dolorum amet iste laborum eius est dolor.\"
}"
const url = new URL(
"http://localhost/api/v1/fee-types"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Tuition",
"amount": "500",
"frequency": "monthly",
"description": "Dolores dolorum amet iste laborum eius est dolor."
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"id": 1,
"name": "Tuition",
"amount": 500,
"frequency": "monthly"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display the specified resource.
Example request:
curl --request GET \
--get "http://localhost/api/v1/fee-types/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/fee-types/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Tuition",
"amount": 500,
"frequency": "monthly"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the specified resource in storage.
Example request:
curl --request PUT \
"http://localhost/api/v1/fee-types/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Updated Tuition\",
\"amount\": \"600\",
\"frequency\": \"annual\"
}"
const url = new URL(
"http://localhost/api/v1/fee-types/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Updated Tuition",
"amount": "600",
"frequency": "annual"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Updated Tuition",
"amount": 600,
"frequency": "annual"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove the specified resource from storage.
Example request:
curl --request DELETE \
"http://localhost/api/v1/fee-types/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/fee-types/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (204):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Grades
Display a listing of the resource.
Example request:
curl --request GET \
--get "http://localhost/api/v1/grades" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/grades"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Elementary"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store a newly created resource in storage.
Example request:
curl --request POST \
"http://localhost/api/v1/grades" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Elementary\"
}"
const url = new URL(
"http://localhost/api/v1/grades"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Elementary"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"id": 1,
"name": "Elementary"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display the specified resource.
Example request:
curl --request GET \
--get "http://localhost/api/v1/grades/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/grades/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Elementary"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the specified resource in storage.
Example request:
curl --request PUT \
"http://localhost/api/v1/grades/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Secondary\"
}"
const url = new URL(
"http://localhost/api/v1/grades/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Secondary"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"name": "Secondary"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove the specified resource from storage.
Example request:
curl --request DELETE \
"http://localhost/api/v1/grades/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/grades/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (204):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Guardians
Search guardians by first or last name. This endpoint allows you to search for guardians using a partial match of their first or last names.
Example request:
curl --request GET \
--get "http://localhost/api/v1/guardians/search?search=John" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/guardians/search"
);
const params = {
"search": "John",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display a listing of the guardians.
Example request:
curl --request GET \
--get "http://localhost/api/v1/guardians" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/guardians"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store a newly created guardian in storage.
Example request:
curl --request POST \
"http://localhost/api/v1/guardians" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "first_name=vmqeopfuudtdsufvyvddq"\
--form "last_name=amniihfqcoynlazghdtqt"\
--form "phone_number=qxbajwbpilpmufinl"\
--form "email=john@example.com"\
--form "address=uydlsmsjuryvojcybzvrb"\
--form "name=John Doe"\
--form "phone=123-456-7890"\
--form "cin_front=@C:\Users\pc\AppData\Local\Temp\php9E38.tmp" \
--form "cin_back=@C:\Users\pc\AppData\Local\Temp\php9E39.tmp" const url = new URL(
"http://localhost/api/v1/guardians"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('first_name', 'vmqeopfuudtdsufvyvddq');
body.append('last_name', 'amniihfqcoynlazghdtqt');
body.append('phone_number', 'qxbajwbpilpmufinl');
body.append('email', 'john@example.com');
body.append('address', 'uydlsmsjuryvojcybzvrb');
body.append('name', 'John Doe');
body.append('phone', '123-456-7890');
body.append('cin_front', document.querySelector('input[name="cin_front"]').files[0]);
body.append('cin_back', document.querySelector('input[name="cin_back"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display the specified guardian.
Example request:
curl --request GET \
--get "http://localhost/api/v1/guardians/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/guardians/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the specified guardian in storage.
Example request:
curl --request PUT \
"http://localhost/api/v1/guardians/17" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "first_name=vmqeopfuudtdsufvyvddq"\
--form "last_name=amniihfqcoynlazghdtqt"\
--form "email=jane@example.com"\
--form "phone_number=wbpilpmufinllwloa"\
--form "address=uydlsmsjuryvojcybzvrb"\
--form "name=Jane Doe"\
--form "phone=098-765-4321"\
--form "cin_front=@C:\Users\pc\AppData\Local\Temp\php9E4A.tmp" \
--form "cin_back=@C:\Users\pc\AppData\Local\Temp\php9E4B.tmp" const url = new URL(
"http://localhost/api/v1/guardians/17"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('first_name', 'vmqeopfuudtdsufvyvddq');
body.append('last_name', 'amniihfqcoynlazghdtqt');
body.append('email', 'jane@example.com');
body.append('phone_number', 'wbpilpmufinllwloa');
body.append('address', 'uydlsmsjuryvojcybzvrb');
body.append('name', 'Jane Doe');
body.append('phone', '098-765-4321');
body.append('cin_front', document.querySelector('input[name="cin_front"]').files[0]);
body.append('cin_back', document.querySelector('input[name="cin_back"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove the specified guardian from storage.
Example request:
curl --request DELETE \
"http://localhost/api/v1/guardians/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/guardians/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get CIN image of a guardian. Returns the requested CIN image (front or back) of a guardian.
Example request:
curl --request GET \
--get "http://localhost/api/v1/guardians/1/cin/front" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/guardians/1/cin/front"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Payments
Get all payments for a specific student.
Example request:
curl --request GET \
--get "http://localhost/api/v1/students/1/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/students/1/payments"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"amount": 100,
"payment_date": "2024-09-01",
"status": "pending",
"student_id": 1,
"fee_type_id": 1,
"student": {
"id": 1,
"first_name": "John",
"last_name": "Doe"
},
"feeType": {
"id": 1,
"name": "Tuition"
}
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get payments for the current month.
Example request:
curl --request GET \
--get "http://localhost/api/v1/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/payments"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"amount": 100,
"payment_date": "2024-09-01",
"status": "pending",
"student_id": 1,
"fee_type_id": 1,
"student": {
"id": 1,
"first_name": "John",
"last_name": "Doe",
"code_massar": "ABC123"
},
"feeType": {
"id": 1,
"name": "Tuition"
}
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store a new payment.
Example request:
curl --request POST \
"http://localhost/api/v1/payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"amount\": 100,
\"payment_date\": \"2024-09-01\",
\"status\": \"pending\",
\"student_id\": 1,
\"fee_type_id\": 1
}"
const url = new URL(
"http://localhost/api/v1/payments"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"amount": 100,
"payment_date": "2024-09-01",
"status": "pending",
"student_id": 1,
"fee_type_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"id": 1,
"amount": 100,
"payment_date": "2024-09-01",
"status": "pending",
"student_id": 1,
"fee_type_id": 1
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an existing payment.
Example request:
curl --request PUT \
"http://localhost/api/v1/payments/1562" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"amount_paid\": 73,
\"remise\": 45,
\"amount\": 150,
\"payment_date\": \"2024-10-01\",
\"status\": \"completed\",
\"student_id\": 2,
\"fee_type_id\": 2
}"
const url = new URL(
"http://localhost/api/v1/payments/1562"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"amount_paid": 73,
"remise": 45,
"amount": 150,
"payment_date": "2024-10-01",
"status": "completed",
"student_id": 2,
"fee_type_id": 2
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"amount": 150,
"payment_date": "2024-10-01",
"status": "completed",
"student_id": 2,
"fee_type_id": 2
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Generate payments for all students based on their fee types.
Example request:
curl --request GET \
--get "http://localhost/api/v1/payments/generate-payments" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/payments/generate-payments"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Payments generated successfully."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a student's payments by their Massar code.
requires authentication
This endpoint retrieves all payments for a specific student using their unique code_massar.
You can optionally filter the results by a specific school year.
Example request:
curl --request GET \
--get "http://localhost/api/v1/payments/massar/"S123456789"?school_year_id=1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/payments/massar/"S123456789""
);
const params = {
"school_year_id": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"success": true,
"data": [
{
"id": 1,
"student_id": 1,
"fee_type_id": 1,
"school_year_id": 1,
"amount": 500,
"remaining": 100,
"payment_date": "2025-08-01",
"status": "incomplete",
"year": 2025,
"month": 8,
"student": {
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"code_massar": "S123456789"
},
"fee_type": {
"id": 1,
"name": "Tuition Fee"
}
},
{
"id": 2,
"student_id": 1,
"fee_type_id": 2,
"school_year_id": 1,
"amount": 200,
"remaining": 0,
"payment_date": "2025-07-25",
"status": "completed",
"year": 2025,
"month": 7,
"student": {
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"code_massar": "S123456789"
},
"fee_type": {
"id": 2,
"name": "Books"
}
}
]
}
Example response (404):
{
"message": "Student not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Staff
Display a listing of the staff members.
Example request:
curl --request GET \
--get "http://localhost/api/v1/staff" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/staff"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"gender": "male",
"address": "123 Main St",
"phone_number": "123-456-7890",
"email": "john.doe@example.com",
"affectation_date": "2021-06-15",
"contrat_type": "CDI",
"function": "teacher",
"n_cnss": "1234567890",
"base_salary": 3000,
"bank_acount_num": "123456789"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store a newly created staff member in storage.
Example request:
curl --request POST \
"http://localhost/api/v1/staff" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"John\",
\"last_name\": \"Doe\",
\"phone_number\": \"123-456-7890\",
\"email\": \"john.doe@example.com\",
\"date_of_birth\": \"1990-01-01\",
\"gender\": \"male\",
\"address\": \"123 Main St\",
\"affectation_date\": \"2021-06-15\",
\"contrat_type\": \"CDI\",
\"function\": \"teacher\",
\"n_cnss\": \"1234567890\",
\"base_salary\": 3000,
\"bank_acount_num\": \"123456789\"
}"
const url = new URL(
"http://localhost/api/v1/staff"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "John",
"last_name": "Doe",
"phone_number": "123-456-7890",
"email": "john.doe@example.com",
"date_of_birth": "1990-01-01",
"gender": "male",
"address": "123 Main St",
"affectation_date": "2021-06-15",
"contrat_type": "CDI",
"function": "teacher",
"n_cnss": "1234567890",
"base_salary": 3000,
"bank_acount_num": "123456789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"gender": "male",
"address": "123 Main St",
"phone_number": "123-456-7890",
"email": "john.doe@example.com",
"affectation_date": "2021-06-15",
"contrat_type": "CDI",
"function": "teacher",
"n_cnss": "1234567890",
"base_salary": 3000,
"bank_acount_num": "123456789"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display the specified staff member.
Example request:
curl --request GET \
--get "http://localhost/api/v1/staff/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/staff/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"gender": "male",
"address": "123 Main St",
"phone_number": "123-456-7890",
"email": "john.doe@example.com",
"affectation_date": "2021-06-15",
"contrat_type": "CDI",
"function": "teacher",
"n_cnss": "1234567890",
"base_salary": 3000,
"bank_acount_num": "123456789"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update the specified staff member in storage.
Example request:
curl --request PUT \
"http://localhost/api/v1/staff/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"John\",
\"last_name\": \"Doe\",
\"date_of_birth\": \"1990-01-01\",
\"gender\": \"male\",
\"address\": \"123 Main St\",
\"phone_number\": \"123-456-7890\",
\"email\": \"john.doe@example.com\",
\"affectation_date\": \"2021-06-15\",
\"contrat_type\": \"CDI\",
\"function\": \"teacher\",
\"n_cnss\": \"1234567890\",
\"base_salary\": 3000,
\"bank_acount_num\": \"123456789\"
}"
const url = new URL(
"http://localhost/api/v1/staff/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"gender": "male",
"address": "123 Main St",
"phone_number": "123-456-7890",
"email": "john.doe@example.com",
"affectation_date": "2021-06-15",
"contrat_type": "CDI",
"function": "teacher",
"n_cnss": "1234567890",
"base_salary": 3000,
"bank_acount_num": "123456789"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"gender": "male",
"address": "123 Main St",
"phone_number": "123-456-7890",
"email": "john.doe@example.com",
"affectation_date": "2021-06-15",
"contrat_type": "CDI",
"function": "teacher",
"n_cnss": "1234567890",
"base_salary": 3000,
"bank_acount_num": "123456789"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove the specified staff member from storage.
Example request:
curl --request DELETE \
"http://localhost/api/v1/staff/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/staff/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Staff deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Retrieve staff members where the function is 'teacher'.
Example request:
curl --request GET \
--get "http://localhost/api/v1/teachers" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/teachers"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
[
{
"id": 1,
"first_name": "Jane",
"last_name": "Smith",
"function": "teacher"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Students
Assign fee types to a student.
Example request:
curl --request POST \
"http://localhost/api/v1/students/consequatur/fee-types" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"fee_type_ids\": [
1,
2
]
}"
const url = new URL(
"http://localhost/api/v1/students/consequatur/fee-types"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"fee_type_ids": [
1,
2
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"message": "FeeTypes assigned successfully."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
List all students with their guardians and class.
Example request:
curl --request GET \
--get "http://localhost/api/v1/students" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/students"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
array<Student>
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store a new student.
Example request:
curl --request POST \
"http://localhost/api/v1/students" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "first_name=John"\
--form "last_name=Doe"\
--form "first_name_arab=Ψ¬ΩΩ"\
--form "last_name_arab=Ψ―Ω"\
--form "gender=male"\
--form "date_of_birth=2005-06-15"\
--form "address=123 Main St"\
--form "phone_number=0612345678"\
--form "code_massar=123456"\
--form "class_id=1"\
--form "image=@C:\Users\pc\AppData\Local\Temp\php9E16.tmp" const url = new URL(
"http://localhost/api/v1/students"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('first_name', 'John');
body.append('last_name', 'Doe');
body.append('first_name_arab', 'Ψ¬ΩΩ');
body.append('last_name_arab', 'Ψ―Ω');
body.append('gender', 'male');
body.append('date_of_birth', '2005-06-15');
body.append('address', '123 Main St');
body.append('phone_number', '0612345678');
body.append('code_massar', '123456');
body.append('class_id', '1');
body.append('image', document.querySelector('input[name="image"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201):
{
"message": "Student created successfully.",
"student": Student
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a specific student with guardians.
Example request:
curl --request GET \
--get "http://localhost/api/v1/students/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/students/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Student
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a student.
Example request:
curl --request PUT \
"http://localhost/api/v1/students/17" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "first_name=John"\
--form "last_name=Doe"\
--form "first_name_arab=qxbajwbpilpmufinllwlo"\
--form "last_name_arab=auydlsmsjuryvojcybzvr"\
--form "date_of_birth=2025-08-02T01:17:32"\
--form "gender=male"\
--form "address=byickznkygloigmkwxphl"\
--form "phone_number=vazjrcnfbaqywuxhg"\
--form "code_massar=jjmzuxjubqouzswiwxtrk"\
--form "class_id=17"\
--form "guardians[]=consequatur"\
--form "image=@C:\Users\pc\AppData\Local\Temp\php9E27.tmp" const url = new URL(
"http://localhost/api/v1/students/17"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('first_name', 'John');
body.append('last_name', 'Doe');
body.append('first_name_arab', 'qxbajwbpilpmufinllwlo');
body.append('last_name_arab', 'auydlsmsjuryvojcybzvr');
body.append('date_of_birth', '2025-08-02T01:17:32');
body.append('gender', 'male');
body.append('address', 'byickznkygloigmkwxphl');
body.append('phone_number', 'vazjrcnfbaqywuxhg');
body.append('code_massar', 'jjmzuxjubqouzswiwxtrk');
body.append('class_id', '17');
body.append('guardians[]', 'consequatur');
body.append('image', document.querySelector('input[name="image"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());Example response (200):
Student
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a student.
Example request:
curl --request DELETE \
"http://localhost/api/v1/students/17" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/students/17"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (204):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a student's profile image.
Example request:
curl --request GET \
--get "http://localhost/api/v1/students/profile-image/avatar.jpg" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/v1/students/profile-image/avatar.jpg"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
file Returns the student image file.
Example response (404):
{
"message": "Image not found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.