> ## Documentation Index
> Fetch the complete documentation index at: https://theteam-13fc7f49.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Landing Page

> Landing page configuration endpoints: fetch, update (with images), sync trainings/exams positions, manage links, featured categories, and partner companies.

**Overview**

The landing page is a **single record per company** (or a single global record depending on your deployment).\
It includes sections like:

* Header + header images
* Featured categories
* Trainings and exams showcased on the landing page
* Partner companies
* Banner + banner image
* Footer data
* Quick links and social links

***

**Common Headers**

Most endpoints require authentication.

| Name | Value |
| - | - |
| Content-Type | application/json |
| Authorization Type |  Bearer Token  |
| Auth Credential | `{{token}}` |

For endpoints that upload images, use:

| Name | Value |
| - | - |
| Content-Type | multipart/form-data |

***

# Get Landing Page

**GET** /api/landing-page

Retrieves the landing page with all related content.

**Included Relationships**

The response includes:

* `links`
* `featuredCategories` + `feat_category_image`
* `partnerCompanies` + `companyLogo`
* `trainings` (with instructor + images)
* `exams` (with instructor + images)
* `headerImage`, `backgroundImage`, `bannerImage`

Featured categories and partner companies are ordered by `pivot_position`.

**Response**

> [tab] 200
>
> ✅ 200 OK
>
> ```json theme={null}
> {
>   "id": 1,
>   "company_id": 10,
>   "company_name": "My Company",
>   "show_header_section": true,
>   "featured_categories": [],
>   "partner_companies": [],
>   "trainings": [],
>   "exams": [],
>   "headerImage": {
>     "id": 12,
>     "file_name": "1700000000_header.png",
>     "url": "https://example.com/storage/files/1700000000_header.png"
>   }
> }
> ```

# Update Landing Page (Create or Update)

POST /api/landing-page

Creates or updates the landing page for the authenticated user's company.

**Authentication & Company Rules**

* Returns 401 if unauthenticated
* Returns 403 if user does not have `company_id`

### Body (Validation Rules)

**Section Toggles (Booleans)**

| Field | Type | Required | Description |
| - | - | - | - |
| show\_header\_section | boolean | ❌ No | Show/hide header section |
| show\_category\_section | boolean | ❌ No | Show/hide featured categories |
| show\_training\_section | boolean | ❌ No | Show/hide trainings section |
| show\_exams\_section | boolean | ❌ No | Show/hide exams section |
| show\_partner\_company\_section | boolean | ❌ No | Show/hide partner companies |
| show\_banner | boolean | ❌ No | Show/hide banner |

**Company Content**

| Field | Type | Required | Description |
| - | - | - | - |
| company\_name | string | ❌ No | Landing page company name |
| company\_description | string | ❌ No | Landing page company description |
| landing\_page\_primary\_color | string | ❌ No | Hex color without # (size 6) |
| landing\_page\_secondary\_color | string | ❌ No | Hex color without # (size 6) |

**Header Fields**

| Field | Type | Required | Description |
| - | - | - | - |
| header\_title | string | ❌ No | Header title |
| header\_subtitle | string | ❌ No | Header subtitle |
| header\_description | string | ❌ No | Header description |
| header\_registration\_link | url | ❌ No | Registration link |
| header\_call\_to\_action\_link | url | ❌ No | CTA link |

**Banner Fields**

| Field | Type | Required | Description |
| - | - | - | - |
| banner\_title | string | ❌ No | Banner title |
| banner\_call\_to\_action\_link | url | ❌ No | Banner CTA link |

**Footer Fields**

| Field | Type | Required | Description |
| - | - | - | - |
| footer\_address | string | ❌ No | Company address |
| footer\_phone\_number | string | ❌ No | Phone number |
| footer\_mobile\_number | string | ❌ No | Mobile number |
| footer\_contact\_email | email | ❌ No | Contact email |
| footer\_google\_play | url | ❌ No | Google Play link |
| footer\_app\_store | url | ❌ No | App Store link |
| footer\_download\_link | url | ❌ No | Download link |

**Language**

| Field | Type | Required | Description |
| - | - | - | - |
| language | string | ❌ No | 2 letters (regex `^[a-zA-Z]{2}$`) |

**Image Uploads (multipart/form-data)**

| Field | Type | Required | Description |
| - | - | - | - |
| header\_image | file | ❌ No | jpg/jpeg/png/svg, max 5MB |
| header\_background\_image | file | ❌ No | jpg/jpeg/png/svg, max 5MB |
| banner\_image | file | ❌ No | jpg/jpeg/png/svg, max 5MB |

**Response**

> [tab] 200
>
> ✅ 200 OK
>
> ```json theme={null}
> { 
>     "message": "Landing page updated successfully", 
>     "data": 
>     { 
>         "company_id": 10, 
>         "header_title": "Welcome", 
>         "banner_title": "New Courses", 
>         "header_image_id": 12 
>     } 
> } 
> ```

> [tab] 401
>
> ⚠️ 401 Unauthenticated
>
> ```json theme={null}
> { "message": "Unauthenticated." } 
> ```

> [tab] 403
>
> ⚠️ 403 Forbidden
>
> ```json theme={null}
> { "message": "No company_id on your user." } 
> ```

> [tab] 422
>
> ⚠️ 422 Validation Error
>
> ```json theme={null}
> { 
>     "message": "Validation error", 
>     "errors": 
>     { 
>         "landing_page_primary_color": ["The landing page primary color must be 6 characters."] 
>     } 
> } 
> ```

> [tab] 500
>
> ❌ 500 Internal Server Error
>
> ```json theme={null}
> { "message": "Error updating landing page: <error details>" } 
> ```

# Sync Trainings (Attach / Reorder)

POST /api/landing-page/trainings/sync

Selects and orders trainings displayed on the landing page. **Body (Validation Rules)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.