Index: app/main.py
===================================================================
--- app/main.py	(revision 6bb334f21463eb80533eaf85fdffaa2de8f8d967)
+++ app/main.py	(revision f7ceb2a49185028746872ed6fb8208c74ac03bc4)
@@ -348,9 +348,55 @@
 
 @app.post("/tags/", response_model=TagResponse)
-def create_tag(tag: TagCreate, db: Session = Depends(get_db)):
+def create_tag(
+    tag: TagCreate,
+    user: User = Depends(get_current_user),
+    db: Session = Depends(get_db)
+):
+    """
+    Create a tag associated with the logged-in user by linking it to a placeholder transaction.
+    """
+    # Create the tag
     new_tag = Tag(tag_name=tag.tag_name)
     db.add(new_tag)
     db.commit()
     db.refresh(new_tag)
+
+    # Create a dummy transaction linked to the user's first account
+    user_account = (
+        db.query(TransactionAccount)
+        .filter(TransactionAccount.user_id == user.user_id)
+        .first()
+    )
+    if not user_account:
+        raise HTTPException(status_code=403, detail="No account available to associate with the tag.")
+
+    # Associate the tag with a dummy transaction for the user
+    dummy_transaction = Transaction(
+        transaction_name=f"Tag_{new_tag.tag_id}_placeholder",
+        amount=0,
+        net_amount=0,
+        date=datetime.utcnow(),
+    )
+    db.add(dummy_transaction)
+    db.commit()
+    db.refresh(dummy_transaction)
+
+    # Link the dummy transaction to the user's account
+    dummy_breakdown = TransactionBreakdown(
+        transaction_id=dummy_transaction.transaction_id,
+        transaction_account_id=user_account.transaction_account_id,
+        earned_amount=0,
+        spent_amount=0,
+    )
+    db.add(dummy_breakdown)
+
+    # Associate the tag with the dummy transaction
+    tag_assignment = TagAssignedToTransaction(
+        transaction_id=dummy_transaction.transaction_id,
+        tag_id=new_tag.tag_id,
+    )
+    db.add(tag_assignment)
+    db.commit()
+
     return new_tag
 
Index: cli/cli_app.py
===================================================================
--- cli/cli_app.py	(revision 6bb334f21463eb80533eaf85fdffaa2de8f8d967)
+++ cli/cli_app.py	(revision f7ceb2a49185028746872ed6fb8208c74ac03bc4)
@@ -331,8 +331,11 @@
 
 def add_tag():
+    """Handles creating a new tag for the logged-in user."""
+    headers = {"Authorization": f"Bearer {access_token}"}
+
     print("\nAdd Tag")
     tag_name = input("Enter tag name: ")
 
-    response = requests.post(f"{BASE_URL}/tags/", json={"tag_name": tag_name})
+    response = requests.post(f"{BASE_URL}/tags/", json={"tag_name": tag_name}, headers=headers)
 
     if response.status_code == 200:
@@ -340,5 +343,6 @@
     else:
         print("Failed to add tag.")
-        print(f"Error: {response.json().get('detail', 'Unknown error')}")
+        error_message = response.json().get('detail', 'Unknown error')
+        print(f"Error: {error_message}")
 
 def view_tags():
