POST links
Create a short link for the given long URL.
Synopsis
POST https://once.to/api/public/v1/link
Payload
Property | Type | Required | Description |
---|---|---|---|
slug | string | No | The desired link slug. If not specified, a random one will be generated |
domain | string | No | Domain this link will redirect at. If empty, will redirect on the service’s own domains |
targetUrl | string | Yes | URL to redirect to. Must be a complete URL with schema, e.g. https://example.com/foo/bar |
title | string | No | Link title. If empty, the title of the target page will be used |
tags | array | No | Link tags (up to 63) |
starts | string | No | Link start date/time in ISO 8601 format. If not provided, the link works from the moment it’s created |
startsAfterSeconds | integer | No | Link start date/time, expressed as number of seconds from the current moment. Ignored if starts is provided |
expires | string | No | Link expiration date/time in ISO 8601 format. If not provided, the link does not expire |
expiresAfterSeconds | integer | No | Link expiration date/time, expressed as number of seconds from the current moment. Ignored if expires is provided |
password | string | No | Password to access the link’s target (4…63 characters) |
statusCode | integer | No | HTTP status code for redirection. If not provided, defaults to 301/302 |
Response
JSON object of type ShortLink.