Delete Entity

Endpoint

URL: https://api.replyke.com/:projectId/entities/:entityId

Method: DELETE

Authentication Required: Yes


Description

This endpoint allows an authorized user to delete an entity. The entity can be deleted by either its author or an admin of the project.


Request

URL Parameters

ParameterTypeRequiredDescription
projectIdstringYesThe project ID associated with the request.
entityIdstringYesThe ID of the entity to be deleted.

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token for authentication.

Body Parameters

None

Example Request

DELETE /12345/entities/67890
Authorization: Bearer <token>

Response

Success Response (204 No Content)

(no content)

Error Responses

Missing Entity ID (400 Bad Request)

{
  "error": "Invalid entityId"
}

Entity Not Found (404 Not Found)

{
  "error": "Entity not found"
}

Unauthorized Access (403 Forbidden)

{
  "error": "Not authorized to delete this entity"
}

Server Error (500 Internal Server Error)

{
  "error": "Failed to delete the entity"
}

Notes

  • Only the entity’s author or an admin of the project can delete the entity.
  • If the entity is successfully deleted, no content is returned.
  • Deleting an entity also deducts the reputation points earned for creating it.