POST links

Create a short link for the given long URL.

Synopsis

POST https://once.to/api/public/v1/link

Payload

PropertyTypeRequiredDescription
slugstringNoThe desired link slug. If not specified, a random one will be generated
domainstringNoDomain this link will redirect at. If empty, will redirect on the service’s own domains
targetUrlstringYesURL to redirect to. Must be a complete URL with schema, e.g. https://example.com/foo/bar
titlestringNoLink title. If empty, the title of the target page will be used
tagsarrayNoLink tags (up to 63)
startsstringNoLink start date/time in ISO 8601 format. If not provided, the link works from the moment it’s created
startsAfterSecondsintegerNoLink start date/time, expressed as number of seconds from the current moment. Ignored if starts is provided
expiresstringNoLink expiration date/time in ISO 8601 format. If not provided, the link does not expire
expiresAfterSecondsintegerNoLink expiration date/time, expressed as number of seconds from the current moment. Ignored if expires is provided
passwordstringNoPassword to access the link’s target (4…63 characters)
statusCodeintegerNoHTTP status code for redirection. If not provided, defaults to 301/302

Response

JSON object of type ShortLink.