Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/tukit/llms.txt

Use this file to discover all available pages before exploring further.

The Delete Product endpoint permanently removes a product document from the database. The server first confirms the product exists — returning a 404 if it does not — then verifies that the requesting user holds the admin level 2 role before executing the deletion. Because the operation calls MongoDB’s deleteOne, it is irreversible; there is no soft-delete or recycle-bin mechanism. No request body is required — the product is identified entirely by the productId path parameter. POST /api/product/remove/:productId

Authentication

Every request must include a valid JWT in the token-access header. The authenticated user must also hold the admin level 2 role (name: "admin", value: "2"). Requests from non-admin users receive HTTP 203. Deleting a product is permanent and cannot be undone.
HeaderValueRequired
token-access<your JWT token>✅ Yes

Path Parameters

productId
string
required
The MongoDB ObjectId of the product to delete. Returned as _id when the product was created or retrieved.

Request Body

No request body is required or expected for this endpoint.

Response

200 — Product Deleted

msj
string
"Producto eliminado correctamente"
status
boolean
false — note that the server intentionally returns false here to signal that the product no longer exists.
removeProduct
object
The raw result object returned by MongoDB’s deleteOne operation.

Error Responses

StatusConditionstatus
404No product found with the given IDfalse
203Authenticated user is not admin level 2false
500Unexpected server error
404 — Product Not Found
{
  "msj": "Producto no encontrado",
  "status": false
}
203 — Not Authorized
{
  "msj": "No estás autorizado para agregar productos",
  "status": false
}

Example

Replace <YOUR_TOKEN> with a valid JWT for an admin level 2 user and <PRODUCT_ID> with the _id of the product you want to remove.
cURL
curl -X POST https://your-api-domain.com/api/product/remove/665a1f2e8c4b2a001e3d9f01 \
  -H "token-access: <YOUR_TOKEN>"
Success Response
{
  "msj": "Producto eliminado correctamente",
  "status": false,
  "removeProduct": {
    "acknowledged": true,
    "deletedCount": 1
  }
}

Build docs developers (and LLMs) love