The SDK is currently in active development. For more details, see the U301 Postman docs.

Update Not Found Page Redirect URL

Pro plan only. When users visit a short link that does not exist, they will be redirected to your specified URL.

u301.domains.updateNotFoundPageRedirectUrl
import { U301 } from 'u301';

const apiKey = '<YOUR_API_KEY>';
const workspaceId = '<YOUR_WORKSPACE_ID>';

const u301 = new U301({
 apiKey,
 workspaceId,
});
const notFoundPageRedirectUrl = 'https://example.com';
const isSuccess = await u301.domains.updateNotFoundPageRedirectUrl('t.example.com', notFoundPageRedirectUrl); // [!code highlight]
console.log(isSuccess);

the response

Request

NameLocationTypeRequiredDefaultDescription
AuthorizationHeaderstringBearer token used for authentication.
workspaceIdQuerystringWorkspace identifier for multi‑tenant routing.
domainPathstringDomain for the short link.
notFoundPageRedirectUrlBodystringThe destination URL where users will be redirected when they visit a short link that does not exist.

Response

Return { success: true } on success, or throw an error if the update failed.

NameTypeDescription
successbooleanWhether the update was successful.
response-example.json
{
  "success": true
}

Last updated on

On this page