Skip to main content

Delete Resource

Permanently deletes a cloud resource from your organization. This operation cannot be undone.

Request

DELETE /resources/{id}

Authentication

Requires Bearer JWT Token with ORG_ADMIN role.

Authorization: Bearer <access_token>

Path Parameters

ParameterTypeRequiredDescription
idUUIDYesResource unique identifier

Response

Success Response

Status Code: 204 No Content

No response body is returned on successful deletion.

Error Responses

Status CodeErrorDescription
400 Bad RequestRESOURCE_IN_USECannot delete resource that has active sessions
401 UnauthorizedUNAUTHORIZEDMissing or invalid authentication token
403 ForbiddenFORBIDDENUser lacks ORG_ADMIN role
404 Not FoundRESOURCE_NOT_FOUNDResource with specified ID does not exist or does not belong to your organization
429 Too Many RequestsRATE_LIMIT_EXCEEDEDRate limit exceeded
500 Internal Server ErrorINTERNAL_ERRORServer error occurred

Error Response Example - Resource In Use

{
"error": "RESOURCE_IN_USE",
"message": "Cannot delete resource with active sessions. Stop all active sessions first.",
"timestamp": "2026-02-18T11:45:00Z"
}

Error Response Example - Not Found

{
"error": "RESOURCE_NOT_FOUND",
"message": "Resource with ID 550e8400-e29b-41d4-a716-446655440000 not found",
"timestamp": "2026-02-18T11:45:00Z"
}

Example

Request

curl -X DELETE https://api.entryguard.io/api/v1/resources/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json"

Response

HTTP/1.1 204 No Content

Notes

  • Deletion is permanent and cannot be undone
  • You cannot delete a resource that has active sessions
  • To delete a resource with active sessions, first stop all sessions using that resource
  • Any roles or user assignments linking to this resource will be automatically removed
  • Historical audit logs referencing this resource will be preserved
  • This operation is logged in the audit trail

Before Deleting

To check if a resource has active sessions, use the List Sessions endpoint with filters, or attempt deletion - the API will return an error if active sessions exist.

# Check for active sessions before deleting
curl -X GET https://api.entryguard.io/api/v1/sessions?resourceId=550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."