Skip to main content
DELETE
/
delete
Delete URL
curl --request DELETE \
  --url https://api.example.com/delete
{
  "message": "<string>"
}
This endpoint permanently deletes a short URL from both the URLMap and URLStats collections. This action cannot be undone.
This endpoint requires authentication. Include a valid Bearer token in the Authorization header. This operation is irreversible.

Authentication

This endpoint uses HTTPBearer security. Include the access token obtained from the /login endpoint:
Authorization: Bearer <access_token>
The URL code is automatically extracted from the authenticated token, so no additional parameters are required.

Response

message
string
Success message confirming the deletion

Status Codes

  • 200: URL successfully deleted
  • 404: URL not found
  • 403: Invalid or expired token

How It Works

  1. The endpoint authenticates the Bearer token
  2. Extracts the url_code from the token payload
  3. Deletes the entry from the URLMap collection
  4. Deletes the corresponding entry from the URLStats collection
  5. Returns a success message
curl -X DELETE https://api.example.com/delete \
  -H "Authorization: Bearer <access_token>"
After deletion, the short URL code becomes available for reuse. All statistics and hit counts are permanently lost.

Build docs developers (and LLMs) love