Short Links API
Create, list and delete short links.
Short links live at /u/<code> on your instance, for example https://embrly.ca/u/aB3dE7, or on one of your verified custom domains. All endpoints need authentication.
| Method | Endpoint | Description |
|---|---|---|
POST | /api/urls | Create a short link |
GET | /api/urls | List your short links |
DELETE | /api/urls/{id} | Delete a short link |
Create a Short Link
POST /api/urls
| Field | Description |
|---|---|
url | The link to shorten. It must be an http or https address. Links to private or internal addresses, such as localhost or 192.168.x.x, are refused. |
domain | Optional. One of your verified custom domains, to put the short link on. Send null for the main site. Leave it out to use your preferred upload domain if it's a verified custom domain, then your primary domain, then the main site. Any other domain returns 400. |
Response:
url is the full short link, on domain when one is set.
List Your Short Links
GET /api/urls
Returns all your short links, newest first, along with the verified custom domains you can use (domains) and the one used when domain is left out (defaultDomain, or null for the main site). If a link's domain has since been removed, its url uses the main site.
Delete a Short Link
DELETE /api/urls/{id}
Returns 204 No Content. The link stops working straight away. Returns 403 if the link isn't yours.
Following a Link
Visiting /u/<code> on the main site or any custom domain redirects to the target and counts a click. No account is needed. A link removed by moderators returns 451.
Related
- Short Links guide
- Analytics API, for click counts across your links