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
Success message confirming the deletion
Status Codes
- 200: URL successfully deleted
- 404: URL not found
- 403: Invalid or expired token
How It Works
- The endpoint authenticates the Bearer token
- Extracts the
url_code from the token payload
- Deletes the entry from the
URLMap collection
- Deletes the corresponding entry from the
URLStats collection
- 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.