Delete a category
Soft-delete a category. Posts that referenced it have their category cleared automatically.
Soft-deletes a category. After deletion:
- The category no longer appears in List categories or Retrieve responses.
- Any feedback or roadmap post that referenced this category has its
category_idcleared (set tonull). Posts are NOT deleted — only their link to this category is removed. - The underlying row remains in the database with
is_active = falsefor audit; you cannot un-delete via the API.
Endpoint
POST https://api.productbridge.io/api/external/v1/categories/delete
Arguments
Your organization's public API key. See Authentication.
The UUID of the category to delete. Must belong to the authenticated organization — passing an id from another org returns 404 not found.
Returns
A JSON object confirming the soft-delete. The HTTP status is 200 OK.
{ "success": true }
Example request
curl -X POST https://api.productbridge.io/api/external/v1/categories/delete \
-H 'Content-Type: application/json' \
-d '{
"api_key": "pb_YOUR_PUBLIC_API_KEY",
"category_id": "553c3ef8-b8cd-cd15-01ba-12bb12bb12bb"
}'
const res = await fetch(
"https://api.productbridge.io/api/external/v1/categories/delete",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: process.env.PRODUCTBRIDGE_API_KEY,
category_id: "553c3ef8-b8cd-cd15-01ba-12bb12bb12bb",
}),
}
);
if (res.status === 404) throw new Error("Category not found in this organization");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { success } = await res.json();
import os, httpx
resp = httpx.post(
"https://api.productbridge.io/api/external/v1/categories/delete",
json={
"api_key": os.environ["PRODUCTBRIDGE_API_KEY"],
"category_id": "553c3ef8-b8cd-cd15-01ba-12bb12bb12bb",
},
)
if resp.status_code == 404:
raise LookupError("Category not found in this organization")
resp.raise_for_status()
Example response
{
"success": true
}
Deletion is irreversible via the API. Posts that referenced this category lose the link permanently — re-creating a category with the same name later does not re-attach old posts. If you need to rename, edit the category in the dashboard instead of deleting and re-creating.
Errors
| Status | Body | Cause |
|---|---|---|
401 | {"detail":{"error":"invalid api_key"}} | Missing / unknown / inactive api_key. |
404 | {"detail":{"error":"category not found"}} | The id doesn't exist, has already been deleted, or belongs to a different organization. |
422 | Validation error envelope | Missing category_id, or category_id is not a UUID. |
See Errors for the full envelope shape and a recommended client-side handler.
Last updated 2 weeks ago
Built with Documentation.AI