Tag
This section covers the API endpoints for managing tags in the admin panel.
List Tags
GET /v1/admin/tags
Returns a paginated list of all tags.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
sort | string | Sort direction (asc or desc). Defaults to desc |
orderBy | string | Field to sort by. Defaults to created_at |
per_page | integer | Number of items per page. Defaults to 10 |
list | boolean | If true, returns an unpaginated list of all tags |
search_text | string | Search tags by name |
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/admin/tags?page=1",
"from": 1,
"last_page": 2,
"last_page_url": "http://testing-api.sumaya369.net/v1/admin/tags?page=2",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/tags?page=1",
"label": "1",
"active": true
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/tags?page=2",
"label": "2",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/tags?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://testing-api.sumaya369.net/v1/admin/tags?page=2",
"path": "http://testing-api.sumaya369.net/v1/admin/tags",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 17,
"tags": [
{
"id": "6071a8f0-b5f4-11ef-82bb-2b8977d4a0af",
"name": "كلام",
"color": "#98DEDE",
"pivot": null,
"created_at": "2024-12-09 09:11:06",
"updated_at": "2024-12-09 09:11:06"
},
{
"id": "606dabd0-b5f4-11ef-aabc-61369c39f52f",
"name": "الصدمة",
"color": "#98DEDE",
"pivot": null,
"created_at": "2024-12-09 09:11:06",
"updated_at": "2024-12-09 09:11:06"
},
{
"id": "2d9d93e0-4f1a-11ef-abb8-c12b32cfbf21",
"name": "dfsdfsdf",
"color": "#98DEDE",
"pivot": null,
"created_at": "2024-07-31 11:52:12",
"updated_at": "2024-07-31 11:52:12"
},
{
"id": "2da04540-4f1a-11ef-83cf-0d4d22161236",
"name": "sdfsdfsdf",
"color": "#98DEDE",
"pivot": null,
"created_at": "2024-07-31 11:52:12",
"updated_at": "2024-07-31 11:52:12"
},
{
"id": "e1c29880-fb45-11ee-bc1f-411ddde840e6",
"name": "مادة للتطوير",
"color": "#F7F7F7FF",
"pivot": null,
"created_at": "2024-04-15 19:33:25",
"updated_at": "2024-04-15 19:33:25"
},
{
"id": "c18a0c70-fb45-11ee-9590-2927458bbee4",
"name": "مادة للتنظيف",
"color": "#F8F8F8FF",
"pivot": null,
"created_at": "2024-04-15 19:32:31",
"updated_at": "2024-04-15 19:34:05"
},
{
"id": "f143c2d0-fb24-11ee-a115-5717ccd382dd",
"name": "مفاهيم بسيطة",
"color": "#CD5F0CFF",
"pivot": null,
"created_at": "2024-04-15 15:37:38",
"updated_at": "2025-03-17 14:38:12"
},
{
"id": "e4b89f90-fb24-11ee-b8da-85ef5b834ca6",
"name": "مفاهيم متوسطة",
"color": "#0BED26FF",
"pivot": null,
"created_at": "2024-04-15 15:37:16",
"updated_at": "2025-03-13 11:15:53"
},
{
"id": "d41a8580-fb24-11ee-9672-ad75a3f41a4a",
"name": "تطبيقات متوسطة",
"color": "#E296E2FF",
"pivot": null,
"created_at": "2024-04-15 15:36:49",
"updated_at": "2024-04-15 15:36:49"
},
{
"id": "c60fa260-fb24-11ee-af71-350be8551fdb",
"name": "تطبيقات بسيطة",
"color": "#EA0E4FFF",
"pivot": null,
"created_at": "2024-04-15 15:36:25",
"updated_at": "2025-03-18 14:01:58"
}
]
},
"status_code": 200
}
Create Tag
POST /v1/admin/tags
Create a new tag.
Request Body
| Parameter | Type | Rules |
|---|---|---|
name | string | Required, 3-255 characters |
color | string | Required, unique, valid hex color code (#RRGGBB or #RRGGBBAA) |
Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "e16d46e0-07e8-11f0-81ef-1dc672b12d29",
"name": "Schiller Loaf",
"color": "#98DED0",
"created_at": "2025-03-23 16:15:24",
"updated_at": "2025-03-23 16:15:24"
},
"status_code": 200
}
Get Tag
GET /v1/admin/tags/{id}
Retrieve a specific tag by ID.
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "6071a8f0-b5f4-11ef-82bb-2b8977d4a0af",
"name": "كلام",
"color": "#98DEDE",
"created_at": "2024-12-09 09:11:06",
"updated_at": "2024-12-09 09:11:06"
},
"status_code": 200
}
Update Tag
PATCH /v1/admin/tags/{id}
Update an existing tag.
Request Body
| Parameter | Type | Rules |
|---|---|---|
name | string | Optional, 3-255 characters |
color | string | Optional, unique, valid hex color code (#RRGGBB or #RRGGBBAA) |
Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "e16d46e0-07e8-11f0-81ef-1dc672b12d29",
"name": "test",
"color": "#98DED1",
"created_at": "2025-03-23 16:15:24",
"updated_at": "2025-03-23 16:15:54"
},
"status_code": 200
}
Delete Tags
DELETE /v1/admin/tags
Delete one or multiple tags.
Request Body
| Parameter | Type | Rules |
|---|---|---|
ids | array | Required array of tag UUIDs |
Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}
Authorization
All tag endpoints require admin authorization. The user must have the appropriate permissions to perform these operations.