[Bug]: Cannot add label to card via API – receiving E_NOT_FOUND despite valid cardId and labelId #753

Open
opened 2026-02-04 21:12:43 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @ftaco-net on GitHub (Jul 7, 2025).

Where is the problem occurring?

I encountered the problem while interacting with the server (Backend)

What browsers are you seeing the problem on?

No response

Current behavior

I'm trying to add an existing label to an existing card via the following API request:

POST /api/cards/:cardId/labels

With the following JSON payload:
{
"labelId": "1549240966907430411"
}

Despite providing a valid cardId and labelId, I consistently receive the following error response:
{
"code": "E_NOT_FOUND"
}

Desired behavior

No response

Steps to reproduce

What I’ve tried:

Confirmed both cardId and labelId exist using the /api/boards/:boardId response

Checked label existence under the correct board

Used both axios and raw HTTP POST with correct headers and body

Verified request works for card creation (/api/lists/:listId/cards) but fails for label assignment

The card is successfully created and the response returns a valid id. Immediately after that, I attempt to add the label using the returned cardId, but still get E_NOT_FOUND.

Please let me know if there are additional permissions or board settings required for label assignments.

Other information

No response

Originally created by @ftaco-net on GitHub (Jul 7, 2025). ### Where is the problem occurring? I encountered the problem while interacting with the server (Backend) ### What browsers are you seeing the problem on? _No response_ ### Current behavior I'm trying to add an existing label to an existing card via the following API request: POST /api/cards/:cardId/labels With the following JSON payload: { "labelId": "1549240966907430411" } Despite providing a valid cardId and labelId, I consistently receive the following error response: { "code": "E_NOT_FOUND" } ### Desired behavior _No response_ ### Steps to reproduce What I’ve tried: Confirmed both cardId and labelId exist using the /api/boards/:boardId response Checked label existence under the correct board Used both axios and raw HTTP POST with correct headers and body Verified request works for card creation (/api/lists/:listId/cards) but fails for label assignment The card is successfully created and the response returns a valid id. Immediately after that, I attempt to add the label using the returned cardId, but still get E_NOT_FOUND. Please let me know if there are additional permissions or board settings required for label assignments. ### Other information _No response_
Author
Owner

@meltyshev commented on GitHub (Jul 7, 2025):

Hi! The correct request to assign a label is POST /api/cards/:cardId/card-labels, and the parameters you're using are correct. We avoided using just /labels at the end of the path because it might be confusing - it could suggest that you're creating a label, whereas this endpoint is only for assigning existing ones.

@meltyshev commented on GitHub (Jul 7, 2025): Hi! The correct request to assign a label is `POST /api/cards/:cardId/card-labels`, and the parameters you're using are correct. We avoided using just `/labels` at the end of the path because it might be confusing - it could suggest that you're creating a label, whereas this endpoint is only for assigning existing ones.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#753