DELETE
https://jmpy.me/api/v1
/
short-urls
/
{id}
Delete Short URL
curl --request DELETE \
  --url https://jmpy.me/api/v1/short-urls/{id} \
  --header 'Authorization: Bearer <token>'
Permanently delete a short URL. This action cannot be undone. The short code will become available for reuse.
Permanent Action: Deleting a short URL will:
  • Remove the redirect permanently
  • Delete all associated analytics data
  • Make the short code available for reuse by others
If you want to disable a link temporarily, consider using the Update Short URL endpoint to set an expiration date instead.

Path Parameters

id
string
required
The UUID, short code, or custom alias of the short URL to delete.Examples: 550e8400-e29b-41d4-a716-446655440000, abc123, my-campaign

Request Examples

curl -X DELETE "https://jmpy.me/api/v1/short-urls/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": {
    "message": "Short URL deleted successfully"
  },
  "timestamp": "2024-01-15T10:30:00.000Z"
}

Use Cases

Delete multiple expired or unused links:
const fetch = require('node-fetch');

async function cleanupExpiredLinks() {
  // First, list expired URLs
  const listResponse = await fetch(
    'https://jmpy.me/api/v1/short-urls?status=expired&limit=100',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const { data: urls } = await listResponse.json();
  
  // Delete each expired URL
  for (const url of urls) {
    await fetch(`https://jmpy.me/api/v1/short-urls/${url.id}`, {
      method: 'DELETE',
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    });
    console.log(`Deleted: ${url.short_url}`);
  }
}
Delete all links from a specific campaign:
import requests

API_KEY = "YOUR_API_KEY"
CAMPAIGN_ID = "campaign-uuid-here"

# List all URLs in the campaign
response = requests.get(
    f"https://jmpy.me/api/v1/short-urls?campaign_id={CAMPAIGN_ID}&limit=100",
    headers={"Authorization": f"Bearer {API_KEY}"}
)
urls = response.json()["data"]

# Delete each URL
for url in urls:
    requests.delete(
        f"https://jmpy.me/api/v1/short-urls/{url['id']}",
        headers={"Authorization": f"Bearer {API_KEY}"}
    )
    print(f"Deleted: {url['short_url']}")