AlBaash247

API Documentation

Base URL: /api ยท Auth: Bearer token (Sanctum), except Auth ping, register, and login.

Click any method, URL, header, body, or response to copy it.

Auth

Ping

GET /auth/ping

Header

Accept: "application/json"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": {
        "pong": "PONG!"
    },
    "message": "Ping retrieved successfully."
}

Register

POST /auth/register

Header

Accept: "application/json"
Content-Type: "application/x-www-form-urlencoded"

Body (x-www-form)

name: "John Doe"
email: "john@example.com"
password: "secret"
c_password: "secret"

Expected JSON Response

{
    "success": true,
    "data": {
        "token": "1|plainTextSanctumToken",
        "name": "John Doe"
    },
    "message": "User register successfully."
}

Login

POST /auth/login

Header

Accept: "application/json"
Content-Type: "application/x-www-form-urlencoded"

Body (x-www-form)

email: "john@example.com"
password: "secret"

Expected JSON Response

{
    "success": true,
    "data": {
        "token": "1|plainTextSanctumToken",
        "name": "John Doe"
    },
    "message": "User login successfully."
}

Get User

GET /auth/user

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com",
        "email_verified_at": null,
        "created_at": "2026-05-01T12:00:00.000000Z",
        "updated_at": "2026-05-01T12:00:00.000000Z"
    },
    "message": "User retrieved successfully."
}

Logout

GET /auth/logout

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": [],
    "message": "User logged out successfully."
}

Tasks

Ping

GET /tasks/ping

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": {
        "pong": "PONG with Auth!"
    },
    "message": "Ping retrieved successfully."
}

List Tasks

GET /tasks

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "name": "Buy groceries",
            "done": false,
            "description": "Milk and bread",
            "task_category_id": 1,
            "task_category_name": "Personal",
            "created_at": "2026-05-01T12:00:00.000000Z",
            "updated_at": "2026-05-01T12:00:00.000000Z"
        }
    ],
    "message": " Tasks retrieved successfully."
}

Create Task

POST /tasks

Header

Accept: "application/json"
Authorization: "Bearer {token}"
Content-Type: "application/x-www-form-urlencoded"

Body (x-www-form)

name: "Buy groceries"
description: "Milk and bread"
done: 0
task_category_id: 1

Expected JSON Response

{
    "success": true,
    "data": {
        "id": 1,
        "user_id": 1,
        "name": "Buy groceries",
        "done": false,
        "description": "Milk and bread",
        "task_category_id": 1,
        "task_category_name": "Personal",
        "created_at": "2026-05-01T12:00:00.000000Z",
        "updated_at": "2026-05-01T12:00:00.000000Z"
    },
    "message": "Task created successfully."
}

Get Task

GET /tasks/{task}

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": {
        "id": 1,
        "user_id": 1,
        "name": "Buy groceries",
        "done": false,
        "description": "Milk and bread",
        "task_category_id": 1,
        "task_category_name": "Personal",
        "created_at": "2026-05-01T12:00:00.000000Z",
        "updated_at": "2026-05-01T12:00:00.000000Z"
    },
    "message": "Task retrieved successfully."
}

Update Task

PUT /tasks/{task}

Header

Accept: "application/json"
Authorization: "Bearer {token}"
Content-Type: "application/x-www-form-urlencoded"

Body (x-www-form)

name: "Buy groceries"
description: "Milk and bread"
done: 1
task_category_id: 1

Expected JSON Response

{
    "success": true,
    "data": {
        "id": 1,
        "user_id": 1,
        "name": "Buy groceries",
        "done": true,
        "description": "Milk and bread",
        "task_category_id": 1,
        "task_category_name": "Personal",
        "created_at": "2026-05-01T12:00:00.000000Z",
        "updated_at": "2026-05-01T12:00:00.000000Z"
    },
    "message": "Tasks updated successfully."
}

Delete Task

DELETE /tasks/{task}

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": [],
    "message": "Tasks deleted successfully."
}

Tasks Categories

Ping

GET /task_categories/ping

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": {
        "pong": "PONG with Auth!"
    },
    "message": "Ping retrieved successfully."
}

List Categories

GET /task_categories

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Personal",
            "date_created": "2026-05-08 12:00:00",
            "date_updated": "2026-05-08 12:00:00"
        },
        {
            "id": 2,
            "name": "Work",
            "date_created": "2026-05-08 12:00:00",
            "date_updated": "2026-05-08 12:00:00"
        }
    ],
    "message": "Task categories retrieved successfully."
}

Create Category

POST /task_categories

Header

Accept: "application/json"
Authorization: "Bearer {token}"
Content-Type: "application/x-www-form-urlencoded"

Body (x-www-form)

name: "Shopping"

Expected JSON Response

{
    "success": true,
    "data": {
        "id": 3,
        "name": "Shopping",
        "date_created": "2026-05-08 12:00:00",
        "date_updated": "2026-05-08 12:00:00"
    },
    "message": "Task category created successfully."
}

Get Category

GET /task_categories/{task_category}

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": {
        "id": 1,
        "name": "Personal",
        "date_created": "2026-05-08 12:00:00",
        "date_updated": "2026-05-08 12:00:00"
    },
    "message": "Task category retrieved successfully."
}

Update Category

PUT /task_categories/{task_category}

Header

Accept: "application/json"
Authorization: "Bearer {token}"
Content-Type: "application/x-www-form-urlencoded"

Body (x-www-form)

name: "Updated Name"

Expected JSON Response

{
    "success": true,
    "data": {
        "id": 1,
        "name": "Updated Name",
        "date_created": "2026-05-08 12:00:00",
        "date_updated": "2026-05-08 12:00:00"
    },
    "message": "Task category updated successfully."
}

Delete Category

DELETE /task_categories/{task_category}

Header

Accept: "application/json"
Authorization: "Bearer {token}"

Body (x-www-form)

No body

Expected JSON Response

{
    "success": true,
    "data": [],
    "message": "Task category deleted successfully."
}