URLs

Shorten a URL

Creates a short link on your plan: code length, maximum lifetime and deep-link support follow the plan. lifetimeDays is clamped to the plan maximum (60 days on Free, 120 on Basic, unlimited on Pro); omit it to get the maximum. fallbackUrl is only valid when url is an app deep link (custom scheme such as myapp://...), and custom schemes require a Pro plan. Each call counts against your monthly URL allowance; once it is used up the API returns 429. With customCode (Pro), the link uses your custom code and redirects at https://gajo.io/c/{code}: an unclaimed code is claimed for you, and one of your own codes is used if it isn't currently linked to a URL. A code that's taken, released, or already linked returns 409 (change a linked code's destination with PUT /urls/{code}). Custom-code links don't expire, so lifetimeDays can't be combined with customCode.

post/shorten

Request

  • Base URL: https://gajo.io/api/v1
  • URL: https://gajo.io/api/v1/shorten
  • Auth: API key in header x-api-key

Request body

urlstring required

Destination URL. Supported schemes: http, https, mailto, tel, ftp, sftp. Pro plans may also shorten app deep links with a custom scheme (e.g. myapp://product/42). URLs pointing at gajo.io are rejected.

customCodestring nullable

Pro only. A custom code for the link (3-50 letters, digits, or hyphens; stored lowercase). The link redirects at https://gajo.io/c/{code} and the response has isCustomCode: true. An unclaimed code is claimed for you; one of your own codes is reused if it isn't linked to a URL. Can't be combined with lifetimeDays.

lifetimeDaysinteger nullable

Days until the link expires. Omit for your plan maximum. Values above the plan maximum are clamped to it (60 on Free, 120 on Basic); Pro has no maximum, and omitting it on Pro creates a link that never expires.

fallbackUrlstring nullable

Only valid when url is an app deep link (custom scheme, which requires Pro). A web URL that visitors are sent to when the app is not installed, such as the App Store or Google Play listing. Sending it with an ordinary web url is rejected with 400.

Response

The new short link. Share it as https://gajo.io/{shortCode}.

successtrue required

true when the request succeeded.

messagestring nullable

Human-readable status or error message. Often null on reads.

Changes

No recorded changes to this operation across all 1 revision of this API.