overview

Ingin Menjadi Programmer Handal Namun Enggan Ngoding

December 17, 2025
5 min read
index

API Docs

Base URL: http://localhost:3000/api

Authentication

Register

Create a new user account.

  • URL: /auth/register
  • Method: POST
  • Request Body:
    {
    "name": "John Doe",
    "email": "john@example.com",
    "password": "securepassword123"
    }
  • Success Response (201 Created):
    {
    "success": true,
    "message": "Registration successful",
    "data": {
    "user": {
    "id": 1,
    "email": "john@example.com",
    "name": "John Doe"
    },
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    }
    }

Login

Authenticate a user and retrieve a token.

  • URL: /auth/login
  • Method: POST
  • Request Body:
    {
    "email": "john@example.com",
    "password": "securepassword123"
    }
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Login successful",
    "data": {
    "user": {
    "id": 1,
    "email": "john@example.com",
    "name": "John Doe"
    },
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    }
    }

Boards

Get All Boards

Retrieve all boards owned by the authenticated user.

  • URL: /boards
  • Method: GET
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Boards retrieved successfully",
    "data": [
    {
    "id": 1,
    "title": "My Project",
    "description": "Project management board",
    "backgroundColor": "#0079bf",
    "isPrivate": true,
    "ownerId": 1,
    "createdAt": "2023-10-27T10:00:00.000Z",
    "updatedAt": "2023-10-27T10:00:00.000Z"
    }
    ]
    }

Create Board

Create a new board.

  • URL: /boards
  • Method: POST
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "title": "New Board",
    "description": "Description of the board",
    "backgroundColor": "#0079bf",
    "isPrivate": true
    }
  • Success Response (201 Created):
    {
    "success": true,
    "message": "Board created successfully",
    "data": {
    "id": 2,
    "title": "New Board",
    "description": "Description of the board",
    "backgroundColor": "#0079bf",
    "isPrivate": true,
    "ownerId": 1,
    "createdAt": "2023-10-27T12:00:00.000Z",
    "updatedAt": "2023-10-27T12:00:00.000Z"
    }
    }

Get Board Details

Retrieve a specific board by ID, including its lists and cards.

  • URL: /boards/:id
  • Method: GET
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Board retrieved successfully",
    "data": {
    "id": 1,
    "title": "My Project",
    "lists": [
    {
    "id": 1,
    "title": "To Do",
    "position": 1,
    "cards": [
    {
    "id": 1,
    "title": "Task 1",
    "position": 1
    }
    ]
    }
    ]
    }
    }

Update Board

Update board details.

  • URL: /boards/:id
  • Method: PUT
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "title": "Updated Title",
    "description": "Updated description",
    "backgroundColor": "#ff9f1a"
    }
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Board updated successfully",
    "data": {
    "id": 1,
    "title": "Updated Title",
    "backgroundColor": "#ff9f1a"
    }
    }

Delete Board

Delete a board.

  • URL: /boards/:id
  • Method: DELETE
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Board deleted successfully",
    "data": null
    }

Lists

Get Lists

Get all lists for a specific board.

  • URL: /lists?boardId=:boardId
  • Method: GET
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Lists retrieved successfully",
    "data": [
    {
    "id": 1,
    "title": "To Do",
    "position": 1,
    "boardId": 1
    }
    ]
    }

Create List

Create a new list in a board.

  • URL: /lists
  • Method: POST
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "title": "Doing",
    "boardId": 1,
    "position": 2
    }
  • Success Response (201 Created):
    {
    "success": true,
    "message": "List created successfully",
    "data": {
    "id": 2,
    "title": "Doing",
    "boardId": 1,
    "position": 2
    }
    }

Update List

Update a list’s title or archive status.

  • URL: /lists/:id
  • Method: PUT
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "title": "In Progress",
    "isArchived": false
    }
  • Success Response (200 OK):
    {
    "success": true,
    "message": "List updated successfully",
    "data": {
    "id": 2,
    "title": "In Progress",
    "isArchived": false
    }
    }

Move List

Change the position of a list.

  • URL: /lists/:id/move
  • Method: PUT
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "position": 1
    }
  • Success Response (200 OK):
    {
    "success": true,
    "message": "List moved successfully",
    "data": [ /* Array of lists in new order */ ]
    }

Delete List

Delete a list.

  • URL: /lists/:id
  • Method: DELETE
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "List deleted successfully",
    "data": null
    }

Cards

Get Cards

Get all cards in a list.

  • URL: /cards?listId=:listId
  • Method: GET
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Cards retrieved successfully",
    "data": [
    {
    "id": 1,
    "title": "Fix Bug",
    "listId": 1
    }
    ]
    }

Create Card

Create a new card in a list.

  • URL: /cards
  • Method: POST
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "title": "Implement Login",
    "description": "Add JWT authentication",
    "listId": 1,
    "position": 1,
    "dueDate": "2023-12-31T23:59:59Z"
    }
  • Success Response (201 Created):
    {
    "success": true,
    "message": "Card created successfully",
    "data": {
    "id": 3,
    "title": "Implement Login",
    "listId": 1
    }
    }

Get Card Details

Get details of a single card.

  • URL: /cards/:id
  • Method: GET
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Card retrieved successfully",
    "data": {
    "id": 3,
    "title": "Implement Login",
    "description": "Add JWT authentication",
    "dueDate": "2023-12-31T23:59:59.000Z"
    }
    }

Update Card

Update card details.

  • URL: /cards/:id
  • Method: PUT
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "title": "Implement Login (Revised)",
    "description": "Updated description",
    "dueDate": "2024-01-01T12:00:00Z"
    }
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Card updated successfully",
    "data": { "id": 3, "title": "Implement Login (Revised)" }
    }

Move Card

Move a card to a different position or list.

  • URL: /cards/:id/move
  • Method: PUT
  • Headers: Authorization: Bearer <token>
  • Request Body:
    {
    "listId": 2,
    "position": 1
    }
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Card moved successfully",
    "data": { "id": 3, "listId": 2, "position": 1 }
    }

Toggle Card Completion

Toggle the isCompleted status of a card.

  • URL: /cards/:id/complete
  • Method: PUT
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Card status updated successfully",
    "data": {
    "id": 3,
    "isCompleted": true
    }
    }

Delete Card

Delete a card.

  • URL: /cards/:id
  • Method: DELETE
  • Headers: Authorization: Bearer <token>
  • Success Response (200 OK):
    {
    "success": true,
    "message": "Card deleted successfully",
    "data": null
    }

Discussion