Skip to main content
Get a list of all shortened URLs belonging to the authenticated user. You can optionally search for specific URLs.

Endpoint

GET /api/user/urls

Authentication

Requires authentication via API token in the Authorization header.

Query Parameters

searchField
string
default:"destination"
Field to search in. Options: destination, vanity, code
searchQuery
string
Search query string. When provided, performs a case-insensitive search in the specified field.

Response

Returns an array of URL objects. Passwords are excluded from the response.
id
string
required
Unique identifier for the shortened URL
code
string
required
Random code generated for the URL
vanity
string | null
Custom vanity string, if set
destination
string
required
The destination URL that this short URL redirects to
views
number
required
Number of times this URL has been accessed
maxViews
number | null
Maximum number of views before the URL is disabled
enabled
boolean
required
Whether the URL is currently active and will redirect
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 created this URL

Example Request

Get all URLs
curl -X GET "https://your-zipline-instance.com/api/user/urls" \
  -H "Authorization: your-api-token"
Search by destination
curl -X GET "https://your-zipline-instance.com/api/user/urls?searchField=destination&searchQuery=github" \
  -H "Authorization: your-api-token"
Search by vanity
curl -X GET "https://your-zipline-instance.com/api/user/urls?searchField=vanity&searchQuery=docs" \
  -H "Authorization: your-api-token"
Search by code
curl -X GET "https://your-zipline-instance.com/api/user/urls?searchField=code&searchQuery=abc" \
  -H "Authorization: your-api-token"

Example Response

200 OK
[
  {
    "id": "clx1234567890",
    "code": "abc123",
    "vanity": null,
    "destination": "https://github.com/diced/zipline",
    "views": 42,
    "maxViews": null,
    "enabled": true,
    "createdAt": "2024-03-01T10:30:00.000Z",
    "updatedAt": "2024-03-01T10:30:00.000Z",
    "userId": "user123"
  },
  {
    "id": "clx0987654321",
    "code": "xyz789",
    "vanity": "docs",
    "destination": "https://zipline.diced.sh",
    "views": 128,
    "maxViews": 1000,
    "enabled": true,
    "createdAt": "2024-02-28T15:20:00.000Z",
    "updatedAt": "2024-02-28T15:20:00.000Z",
    "userId": "user123"
  },
  {
    "id": "clx1122334455",
    "code": "def456",
    "vanity": null,
    "destination": "https://example.com/very/long/path/to/resource",
    "views": 5,
    "maxViews": 10,
    "enabled": false,
    "createdAt": "2024-03-02T08:15:00.000Z",
    "updatedAt": "2024-03-02T12:30:00.000Z",
    "userId": "user123"
  }
]
200 OK - Search results
[
  {
    "id": "clx1234567890",
    "code": "abc123",
    "vanity": null,
    "destination": "https://github.com/diced/zipline",
    "views": 42,
    "maxViews": null,
    "enabled": true,
    "createdAt": "2024-03-01T10:30:00.000Z",
    "updatedAt": "2024-03-01T10:30:00.000Z",
    "userId": "user123"
  }
]
401 Unauthorized
{
  "error": "Unauthorized",
  "message": "Invalid authorization token",
  "statusCode": 401
}

Notes

  • Password fields are never included in list responses for security
  • Search is case-insensitive and uses partial matching (contains)
  • Empty search results return an empty array, not an error
  • URLs are returned in the order they exist in the database

Build docs developers (and LLMs) love