API URL / Patch Request for Adding / Deleting Labels #268

Closed
opened 2025-10-09 18:41:35 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @RandomDev05 on GitHub.

Is this a feature for the backend or frontend?

Backend

What would you like?

Im developing a Planka App and currently have no way of adding or deleting labels. The easiest way would be, if you´d allow me to patch labels with the cards/cardId api request.

Why is this needed?

No response

Other information

No response

Originally created by @RandomDev05 on GitHub. ### Is this a feature for the backend or frontend? Backend ### What would you like? Im developing a Planka App and currently have no way of adding or deleting labels. The easiest way would be, if you´d allow me to patch labels with the cards/cardId api request. ### Why is this needed? _No response_ ### Other information _No response_
Author
Owner

@meltyshev commented on GitHub:

@meltyshev What would be the request to fetch comments from a card?

In the current version of Planka, comments are actions and can be requested via the get actions method:

GET /api/cards/:cardId/actions

cardId: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
},
beforeId: {
  type: 'string',
  regex: /^[0-9]+$/,
},
withDetails: {
  type: 'boolean',
}

beforeId - This is an ID of the last loaded comment, so the response will include the next 50.
withDetails - Indicates whether to include events in the response (e.g., user A moved this card from B to C).

@meltyshev commented on GitHub: > @meltyshev What would be the request to fetch comments from a card? In the current version of Planka, comments are actions and can be requested via the get actions method: ``` GET /api/cards/:cardId/actions cardId: { type: 'string', regex: /^[0-9]+$/, required: true, }, beforeId: { type: 'string', regex: /^[0-9]+$/, }, withDetails: { type: 'boolean', } ``` `beforeId` - This is an ID of the last loaded comment, so the response will include the next 50. `withDetails` - Indicates whether to include events in the response (e.g., user A moved this card from B to C).
Author
Owner

@RandomDev05 commented on GitHub:

@meltyshev What would be the request to fetch comments from a card?

@RandomDev05 commented on GitHub: @meltyshev What would be the request to fetch comments from a card?
Author
Owner

@meltyshev commented on GitHub:

Hi!

You can use this method to create a label on a board:

POST /api/boards/:boardId/labels

boardId: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
},
position: {
  type: 'number',
  required: true,
},
name: {
  type: 'string',
  isNotEmptyString: true,
  allowNull: true,
},
color: {
  type: 'string',
  isIn: Label.COLORS,
  required: true,
}

There methods to update/delete a label:

PATCH /api/labels/:id

id: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
},
position: {
  type: 'number',
},
name: {
  type: 'string',
  isNotEmptyString: true,
  allowNull: true,
},
color: {
  type: 'string',
  isIn: Label.COLORS,
}
DELETE /api/labels/:id

id: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
}

These methods to add/remove a label to/from a card:

POST /api/cards/:cardId/labels

cardId: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
},
labelId: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
}
DELETE /api/cards/:cardId/labels/:labelId

cardId: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
},
labelId: {
  type: 'string',
  regex: /^[0-9]+$/,
  required: true,
}

By the way, the Planka client runs entirely on the server API :)

@meltyshev commented on GitHub: Hi! You can use this method to create a label on a board: ``` POST /api/boards/:boardId/labels boardId: { type: 'string', regex: /^[0-9]+$/, required: true, }, position: { type: 'number', required: true, }, name: { type: 'string', isNotEmptyString: true, allowNull: true, }, color: { type: 'string', isIn: Label.COLORS, required: true, } ``` There methods to update/delete a label: ``` PATCH /api/labels/:id id: { type: 'string', regex: /^[0-9]+$/, required: true, }, position: { type: 'number', }, name: { type: 'string', isNotEmptyString: true, allowNull: true, }, color: { type: 'string', isIn: Label.COLORS, } ``` ``` DELETE /api/labels/:id id: { type: 'string', regex: /^[0-9]+$/, required: true, } ``` These methods to add/remove a label to/from a card: ``` POST /api/cards/:cardId/labels cardId: { type: 'string', regex: /^[0-9]+$/, required: true, }, labelId: { type: 'string', regex: /^[0-9]+$/, required: true, } ``` ``` DELETE /api/cards/:cardId/labels/:labelId cardId: { type: 'string', regex: /^[0-9]+$/, required: true, }, labelId: { type: 'string', regex: /^[0-9]+$/, required: true, } ``` By the way, the Planka client runs entirely on the server API :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#268