Developer API
Create short links programmatically using our REST API. Currently no authentication is required.
Need more features or have questions? Join our Discord server to request additional API endpoints.
Create Temporary Shorturl Link
POST/api/create
Request Body
{ "type": "SHORTURL", "linkUrl": "my-custom-link", "originalUrl": "https://example.com", "expiration": "1d" }
Parameters
type
(required)
Must be "SHORTURL"
linkUrl
(required)
Custom short URL slug (3+ characters, alphanumeric, -, _)
originalUrl
(required)
The URL to redirect to
expiration
(required)
Link expiration setting
Options: "5m", "30m", "1h", "1d", "1w", "1m"
(5 minutes, 30 minutes, 1 hour, 1 day, 1 week, 1 month)
Response
201Link created successfully
400Invalid request or link already exists
Example
curl -X POST https://xurl.app/api/create \ -H "Content-Type: application/json" \ -d '{ "type": "SHORTURL", "linkUrl": "my-link", "originalUrl": "https://example.com", "expiration": "1d" }'