MENU navbar-image

Introduction

This documentation provides all the essential information you need to effectively work with the AleosApp API.

This improved version aligns more closely with AleosApp, making it specific and user-focused. Let me know if you'd like further refinements!

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Authorization

This endpoint allows a user to log in by providing valid credentials. It also returns the user's settings, role, and permissions to facilitate frontend access.

Log in a user and return a token.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"login\": \"aleos.administrator@aleosapp.com\",
    \"password\": \"aleos123456789\"
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "login": "aleos.administrator@aleosapp.com",
    "password": "aleos123456789"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "user": {
        "id": 1,
        "name": "John Doe",
        "email": "aleos.administrator@aleosapp.com",
        "created_at": "2025-01-10T12:00:00.000000Z",
        "updated_at": "2025-01-10T12:00:00.000000Z"
    },
    "settings": [
        {
            "id": 1,
            "parent_id": 1,
            "language": "en",
            "colors": {
                "primary": "#000000",
                "secondary": "#FFFFFF"
            },
            "icons": "default",
            "url": "https://example.com",
            "setting": {
                "notifications": true
            },
            "setting_backup": {
                "notifications": false
            },
            "created_at": "2025-01-10T12:00:00.000000Z",
            "updated_at": "2025-01-10T12:00:00.000000Z"
        }
    ],
    "role": "administrator",
    "permissions": [
        "administrative.dashboard.index",
        "administrative.settings.index"
    ],
    "token": "1|abcd1234efgh5678"
}
 

Example response (200):


{
    "user": {
        "id": 2,
        "name": "Jane Doe",
        "email": "aleos.administrator@aleosapp.com",
        "created_at": "2025-01-10T12:00:00.000000Z",
        "updated_at": "2025-01-10T12:00:00.000000Z"
    },
    "settings": [
        {
            "id": 2,
            "parent_id": 2,
            "language": "en",
            "colors": {
                "primary": "#111111",
                "secondary": "#222222"
            },
            "icons": "minimal",
            "url": "https://example.com/coach",
            "setting": {
                "notifications": true
            },
            "setting_backup": {
                "notifications": false
            },
            "created_at": "2025-01-10T12:00:00.000000Z",
            "updated_at": "2025-01-10T12:00:00.000000Z"
        }
    ],
    "role": "coach",
    "permissions": [
        "administrative.dashboard.index"
    ],
    "token": "1|efgh5678abcd1234"
}
 

Example response (401):


{
    "message": "Invalid credentials"
}
 

Request      

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

login   string   

The user's email or username. Example: aleos.administrator@aleosapp.com

password   string   

The user's password. Example: aleos123456789

Send a password reset link to the user's email.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/password/forgot" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"johndoe@example.com\"
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/password/forgot"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "johndoe@example.com"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Password reset link sent successfully."
}
 

Example response (404):


{
    "message": "We couldn't find a user with that email address."
}
 

Request      

POST api/password/forgot

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user requesting the password reset. Example: johndoe@example.com

Reset the user's password.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/password/reset" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"johndoe@example.com\",
    \"token\": \"abc123\",
    \"password\": \"newpassword123\",
    \"password_confirmation\": \"newpassword123\"
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/password/reset"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "johndoe@example.com",
    "token": "abc123",
    "password": "newpassword123",
    "password_confirmation": "newpassword123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Password reset successfully."
}
 

Example response (400):


{
    "message": "Invalid token or email."
}
 

Request      

POST api/password/reset

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: johndoe@example.com

token   string   

The password reset token. Example: abc123

password   string   

The new password. Example: newpassword123

password_confirmation   string   

Confirmation of the new password. Example: newpassword123

Endpoints

GET api/user

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/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: *
access-control-expose-headers: *
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
access-control-allow-headers: Content-Type, Authorization, X-Requested-With
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Setting

This endpoint retrieves the template field for the module associated with the settings of the authenticated user.

Get the template for the current user's settings.

requires authentication

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "template": {
        "layout": "settings",
        "fields": [
            {
                "name": "site_name",
                "type": "text"
            },
            {
                "name": "email",
                "type": "email"
            }
        ]
    }
}
 

Example response (404):


{
    "message": "Template for the current setting not found."
}
 

Request      

GET api/setting

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Profile - Store or Update Profile

requires authentication

This endpoint allows the authenticated user to create or update their profile. Additionally, users can add custom fields to store personalized information.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/setting/profile" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "first_name=John"\
    --form "last_name=Doe"\
    --form "gender=male"\
    --form "date_birth=1990-01-01"\
    --form "id_number=123456789"\
    --form "language=en"\
    --form "billing_phone_number=+1234567890"\
    --form "billing_country=United States"\
    --form "billing_email=john.doe@example.com"\
    --form "billing_state=California"\
    --form "billing_address=123 Main Street"\
    --form "billing_zip_code=90210"\
    --form "image=@/tmp/phptwgMem" 
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/profile"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('first_name', 'John');
body.append('last_name', 'Doe');
body.append('gender', 'male');
body.append('date_birth', '1990-01-01');
body.append('id_number', '123456789');
body.append('language', 'en');
body.append('billing_phone_number', '+1234567890');
body.append('billing_country', 'United States');
body.append('billing_email', 'john.doe@example.com');
body.append('billing_state', 'California');
body.append('billing_address', '123 Main Street');
body.append('billing_zip_code', '90210');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (200):


{
    "message": "Profile updated successfully",
    "profile": {
        "id": 1,
        "user_id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "gender": "male",
        "date_birth": "1990-01-01",
        "id_number": "123456789",
        "language": "en",
        "billing_phone_number": "+1234567890",
        "billing_country": "United States",
        "billing_email": "john.doe@example.com",
        "billing_state": "California",
        "billing_address": "123 Main Street",
        "billing_zip_code": "90210",
        "image_url": "https://s3.amazonaws.com/bucket-name/profile-images/image.jpg",
        "created_at": "2025-01-16T00:00:00.000000Z",
        "updated_at": "2025-01-16T00:00:00.000000Z"
    },
    "custom_fields": [
        {
            "slug": "father_name",
            "value": "Oscar Perez"
        },
        {
            "slug": "hobby",
            "value": "Fútbol"
        }
    ]
}
 

Example response (201):


{
    "message": "Profile created successfully",
    "profile": {
        "id": 1,
        "user_id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "gender": "male",
        "date_birth": "1990-01-01",
        "id_number": "123456789",
        "language": "en",
        "billing_phone_number": "+1234567890",
        "billing_country": "United States",
        "billing_email": "john.doe@example.com",
        "billing_state": "California",
        "billing_address": "123 Main Street",
        "billing_zip_code": "90210",
        "image_url": "https://s3.amazonaws.com/bucket-name/profile-images/image.jpg",
        "created_at": "2025-01-16T00:00:00.000000Z",
        "updated_at": "2025-01-16T00:00:00.000000Z"
    },
    "custom_fields": [
        {
            "slug": "father_name",
            "value": "Oscar Perez"
        },
        {
            "slug": "hobby",
            "value": "soccer"
        }
    ]
}
 

Request      

POST api/setting/profile

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

first_name   string  optional  

optional The user's first name. Example: John

last_name   string  optional  

optional The user's last name. Example: Doe

gender   string  optional  

optional The user's gender (male, female, other). Example: male

date_birth   date  optional  

optional The user's date of birth in the format YYYY-MM-DD. Example: 1990-01-01

id_number   string  optional  

optional A unique identification number for the user. Example: 123456789

language   string  optional  

optional The user's preferred language. Example: en

billing_phone_number   string  optional  

optional The phone number used for billing purposes. Example: +1234567890

billing_country   string  optional  

optional The country used for billing purposes. Example: United States

billing_email   string  optional  

optional The email address used for billing purposes. Example: john.doe@example.com

billing_state   string  optional  

optional The state or province used for billing purposes. Example: California

billing_address   string  optional  

optional The address used for billing purposes. Example: 123 Main Street

billing_zip_code   string  optional  

optional The ZIP code used for billing purposes. Example: 90210

image   file  optional  

optional A profile image to upload. Must be a valid image file.


How to send custom_fields

The custom_fields parameter should be sent as an array of objects, each containing:

  • slug (string, required): A unique identifier for the field.
  • value (string, required): The value associated with the slug.

Example of how to send custom_fields:

{
   "first_name":"John"...
   "custom_fields": [
       {
           "slug": "hobby",
           "value": "soccer"
       },
       {
           "slug": "favorite_food",
           "value": "pizza"
       }
   ]
}

Notes:

  • The slug must be unique within the user's profile.
  • The value can be a string, number, or any other valid JSON data type. Example: /tmp/phptwgMem

Profile - Change Password

requires authentication

This endpoint allows the authenticated user to change their password.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/setting/change-password" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"current_password\": \"currentPassword123\",
    \"new_password\": \"NewPassword123\",
    \"new_password_confirmation\": \"NewPassword123\"
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/change-password"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "current_password": "currentPassword123",
    "new_password": "NewPassword123",
    "new_password_confirmation": "NewPassword123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Password changed successfully."
}
 

Example response (400):


{
    "message": "Current password does not match."
}
 

Request      

POST api/setting/change-password

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

current_password   string   

The current password of the user. Example: currentPassword123

new_password   string   

The new password to set. Example: NewPassword123

new_password_confirmation   string   

The confirmation for the new password. Example: NewPassword123

School - List All Schools for Administrative User

requires authentication

This endpoint returns a list of schools associated with the authenticated administrative user.

Usage

How to Send Parameters

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/schools?only_archived=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/schools"
);

const params = {
    "only_archived": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "schools": {
        "data": [
            {
                "id": 1,
                "nickname": "Wildcats",
                "address": "123 Main St",
                "status": "archived",
                "created_at": "2023-01-15T00:00:00.000000Z",
                "updated_at": "2023-06-10T00:00:00.000000Z",
                "administrative": {
                    "id": 1,
                    "name": "John Doe"
                },
                "creator": {
                    "id": 2,
                    "name": "Jane Smith"
                },
                "school_sites": [
                    {
                        "id": 1,
                        "name": "Main Campus",
                        "locations": [
                            {
                                "id": 1,
                                "name": "Field A",
                                "description": "Main soccer field"
                            }
                        ]
                    }
                ]
            }
        ],
        "links": {
            "first": "http://example.com/api/setting/schools?page=1",
            "last": "http://example.com/api/setting/schools?page=10",
            "prev": null,
            "next": "http://example.com/api/setting/schools?page=2"
        },
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 10,
            "path": "http://example.com/api/setting/schools",
            "per_page": 10,
            "to": 10,
            "total": 100
        }
    },
    "metadata": {
        "columns": [
            "id",
            "nickname",
            "address",
            "status",
            "created_at",
            "updated_at",
            "administrative.name",
            "creator.name"
        ],
        "defaultColumns": [
            "id",
            "nickname",
            "address",
            "description"
        ]
    }
}
 

Request      

GET api/setting/schools

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

per_page   integer  optional  

optional Number of records per page. Default is 10. Example: 15

Query Parameters

only_archived   boolean  optional  

optional If true, retrieves only archived categories. Default is false. Example: true

School - Create a New School

requires authentication

This endpoint allows the authenticated user to create a new school, including its associated school sites and locations. Additionally, the school's photo is managed using a polymorphic relationship.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/setting/schools" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "nickname=Wildcats"\
    --form "address=123 Main St"\
    --form "sport=Soccer"\
    --form "description=A leading sports school."\
    --form "status=active"\
    --form "name_representative=John"\
    --form "last_name_representative=Doe"\
    --form "id_number_representative=123456789"\
    --form "phone_number_representative=+1234567890"\
    --form "email_representative=john.doe@example.com"\
    --form "school_sites[][locations][][name]=tnpwck"\
    --form "school_sites[][locations][][description]=Dolores sint illo sit dolorem."\
    --form "photo=@/tmp/phpPtzC35" 
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/schools"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('nickname', 'Wildcats');
body.append('address', '123 Main St');
body.append('sport', 'Soccer');
body.append('description', 'A leading sports school.');
body.append('status', 'active');
body.append('name_representative', 'John');
body.append('last_name_representative', 'Doe');
body.append('id_number_representative', '123456789');
body.append('phone_number_representative', '+1234567890');
body.append('email_representative', 'john.doe@example.com');
body.append('school_sites[][locations][][name]', 'tnpwck');
body.append('school_sites[][locations][][description]', 'Dolores sint illo sit dolorem.');
body.append('photo', document.querySelector('input[name="photo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (201):


{
    "message": "School created successfully",
    "school": {
        "id": 1,
        "nickname": "Wildcats",
        "address": "123 Main St",
        "school_sites": [
            {
                "id": 1,
                "name": "Main Campus",
                "phone": "123456",
                "address": "123 Main St",
                "email": "campus@example.com",
                "locations": [
                    {
                        "id": 1,
                        "name": "Field A",
                        "description": "Main soccer field"
                    }
                ]
            }
        ]
    }
}
 

Request      

POST api/setting/schools

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

nickname   string   

The school's nickname. Example: Wildcats

address   string   

The school's address. Example: 123 Main St

photo   file  optional  

optional The school's photo. Must be a valid image file (jpg, png, etc.). Example: /tmp/phpPtzC35

sport   string  optional  

optional The school's main sport. Example: Soccer

description   string  optional  

optional The school's description. Example: A leading sports school.

status   string  optional  

optional The school's status. Must be one of 'active' or 'inactive'. Default is 'active'. Example: active

name_representative   string   

The representative's first name. Example: John

last_name_representative   string   

The representative's last name. Example: Doe

id_number_representative   string   

The representative's ID number. Example: 123456789

phone_number_representative   string   

The representative's phone number. Example: +1234567890

email_representative   string   

The representative's email. Example: john.doe@example.com

school_sites   string[]  optional  

optional Array of school sites. Each site must include name, phone, address, and email. Each site can optionally include locations.

name   string   

Must not be greater than 255 characters. Example: bu

phone   string   

Must not be greater than 20 characters. Example: wjlonpum

address   string   

Must not be greater than 255 characters. Example: rmxiiitsgylvp

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: aufderhar.alden@example.com

locations   object[]  optional  
name   string   

Must not be greater than 255 characters. Example: tnpwck

description   string  optional  

Example: Dolores sint illo sit dolorem.

School - View Details of a Specific School

requires authentication

This endpoint retrieves the details of a specific school, including its associated school sites and locations. Only the administrator who owns the school can view it.

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/schools/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/schools/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "School retrieved successfully",
    "school": {
        "id": 1,
        "nickname": "Wildcats",
        "address": "123 Main St",
        "sport": "Soccer",
        "status": "active",
        "name_representative": "John",
        "last_name_representative": "Doe",
        "id_number_representative": "123456789",
        "phone_number_representative": "+1234567890",
        "email_representative": "john.doe@example.com",
        "photo_url": "https://s3.amazonaws.com/bucket-name/schools/photos/photo.jpg",
        "school_sites": [
            {
                "id": 1,
                "name": "Main Campus",
                "phone": "123456",
                "address": "123 Main St",
                "email": "campus@example.com",
                "locations": [
                    {
                        "id": 1,
                        "name": "Field A",
                        "description": "Main soccer field",
                        "state": "active"
                    }
                ]
            }
        ]
    }
}
 

Example response (404):


{
    "message": "School not found or unauthorized."
}
 

Request      

GET api/setting/schools/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the school. Example: 1

School - Update an Existing School

requires authentication

This endpoint allows the authenticated user to update an existing school, including its associated school sites and locations. Additionally, the school's photo can be updated using a polymorphic relationship. If new sites or locations are provided, they will be created. Existing sites and locations will be updated if their IDs are included.

Example request:
curl --request PUT \
    "https://apialeosapp.xioagency.com/api/setting/schools/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "nickname=Wildcats"\
    --form "address=123 Main St"\
    --form "sport=Soccer"\
    --form "description=A leading sports school."\
    --form "status=active"\
    --form "name_representative=John"\
    --form "last_name_representative=Doe"\
    --form "id_number_representative=123456789"\
    --form "phone_number_representative=+1234567890"\
    --form "email_representative=john.doe@example.com"\
    --form "school_sites[][locations][][name]=aw"\
    --form "school_sites[][locations][][description]=Voluptas ut non eligendi doloribus ducimus."\
    --form "photo=@/tmp/phpdkzT6o" 
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/schools/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('nickname', 'Wildcats');
body.append('address', '123 Main St');
body.append('sport', 'Soccer');
body.append('description', 'A leading sports school.');
body.append('status', 'active');
body.append('name_representative', 'John');
body.append('last_name_representative', 'Doe');
body.append('id_number_representative', '123456789');
body.append('phone_number_representative', '+1234567890');
body.append('email_representative', 'john.doe@example.com');
body.append('school_sites[][locations][][name]', 'aw');
body.append('school_sites[][locations][][description]', 'Voluptas ut non eligendi doloribus ducimus.');
body.append('photo', document.querySelector('input[name="photo"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());

Example response (200):


{
    "message": "School updated successfully",
    "school": {
        "id": 1,
        "nickname": "Wildcats",
        "address": "123 Main St",
        "sport": "Soccer",
        "status": "active",
        "name_representative": "John",
        "last_name_representative": "Doe",
        "id_number_representative": "123456789",
        "phone_number_representative": "+1234567890",
        "email_representative": "john.doe@example.com",
        "photo_url": "https://s3.amazonaws.com/bucket-name/schools/photos/photo.jpg",
        "school_sites": [
            {
                "id": 1,
                "name": "Main Campus",
                "phone": "123456",
                "address": "123 Main St",
                "email": "campus@example.com",
                "locations": [
                    {
                        "id": 1,
                        "name": "Field A",
                        "description": "Main soccer field",
                        "state": "active"
                    }
                ]
            }
        ]
    }
}
 

Example response (404):


{
    "message": "School not found or unauthorized."
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "nickname": [
            "The nickname field must be a string."
        ],
        "school_sites.*.name": [
            "The name field is required when updating a school site."
        ]
    }
}
 

Request      

PUT api/setting/schools/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the school to update. Example: 1

Body Parameters

nickname   string  optional  

optional The school's nickname. Example: Wildcats

address   string  optional  

optional The school's address. Example: 123 Main St

photo   file  optional  

optional The school's photo. Must be a valid image file (jpg, png, etc.). Example: /tmp/phpdkzT6o

sport   string  optional  

optional The school's main sport. Example: Soccer

description   string  optional  

optional The school's description. Example: A leading sports school.

status   string  optional  

optional The school's status. Must be one of 'active' or 'inactive'. Default is 'active'. Example: active

name_representative   string  optional  

optional The representative's first name. Example: John

last_name_representative   string  optional  

optional The representative's last name. Example: Doe

id_number_representative   string  optional  

optional The representative's ID number. Example: 123456789

phone_number_representative   string  optional  

optional The representative's phone number. Example: +1234567890

email_representative   string  optional  

optional The representative's email. Example: john.doe@example.com

school_sites   string[]  optional  

optional Array of school sites. Each site must include name, phone, address, and email. Each site can optionally include locations.

id   string  optional  

The id of an existing record in the school_sites table.

name   string  optional  

This field is required when school_sites is present. Must not be greater than 255 characters. Example: kwz

phone   string  optional  

This field is required when school_sites is present. Must not be greater than 20 characters. Example: ctdtrkdqminki

address   string  optional  

This field is required when school_sites is present. Must not be greater than 255 characters. Example: o

email   string  optional  

This field is required when school_sites is present. Must be a valid email address. Must not be greater than 255 characters. Example: leffler.reymundo@example.org

locations   object[]  optional  
id   string  optional  

The id of an existing record in the locations table.

name   string  optional  

This field is required when school_sites.*.locations is present. Must not be greater than 255 characters. Example: aw

description   string  optional  

Example: Voluptas ut non eligendi doloribus ducimus.

School - Archive a Specific School

requires authentication

This endpoint allows the authenticated administrator to archive a specific school by changing its status to "archived". This action does not delete the school from the database.

Example request:
curl --request DELETE \
    "https://apialeosapp.xioagency.com/api/setting/schools/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/schools/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "School archived successfully."
}
 

Example response (404):


{
    "message": "School not found or unauthorized."
}
 

Request      

DELETE api/setting/schools/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the school to archive. Example: 1

Level - Division Categories - All Categories for Administrative Schools

requires authentication

This endpoint retrieves all division categories associated with the authenticated administrative user's schools. Optionally, archived categories can be retrieved using the only_archived parameter.

Usage

How to Send Parameters

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/level/division-categories?per_page=15&only_archived=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories"
);

const params = {
    "per_page": "15",
    "only_archived": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 1,
            "nickname": "Primary Division",
            "description": "This is the primary division category.",
            "status": "archived",
            "school": {
                "id": 1,
                "nickname": "Wildcats",
                "address": "123 Main St"
            },
            "created_at": "2025-01-17T12:00:00.000000Z",
            "updated_at": "2025-01-17T12:00:00.000000Z"
        }
    ],
    "links": {
        "first": "http://example.com/api/setting/level/division-categories?page=1",
        "last": "http://example.com/api/setting/level/division-categories?page=5",
        "prev": null,
        "next": "http://example.com/api/setting/level/division-categories?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 5,
        "path": "http://example.com/api/setting/level/division-categories",
        "per_page": 10,
        "to": 10,
        "total": 50
    }
}
 

Example response (404):


{
    "message": "No schools associated with this user."
}
 

Request      

GET api/setting/level/division-categories

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

per_page   integer  optional  

optional Number of records per page. Defaults to 10. Example: 15

only_archived   boolean  optional  

optional If true, retrieves only archived categories. Default is false. Example: true

Level - Division Categories - Create a New Category

requires authentication

This endpoint allows the authenticated administrative user to create a new division category associated with a specific school. The school must belong to the authenticated user.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"nickname\": \"Primary Division\",
    \"description\": \"This is the primary division category.\",
    \"status\": \"active\",
    \"school_id\": 1
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "nickname": "Primary Division",
    "description": "This is the primary division category.",
    "status": "active",
    "school_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Division category created successfully",
    "category": {
        "id": 1,
        "nickname": "Primary Division",
        "description": "This is the primary division category.",
        "status": "active",
        "school_id": 1,
        "creator_id": 5,
        "created_at": "2025-01-17T12:00:00.000000Z",
        "updated_at": "2025-01-17T12:00:00.000000Z"
    }
}
 

Example response (404):


{
    "message": "School not found or unauthorized."
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "nickname": [
            "The nickname field is required."
        ]
    }
}
 

Request      

POST api/setting/level/division-categories

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

nickname   string   

The nickname of the division category. Example: Primary Division

description   string   

A description of the division category. Example: This is the primary division category.

status   string   

The status of the division category. Must be one of 'active' or 'inactive'. Example: active

school_id   integer   

The ID of the school associated with the division category. Example: 1

Level - Division Categories - Show a Specific Category

requires authentication

This endpoint allows the authenticated administrative user to retrieve the details of a specific division category, including its associated school. The user must be the administrator of the associated school.

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/level/division-categories/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "nickname": "Primary Division",
    "description": "This is the primary division category.",
    "status": "active",
    "school": {
        "id": 1,
        "nickname": "Wildcats",
        "address": "123 Main St"
    },
    "created_at": "2025-01-17T12:00:00.000000Z",
    "updated_at": "2025-01-17T12:00:00.000000Z"
}
 

Example response (404):


{
    "message": "Division category not found or unauthorized."
}
 

Request      

GET api/setting/level/division-categories/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the division category to retrieve. Example: 1

Level - Division Categories - Update a Category

requires authentication

This endpoint allows the authenticated administrative user to update the details of a specific division category. The user must be the administrator of the associated school. Partial updates are allowed.

Example request:
curl --request PUT \
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"nickname\": \"Primary Division\",
    \"description\": \"Updated description.\",
    \"status\": \"inactive\",
    \"school_id\": 2
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "nickname": "Primary Division",
    "description": "Updated description.",
    "status": "inactive",
    "school_id": 2
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Division category updated successfully",
    "category": {
        "id": 1,
        "nickname": "Primary Division",
        "description": "Updated description.",
        "status": "inactive",
        "school_id": 2,
        "creator_id": 5,
        "created_at": "2025-01-17T12:00:00.000000Z",
        "updated_at": "2025-01-17T12:30:00.000000Z"
    }
}
 

Example response (403):


{
    "message": "The selected school is not authorized."
}
 

Example response (404):


{
    "message": "Division category not found or unauthorized."
}
 

Request      

PUT api/setting/level/division-categories/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the division category to update. Example: 1

Body Parameters

nickname   string  optional  

optional The nickname of the division category. Example: Primary Division

description   string  optional  

optional A description of the division category. Example: Updated description.

status   string  optional  

optional The status of the division category. Must be one of 'active' or 'inactive'. Example: inactive

school_id   integer  optional  

optional The ID of the school associated with the division category. Example: 2

Level - Division Categories - Archive a Category

requires authentication

This endpoint allows the authenticated administrator to archive a division category by changing its status to "archived". This action does not delete the category from the database.

Example request:
curl --request DELETE \
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/division-categories/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Division category archived successfully."
}
 

Example response (404):


{
    "message": "Division category not found or unauthorized."
}
 

Request      

DELETE api/setting/level/division-categories/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the division category to archive. Example: 1

Level - Learning Stages - All Stages for Administrative Schools

requires authentication

This endpoint retrieves all learning stages associated with the authenticated administrative user's schools. Optionally, archived stages can be retrieved using the only_archived parameter.

Usage

How to Send Parameters

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/level/learning-stages?per_page=15&only_archived=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages"
);

const params = {
    "per_page": "15",
    "only_archived": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 1,
            "nickname": "Kindergarten",
            "description": "Learning stage for children aged 3-5.",
            "status": "archived",
            "school": {
                "id": 1,
                "nickname": "Wildcats",
                "address": "123 Main St"
            },
            "created_at": "2025-01-17T12:00:00.000000Z",
            "updated_at": "2025-01-17T12:00:00.000000Z"
        }
    ],
    "links": {
        "first": "http://example.com/api/setting/level/learning-stages?page=1",
        "last": "http://example.com/api/setting/level/learning-stages?page=5",
        "prev": null,
        "next": "http://example.com/api/setting/level/learning-stages?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 5,
        "path": "http://example.com/api/setting/level/learning-stages",
        "per_page": 10,
        "to": 10,
        "total": 50
    }
}
 

Example response (404):


{
    "message": "No schools associated with this user."
}
 

Request      

GET api/setting/level/learning-stages

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

per_page   integer  optional  

optional Number of records per page. Defaults to 10. Example: 15

only_archived   boolean  optional  

optional If true, retrieves only archived learning stages. Default is false. Example: true

Level - Learning Stages - Create a New Stage

requires authentication

This endpoint allows the authenticated administrative user to create a new learning stage associated with a specific school. The school must belong to the authenticated user.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"nickname\": \"Kindergarten\",
    \"description\": \"Stage for children aged 3-5.\",
    \"status\": \"active\",
    \"school_id\": 1
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "nickname": "Kindergarten",
    "description": "Stage for children aged 3-5.",
    "status": "active",
    "school_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Learning stage created successfully",
    "learning_stage": {
        "id": 1,
        "nickname": "Kindergarten",
        "description": "Stage for children aged 3-5.",
        "status": "active",
        "school_id": 1,
        "creator_id": 5,
        "created_at": "2025-01-17T12:00:00.000000Z",
        "updated_at": "2025-01-17T12:00:00.000000Z"
    }
}
 

Example response (404):


{
    "message": "School not found or unauthorized."
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "nickname": [
            "The nickname field is required."
        ]
    }
}
 

Request      

POST api/setting/level/learning-stages

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

nickname   string   

The nickname of the learning stage. Example: Kindergarten

description   string   

A description of the learning stage. Example: Stage for children aged 3-5.

status   string   

The status of the learning stage. Must be one of 'active' or 'inactive'. Example: active

school_id   integer   

The ID of the school associated with the learning stage. Example: 1

Level - Learning Stages - Show a Specific Stage

requires authentication

This endpoint allows the authenticated administrative user to retrieve the details of a specific learning stage. The user must be the administrator of the associated school.

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/level/learning-stages/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "nickname": "Kindergarten",
    "description": "Stage for children aged 3-5.",
    "status": "active",
    "school": {
        "id": 1,
        "nickname": "Wildcats",
        "address": "123 Main St"
    },
    "created_at": "2025-01-17T12:00:00.000000Z",
    "updated_at": "2025-01-17T12:00:00.000000Z"
}
 

Example response (404):


{
    "message": "Learning stage not found or unauthorized."
}
 

Request      

GET api/setting/level/learning-stages/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the learning stage to retrieve. Example: 1

Level - Learning Stages - Update a Specific Stage

requires authentication

This endpoint allows the authenticated administrative user to update the details of a specific learning stage. Partial updates are allowed, and the user must be the administrator of the associated school.

Example request:
curl --request PUT \
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"nickname\": \"Kindergarten\",
    \"description\": \"Updated description.\",
    \"status\": \"inactive\",
    \"school_id\": 2
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "nickname": "Kindergarten",
    "description": "Updated description.",
    "status": "inactive",
    "school_id": 2
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Learning stage updated successfully",
    "learning_stage": {
        "id": 1,
        "nickname": "Updated Kindergarten",
        "description": "Updated description for the learning stage.",
        "status": "inactive",
        "school_id": 2,
        "creator_id": 5,
        "created_at": "2025-01-17T12:00:00.000000Z",
        "updated_at": "2025-01-17T12:30:00.000000Z"
    }
}
 

Example response (403):


{
    "message": "The selected school is not authorized."
}
 

Example response (404):


{
    "message": "Learning stage not found or unauthorized."
}
 

Request      

PUT api/setting/level/learning-stages/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the learning stage to update. Example: 1

Body Parameters

nickname   string  optional  

optional The nickname of the learning stage. Example: Kindergarten

description   string  optional  

optional A description of the learning stage. Example: Updated description.

status   string  optional  

optional The status of the learning stage. Must be one of 'active' or 'inactive'. Example: inactive

school_id   integer  optional  

optional The ID of the school associated with the learning stage. Example: 2

Level - Learning Stages - Archive a Learning Stage

requires authentication

This endpoint allows the authenticated administrator to archive a learning stage by changing its status to "archived". This action does not delete the stage from the database.

Example request:
curl --request DELETE \
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/learning-stages/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Learning stage archived successfully."
}
 

Example response (404):


{
    "message": "Learning stage not found or unauthorized."
}
 

Request      

DELETE api/setting/level/learning-stages/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the learning stage to archive. Example: 1

Level - Level - List All Levels for Administrative Schools

requires authentication

This endpoint retrieves all levels associated with any school managed by the authenticated administrative user. Each level includes its related learning stage, division category, and school. Optionally, archived levels can be retrieved using the only_archived parameter.

Usage

How to Send Parameters

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/level/levels?per_page=15&only_archived=1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/levels"
);

const params = {
    "per_page": "15",
    "only_archived": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 1,
            "nickname": "Level A",
            "name": "First Level",
            "description": "The first level of the learning stage.",
            "status": "archived",
            "learning_stage": {
                "id": 1,
                "nickname": "Kindergarten",
                "description": "Stage for children aged 3-5."
            },
            "division_category": {
                "id": 1,
                "nickname": "Primary Division",
                "description": "This is the primary division category."
            },
            "school": {
                "id": 1,
                "nickname": "Wildcats",
                "address": "123 Main St"
            },
            "created_at": "2025-01-17T12:00:00.000000Z",
            "updated_at": "2025-01-17T12:00:00.000000Z"
        }
    ],
    "links": {
        "first": "http://example.com/api/setting/level/levels?page=1",
        "last": "http://example.com/api/setting/level/levels?page=5",
        "prev": null,
        "next": "http://example.com/api/setting/level/levels?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 5,
        "path": "http://example.com/api/setting/level/levels",
        "per_page": 10,
        "to": 10,
        "total": 50
    }
}
 

Example response (404):


{
    "message": "No schools associated with this user."
}
 

Request      

GET api/setting/level/levels

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

per_page   integer  optional  

optional Number of records per page. Defaults to 10. Example: 15

only_archived   boolean  optional  

optional If true, retrieves only archived levels. Default is false. Example: true

Level - Level - Create a New Level

requires authentication

This endpoint allows the authenticated administrator to create a new level associated with a specific learning stage, division category, and school. It validates that the school belongs to the administrator.

Example request:
curl --request POST \
    "https://apialeosapp.xioagency.com/api/setting/level/levels" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"nickname\": \"Beginner\",
    \"name\": \"Level 1\",
    \"description\": \"Entry-level stage for new students.\",
    \"learning_stage_id\": 1,
    \"division_category_id\": 2,
    \"school_id\": 3,
    \"status\": \"active\"
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/levels"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "nickname": "Beginner",
    "name": "Level 1",
    "description": "Entry-level stage for new students.",
    "learning_stage_id": 1,
    "division_category_id": 2,
    "school_id": 3,
    "status": "active"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
   "message": "Level created successfully.",
   "level": { ... }
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "school_id": [
            "The selected school does not belong to the authenticated user."
        ]
    }
}
 

Request      

POST api/setting/level/levels

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

nickname   string   

The level's nickname. Example: Beginner

name   string   

The level's name. Example: Level 1

description   string  optional  

optional A description of the level. Example: Entry-level stage for new students.

learning_stage_id   integer   

The ID of the associated learning stage. Example: 1

division_category_id   integer   

The ID of the associated division category. Example: 2

school_id   integer   

The ID of the associated school. Example: 3

status   string   

The status of the level (active or inactive). Example: active

Level - Level - Show Specific Level

requires authentication

This endpoint allows the authenticated administrator to retrieve the details of a specific level. The level must be associated with a school managed by the administrator.

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/level/levels/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/levels/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "nickname": "Beginner",
    "name": "Level 1",
    "description": "Entry-level stage for new students.",
    "learning_stage": {
        "id": 1,
        "nickname": "Kindergarten"
    },
    "division_category": {
        "id": 2,
        "nickname": "Primary Division"
    },
    "school": {
        "id": 3,
        "nickname": "Wildcats"
    },
    "status": "active",
    "created_at": "2025-01-17T12:00:00.000000Z",
    "updated_at": "2025-01-17T12:00:00.000000Z"
}
 

Example response (404):


{
    "message": "Level not found or unauthorized."
}
 

Request      

GET api/setting/level/levels/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the level to retrieve. Example: 1

Level - Level - Update a Specific Level

requires authentication

This endpoint allows the authenticated administrator to update the details of a specific level. It validates that the level belongs to a school managed by the administrator.

Example request:
curl --request PUT \
    "https://apialeosapp.xioagency.com/api/setting/level/levels/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"nickname\": \"Advanced\",
    \"name\": \"Level 2\",
    \"description\": \"Intermediate-level stage for students.\",
    \"learning_stage_id\": 1,
    \"division_category_id\": 2,
    \"school_id\": 3,
    \"status\": \"active\"
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/levels/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "nickname": "Advanced",
    "name": "Level 2",
    "description": "Intermediate-level stage for students.",
    "learning_stage_id": 1,
    "division_category_id": 2,
    "school_id": 3,
    "status": "active"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
   "message": "Level updated successfully.",
   "level": { ... }
}
 

Example response (404):


{
    "message": "Level not found or unauthorized."
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "nickname": [
            "The nickname field is required."
        ],
        "school_id": [
            "The selected school does not belong to the authenticated user."
        ]
    }
}
 

Request      

PUT api/setting/level/levels/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the level to update. Example: 1

Body Parameters

nickname   string   

The level's nickname. Example: Advanced

name   string   

The level's name. Example: Level 2

description   string  optional  

optional A description of the level. Example: Intermediate-level stage for students.

learning_stage_id   integer   

The ID of the associated learning stage. Example: 1

division_category_id   integer   

The ID of the associated division category. Example: 2

school_id   integer   

The ID of the associated school. Example: 3

status   string   

The status of the level (active or inactive). Example: active

Level - Level - Archive a Level

requires authentication

This endpoint allows the authenticated administrator to archive a level by changing its status to "archived". This action does not delete the level from the database.

Example request:
curl --request DELETE \
    "https://apialeosapp.xioagency.com/api/setting/level/levels/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/level/levels/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Level archived successfully."
}
 

Example response (404):


{
    "message": "Level not found or unauthorized."
}
 

Request      

DELETE api/setting/level/levels/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The ID of the level to archive. Example: 1

Configuration - Show the template for a specific setting by slug.

requires authentication

Example request:
curl --request GET \
    --get "https://apialeosapp.xioagency.com/api/setting/configuration/setting" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/configuration/setting"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "template": {
        "layout": "settings",
        "fields": [
            {
                "name": "site_name",
                "type": "text"
            },
            {
                "name": "email",
                "type": "email"
            }
        ]
    }
}
 

Example response (404):


{
    "message": "Template not found for the provided slug."
}
 

Request      

GET api/setting/configuration/{slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

slug   string   

The slug of the module. Example: setting

Configuration - Update or reset color settings for the authenticated user.

requires authentication

Example request:
curl --request PUT \
    "https://apialeosapp.xioagency.com/api/setting/configuration/colors" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"changes\": [
        {
            \"name\": \"menus\",
            \"color\": \"#FF5733\"
        },
        {
            \"name\": \"header\",
            \"color\": \"#000000\"
        }
    ],
    \"reset\": true
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/configuration/colors"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "changes": [
        {
            "name": "menus",
            "color": "#FF5733"
        },
        {
            "name": "header",
            "color": "#000000"
        }
    ],
    "reset": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "response": {
        "menus": "#FF5733",
        "header": "#000000",
        "background": "#f8f7fa",
        "typography": "#1F1F1F"
    },
    "status": "success",
    "message": "Colors updated successfully."
}
 

Request      

PUT api/setting/configuration/colors

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

changes   string[]  optional  

optional An array of changes where each item contains a name (color key) and color (hex value).

name   string   

The name of the color key to update. Must be one of menus, header, background, or typography. Example: "menus"

color   string   

The hexadecimal color value. Example: "#FF5733"

reset   boolean  optional  

optional If true, resets all colors to their default values. Example: true

Configuration - Update a module's configuration.

requires authentication

Example request:
curl --request PUT \
    "https://apialeosapp.xioagency.com/api/setting/configuration" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module\": \"\\\"1\\\"\",
    \"plural_name\": \"\\\"Users\\\"\",
    \"singular_name\": \"\\\"User\\\"\",
    \"plural_name_es\": \"\\\"Usuarios\\\"\",
    \"singular_name_es\": \"\\\"Usuario\\\"\",
    \"section\": \"\\\"general\\\"\",
    \"form\": \"\\\"profile_form\\\"\",
    \"subsection\": \"\\\"details\\\"\",
    \"form_section\": \"\\\"address_section\\\"\",
    \"fields\": [
        {
            \"label_en\": \"First Name\",
            \"label_es\": \"Nombre\"
        }
    ],
    \"custom_fields\": [
        {
            \"label_en\": \"Gender\",
            \"label_es\": \"GΓ©nero\",
            \"type\": \"select\",
            \"options\": [
                {
                    \"name_en\": \"Male\",
                    \"name_es\": \"Hombre\"
                },
                {
                    \"name_en\": \"Female\",
                    \"name_es\": \"Mujer\"
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://apialeosapp.xioagency.com/api/setting/configuration"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "module": "\"1\"",
    "plural_name": "\"Users\"",
    "singular_name": "\"User\"",
    "plural_name_es": "\"Usuarios\"",
    "singular_name_es": "\"Usuario\"",
    "section": "\"general\"",
    "form": "\"profile_form\"",
    "subsection": "\"details\"",
    "form_section": "\"address_section\"",
    "fields": [
        {
            "label_en": "First Name",
            "label_es": "Nombre"
        }
    ],
    "custom_fields": [
        {
            "label_en": "Gender",
            "label_es": "GΓ©nero",
            "type": "select",
            "options": [
                {
                    "name_en": "Male",
                    "name_es": "Hombre"
                },
                {
                    "name_en": "Female",
                    "name_es": "Mujer"
                }
            ]
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "response": {
        "id": 1,
        "parent_id": 1,
        "language": "en",
        "colors": {
            "primary": "#000000",
            "secondary": "#FFFFFF"
        },
        "icons": "default",
        "url": "https://example.com",
        "setting": {
            "modules": [
                {
                    "id": "1",
                    "plural_name": "Users",
                    "singular_name": "User",
                    "plural_name_es": "Usuarios",
                    "singular_name_es": "Usuario",
                    "sections": [
                        {
                            "default_name": "general",
                            "forms": [
                                {
                                    "default_name": "profile_form",
                                    "fields": [
                                        {
                                            "label_en": "First Name",
                                            "label_es": "Nombre"
                                        }
                                    ],
                                    "custom_fields": [
                                        {
                                            "name": "gender",
                                            "type": "select",
                                            "label_en": "Gender",
                                            "label_es": "Género",
                                            "options": [
                                                {
                                                    "name_en": "Male",
                                                    "name_es": "Hombre",
                                                    "value": "Male"
                                                },
                                                {
                                                    "name_en": "Female",
                                                    "name_es": "Mujer",
                                                    "value": "Female"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        "created_at": "2025-01-10T12:00:00.000000Z",
        "updated_at": "2025-01-10T12:00:00.000000Z"
    },
    "status": "success",
    "message": "The configuration was updated correctly! To see the changes, please reload the page."
}
 

Example response (404):


{
    "message": "Module not found."
}
 

Request      

PUT api/setting/configuration

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

module   string   

The ID of the module to update. Example: "1"

plural_name   string   

The plural name of the module in English. Example: "Users"

singular_name   string   

The singular name of the module in English. Example: "User"

plural_name_es   string   

The plural name of the module in Spanish. Example: "Usuarios"

singular_name_es   string   

The singular name of the module in Spanish. Example: "Usuario"

section   string   

The default name of the section to update. Example: "general"

form   string  optional  

optional The default name of the form to update within the section. Example: "profile_form"

subsection   string  optional  

optional The default name of the subsection to update within the section. Example: "details"

form_section   string  optional  

optional The default name of the form section to update. Example: "address_section"

fields   string[]   

An array of fields to update in the form. Each field must include label_en and label_es.

custom_fields   string[]  optional  

optional An array of custom fields to add to the form. Each field must include label_en, label_es, type, and optional options.