---
title: "Edit a link"
method: PUT
path: "/urls/{code}"
tags: ["URLs"]
---

# Edit a link

`PUT /urls/{code}`

## Request

- Base URL: `https://gajo.io/api/v1`
- URL: `https://gajo.io/api/v1/urls/{code}`
- Auth: API key in header `x-api-key`

**Requires a Pro plan.** Changes a link's destination and/or interstitial setting. Send only the fields to change. The new destination takes effect immediately and may be an app deep link (custom scheme).

## Request body

- UpdateUrlRequest: Send only the fields to change.
  - `originalUrl` string: New destination, validated like `POST /shorten`. App deep links (custom schemes) are allowed.
  - `interstitialEnabled` boolean: Show your branded interstitial page before redirecting.

## Response `200`

The updated link.

- ShortUrlResult: Envelope shared by every response.
  - `success` true, required: `true` when the request succeeded.
  - `message` string, nullable: Human-readable status or error message. Often `null` on reads.
  - `data` object, required: A short link. Generated codes redirect at `https://gajo.io/{shortCode}`; custom codes (`isCustomCode: true`, created in the Pro dashboard) redirect at `https://gajo.io/c/{shortCode}`. All redirects are HTTP 302.
    - `shortCode` string, required: The short code. Generated codes are never reassigned.
    - `originalUrl` string, required: Destination URL (may be an app deep link on Pro).
    - `fallbackUrl` string, nullable, required: Web fallback used when `originalUrl` is an app deep link and the app is not installed (e.g. the App Store listing). `null` otherwise.
    - `active` boolean, required: `false` once the link has been deactivated.
    - `clickCount` integer, required: Human clicks (bot and link-preview traffic excluded).
    - `isCustomCode` boolean, required: `true` for Pro custom codes (served under `/c/`).
    - `createdDate` string, date-time, required
    - `expiresDate` string, date-time, nullable, required: When the link stops redirecting; `null` = never expires.

## Other responses

- `400`: Invalid request. `message` explains what to fix.
- `401`: The `x-api-key` header is missing, or the key is unknown or revoked.
- `403`: Your plan is not Pro.
- `404`: No link with this code on your account (links belonging to other accounts answer the same way).
- `429`: Per-minute rate limit exceeded. Wait `Retry-After` seconds.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/gajo/apis/gajo-api.md) · [All operations](https://skmtc.dev/gajo/apis/gajo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gajo/apis/gajo-api/revisions/de6fe920cc26?raw)
