Project Phil Documentation
Sign in
On this page

Link Shortener

The Link Shortener API lets you retrieve, create, edit and delete shortened links programmatically.

Details

  • Base URLstring
    https://api.example.com
  • Authenticationstring
    x-api-key: YOUR_API_KEY

Rate limiting

All /api/ endpoints are limited to 60 requests per minute per IP address. Exceeding the limit returns 429 Too Many Requests. Standard RateLimit-* headers are included on every response.

Errors

Errors are always returned as JSON with a single msg field:

{ "msg": "Invalid API key." }

Requests to an unknown /api/ path return 404 with { "msg": "Not found." }.

Endpoints

  • Authentication — How to authenticate your API requests.
  • GET Get Link — /api/link/{name} Retrieves an existing shortened link by its name or destination URL. The supplied value is matched against both the name and url fields.
  • POST Create Link — /api/link Creates a new shortened link. The link name and destination URL must be supplied in the request body. The link is attributed to API as its creator.
  • PATCH Edit Link — /api/link Updates the name and destination URL of an existing shortened link. The link ID, new name and new destination URL must be supplied in the request body.
  • DELETE Delete Link — /api/link/{id} Permanently deletes an existing shortened link using its database ID. Returns the link object as it existed immediately before deletion.
Written by !RAB Last updated 1 Dec 2026 1 min read

Discussion 0

No comments yet. Sign in with Discord to start the conversation.