Skip to main content
Permanently delete a shortened URL. This action cannot be undone.

Endpoint

DELETE /api/user/urls/:id

Authentication

Requires authentication via API token in the Authorization header.

Path Parameters

id
string
required
The ID of the URL to delete

Response

Returns the deleted URL object for confirmation. Passwords are excluded from the response.
id
string
required
Unique identifier for the deleted URL
code
string
required
Random code that was used for the URL
vanity
string | null
Custom vanity string, if it was set
destination
string
required
The destination URL that was being redirected to
views
number
required
Total number of times the URL was accessed before deletion
maxViews
number | null
Maximum views limit, if it was set
enabled
boolean
required
Whether the URL was enabled when deleted
createdAt
string
required
ISO 8601 timestamp of when the URL was created
updatedAt
string
required
ISO 8601 timestamp of when the URL was last updated
userId
string | null
ID of the user who owned this URL

Example Request

cURL
curl -X DELETE "https://your-zipline-instance.com/api/user/urls/clx123" \
  -H "Authorization: your-api-token"
JavaScript/TypeScript
async function deleteUrl(urlId: string) {
  const response = await fetch(
    `https://your-zipline-instance.com/api/user/urls/${urlId}`,
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'your-api-token',
      },
    }
  );

  if (!response.ok) {
    throw new Error('Failed to delete URL');
  }

  const deletedUrl = await response.json();
  console.log('Deleted URL:', deletedUrl.destination);
  return deletedUrl;
}
Python
import requests

def delete_url(url_id):
    response = requests.delete(
        f'https://your-zipline-instance.com/api/user/urls/{url_id}',
        headers={'Authorization': 'your-api-token'}
    )
    response.raise_for_status()
    return response.json()

Example Response

200 OK
{
  "id": "clx1234567890",
  "code": "abc123",
  "vanity": "docs",
  "destination": "https://zipline.diced.sh/docs",
  "views": 42,
  "maxViews": null,
  "enabled": true,
  "createdAt": "2024-03-01T10:30:00.000Z",
  "updatedAt": "2024-03-01T10:30:00.000Z",
  "userId": "user123"
}
404 Not Found
{
  "error": "Not Found",
  "message": "URL not found",
  "statusCode": 404
}
401 Unauthorized
{
  "error": "Unauthorized",
  "message": "Invalid authorization token",
  "statusCode": 401
}

Notes

  • You can only delete URLs you own
  • Deletion is permanent and cannot be undone
  • Once deleted, the URL will no longer redirect
  • The vanity string and code become available for reuse after deletion
  • Analytics and view counts for the deleted URL are not preserved
  • The response includes the full URL object for your records before it’s permanently removed

Build docs developers (and LLMs) love