Skip to main content
DELETE
/
api
/
repos
/
{id}
Delete Repository
curl --request DELETE \
  --url https://api.example.com/api/repos/{id}
{
  "success": true,
  "data": {
    "id": "<string>",
    "deleted": true
  },
  "error": {
    "success": true,
    "code": 123,
    "message": "<string>"
  }
}

Authentication

This endpoint requires authentication. You must be the owner of the repository to delete it.

Path Parameters

id
uuid
required
The unique identifier of the repository to delete.

Authorization

Only the user who created the repository (user_id matches the authenticated user) can delete it. Attempts to delete repositories owned by other users will result in a 403 Forbidden error.

Response

success
boolean
Indicates whether the request was successful.
data
object
Confirmation of the deletion.

Example Request

curl -X DELETE https://api.heimdall.example.com/api/repos/01936d2f-8c4e-7890-b123-456789abcdef \
  -H "Cookie: session=your_session_token"

Example Response

{
  "success": true,
  "data": {
    "id": "01936d2f-8c4e-7890-b123-456789abcdef",
    "deleted": true
  }
}

Error Responses

error
object
Error information when the request fails.

401 Unauthorized

Returned when authentication credentials are missing or invalid.
{
  "success": false,
  "code": 401,
  "message": "Authentication required"
}

403 Forbidden

Returned when the authenticated user does not have permission to delete the repository.
{
  "success": false,
  "code": 403,
  "message": "You do not have access to this repository"
}

404 Not Found

Returned when the repository with the specified ID does not exist.
{
  "success": false,
  "code": 404,
  "message": "Repo '01936d2f-8c4e-7890-b123-456789abcdef' not found"
}

500 Internal Server Error

Returned when the server encounters an error deleting the repository.
{
  "success": false,
  "code": 500,
  "message": "Failed to delete repo: database connection error"
}

Notes

  • Deleting a repository will also delete all associated scans, findings, and other related data.
  • This operation is permanent and cannot be undone.
  • If you’re using HTMX-based requests (with HX-Request header), the response will include an HX-Redirect header pointing to /repos.

Build docs developers (and LLMs) love