/api/user/urls

Create new shortened URLs or view all of your existing URLs.

Info

This endpoint requires authentication.

GET
Request

Get all URLs owned by the authenticated user, or search URLs by field.

Query Parameters

NameTypeDescription
searchField'destination' | 'vanity' | 'code'Field to search by. Default: 'destination'.
searchQuerystringString to search for (partial match, case-insensitive).

Response

Status: 200 OK

Content-Type: application/json

An array of Url objects (with the password omitted).

POST
Request

Create a new shortened URL.

Body

Content-Type: application/json

PropertyTypeDescription
destinationstringRequired. The original URL to shorten.
vanitystring?Custom alias for the URL. Must be unique.
enabledboolean?Whether the URL is active/enabled. Defaults to true.

Headers

These are options that can be set in the request headers:

Header NameTypeDescription
x-zipline-max-viewsstring(Optional) Maximum allowed views for this URL.
x-zipline-no-jsonstringIf present, response will be plain text instead of JSON. See the response below for more info.
x-zipline-domainstring(Optional) Use a specific domain for the returned URL.
x-zipline-passwordstring(Optional) Password for this short link.

Example

Request body, shorten https://github.com with a custom alias, "github":

{
"destination": "https://github.com/",
"vanity": "github"
}

Headers, set maximum views to 100 and add a password:

x-zipline-max-views: 100
x-zipline-password: mysecretpassword

Response

Status: 200 OK

Content-Type: application/json (or text/plain if x-zipline-no-json header is present)

If JSON: A Url object with additional properties:

PropertyTypeDescription
urlstringThe accessible URL.

If plain text: The shortened URL as a plain text string without any formatting:

https://zipline.diced.sh/go/github

Error Responses

  • 400 Bad Request

    • Destination is missing.
    • Vanity is already taken.
    • Max views is not a valid number or is less than zero.
  • 403 Forbidden

    • Creating the URL would exceed your quota.


Last updated: 6/1/2025
Edit this page on GitHub