This website requires JavaScript to run properly.
to.it.com
api reference

Short links

Create, list, retrieve, and update short links via the public API.

to.it.com/docs/api-reference/short-links

Create, list, retrieve, and update short links via the public API.

POST /public/v1/short-links

Request body

FieldTypeRequiredDescription
targetUrlstringYesDestination URL
slugstringNoCustom slug (requires plan allowance)
titlestringNoDisplay title (shown on countdown page)
descriptionstringNoOptional description (shown on countdown page)
profileIduuidNoAttach to a profile
isProfileScopedbooleanNoUse /@handle/slug URL pattern
utmSourcestringNoUTM source parameter
utmMediumstringNoUTM medium parameter
utmCampaignstringNoUTM campaign parameter
utmTermstringNoUTM term parameter
utmContentstringNoUTM content parameter
startsAtISO datetimeNoSchedule activation (Pro/Business)
expiresAtISO datetimeNoSchedule expiration (Pro/Business)
countdownPagebooleanNoShow a live countdown to visitors before startsAt (requires scheduling)
captchaEnabledbooleanNoRequire Cloudflare Turnstile CAPTCHA before redirect (all plans)
passwordstringNoVisitor password (Pro/Business); stored as bcrypt hash, never returned
passwordBeforeCountdownbooleanNoWhen both password and countdown are enabled, show password first (default true)

Example

curl -X POST https://api.to.it.com/v1/short-links \
  -H "Authorization: Bearer toit_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"targetUrl": "https://example.com", "slug": "demo"}'

Scheduled launch with countdown

curl -X POST https://api.to.it.com/v1/short-links \
  -H "Authorization: Bearer toit_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "targetUrl": "https://example.com/launch",
    "slug": "launch",
    "title": "Product launch",
    "startsAt": "2026-07-10T12:00:00.000Z",
    "countdownPage": true
  }'

PATCH /public/v1/short-links/{shortLinkId}

Send at least one field to update. Scheduling fields require a Pro or Business plan.

FieldTypeDescription
targetUrlstringDestination URL
titlestringDisplay title
descriptionstringOptional description
statusACTIVE / DISABLEDLink status
startsAtISO datetime / nullSchedule activation; pass null to clear
expiresAtISO datetime / nullSchedule expiration; pass null to clear
countdownPagebooleanShow countdown page before startsAt
passwordstringSet or replace the visitor password (Pro/Business)
clearPasswordbooleanRemove password protection from the link
passwordBeforeCountdownbooleanWhen both password and countdown are enabled, show password before countdown

Example

curl -X PATCH https://api.to.it.com/v1/short-links/SHORT_LINK_ID \
  -H "Authorization: Bearer toit_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"countdownPage": true, "startsAt": "2026-07-10T12:00:00.000Z"}'

GET /public/v1/short-links

Optional query parameter: profileId (uuid) to filter by profile.

GET /public/v1/short-links/{shortLinkId}

Returns the short link record and computed shortUrl.

Response fields

Create, list, get, and patch responses include the full short link object. Notable scheduling fields:

FieldTypeDefaultDescription
startsAtstringnullWhen the link becomes active
expiresAtstringnullWhen the link stops redirecting
countdownPagebooleanfalseWhether visitors see a countdown before startsAt
captchaEnabledbooleanfalseWhether visitors must complete a CAPTCHA before redirect
hasPasswordbooleanfalseWhether the link requires a visitor password
passwordBeforeCountdownbooleantruePassword gate order when combined with countdown

Owner API responses include targetUrl and hasPassword. They never include passwordHash or the plain-text password.

When captchaEnabled is true:

  • Visitors must complete a Cloudflare Turnstile challenge before the destination URL is revealed.
  • The public resolve endpoint does not return targetUrl until all gates are cleared.
  • Gate order is always captcha → password → countdown → redirect. Captcha runs first when enabled; passwordBeforeCountdown still only orders password vs countdown.
  • After a successful CAPTCHA, the API sets an HttpOnly unlock cookie (toit_sl_captcha_{id}) so visitors are not challenged again during the same visit (separate from the password unlock cookie).
  • Verify via POST /public/short-link-verify-captcha with { shortLinkId, turnstileToken }.

Requirements:

  • Available on all plans, including Free.
  • Requires a valid Cloudflare Turnstile token verified server-side.

When password is set on create or patch:

  • Visitors must enter the password before the destination URL is revealed.
  • The public resolve endpoint does not return targetUrl until all gates (captcha, password, countdown) are cleared.
  • After a correct password, the API sets an HttpOnly unlock cookie so visitors are not prompted again during the same visit.
  • Use clearPassword: true on patch to remove protection.

Requirements:

  • Requires Pro or Business (passwordLinks plan feature).
  • Password length: 4–128 characters.
  • Combine with countdown pages using passwordBeforeCountdown to control password vs countdown order (captcha always comes first when enabled).

Countdown pages

When countdownPage is true and startsAt is in the future:

  • Visitors who open the short URL see a live countdown (days, hours, minutes, seconds) instead of a 404.
  • When the countdown reaches zero, they are redirected automatically to targetUrl.
  • Click analytics are recorded on redirect, not when the countdown page loads.
  • title and description are shown on the countdown page when set.

Requirements and rules:

  • Requires Pro or Business (same plan gate as link scheduling).
  • countdownPage: true requires startsAt to be set.
  • Clearing startsAt (null) also clears countdownPage.
  • After startsAt has passed, the link redirects normally even if countdownPage remains true.

OpenAPI

See the full interactive API reference generated from our OpenAPI spec.

Next steps

Put the API to work.

Create short links and track clicks from your own apps with a paid plan and API key.