Body Type
This section covers the API endpoints for managing body types in the admin panel.
List Body Types
GET /v1/admin/body-types
Returns a paginated list of all body types.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
search_text | string | Search body types by name |
filter[active] | boolean | Filter by active status |
filter[name] | string | Filter by exact name match |
filter[trashed] | boolean | Include trashed body types |
sort | string | Sort by field (prefix with - for descending) |
per_page | integer | Number of items per page. Defaults to 10 |
list | boolean | Return simplified list format |
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/admin/body-types?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://testing-api.sumaya369.net/v1/admin/body-types?page=1",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/body-types?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "التالي »",
"active": false
}
],
"next_page_url": null,
"path": "http://testing-api.sumaya369.net/v1/admin/body-types",
"per_page": 10,
"prev_page_url": null,
"to": 2,
"total": 2,
"bodyTypes": [
{
"id": "03cc1030-ef59-11ef-aa3c-ef2f037a7eb5",
"name": "الجسد المشاعري",
"active": true,
"created_at": "2025-02-20 10:05:06",
"updated_at": "2025-02-20 10:05:06"
},
{
"id": "fe74f650-ef58-11ef-9d8f-134dba7d30a2",
"name": "الجسد الروحي",
"active": true,
"created_at": "2025-02-20 10:04:57",
"updated_at": "2025-02-20 10:04:57"
}
]
},
"status_code": 200
}
Create Body Type
POST /v1/admin/body-types
Create a new body type.
Request Body
| Parameter | Type | Description |
|---|---|---|
name | string | Required. Body type name (3-255 characters) |
active | boolean | Required. Body type active status |
Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "5a548630-07ea-11f0-8603-8dd6818faa74",
"name": "الجسد المتجسد",
"active": true,
"created_at": "2025-03-23 16:25:56",
"updated_at": "2025-03-23 16:25:56"
},
"status_code": 200
}
Get Body Type
GET /v1/admin/body-types/{id}
Retrieve details of a specific body type.
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "03cc1030-ef59-11ef-aa3c-ef2f037a7eb5",
"name": "الجسد المشاعري",
"active": true,
"created_at": "2025-02-20 10:05:06",
"updated_at": "2025-02-20 10:05:06"
},
"status_code": 200
}
Update Body Type
PATCH /v1/admin/body-types/{id}
Update an existing body type.
Request Body
| Parameter | Type | Description |
|---|---|---|
name | string | Optional. Body type name (3-255 characters) |
active | boolean | Optional. Body type active status |
Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "5191f140-07ea-11f0-b856-e95b81af804b",
"name": "الجسد 2",
"active": true,
"created_at": "2025-03-23 16:25:42",
"updated_at": "2025-03-23 16:26:24"
},
"status_code": 200
}
Delete Body Types
DELETE /v1/admin/body-types
Delete one or more body types.
Request Body
| Parameter | Type | Description |
|---|---|---|
ids | array | Required. Array of body type UUIDs to delete |
ids.* | string | Required. UUID format |
Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}
Authorization
All body type endpoints require admin authorization. The user must have the appropriate permissions to perform these operations.
Notes
- Body types with existing courses cannot be deleted
- Name must be unique across all body types