Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dishant0406/quickleap/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

PUT /update/{id}

Function signature

export const updateRedirect = async (data: UpdateRedirectProps): Promise<AxiosResponse>

Request body

id
string
required
The ID of the redirect to be updated
toDomain
string
required
The new domain to which the redirect points
redirectType
RedirectType
required
The type of redirect. Must be either permanent or temporary
pathForwarding
boolean
required
Indicates whether the path should be forwarded
queryForwarding
boolean
required
Indicates whether the query parameters should be forwarded
samplingRate
number
required
The sampling rate for analytics. Must be a value between 0 and 1

Type definitions

type UpdateRedirectProps = {
  id: string;
  toDomain: string;
  redirectType: RedirectType;
  pathForwarding: boolean;
  queryForwarding: boolean;
  samplingRate: number;
};

enum RedirectType {
  Permanent = 'permanent',
  Temporary = 'temporary',
}
The fromDomain cannot be updated. To change the source domain, you must delete the redirect and create a new one.

Response

status
number
HTTP status code
data
object
The updated redirect object

Code example

import { updateRedirect } from '@/lib/api';
import { RedirectType } from '@/lib/constants';

const updateExistingRedirect = async (redirectId: string) => {
  const response = await updateRedirect({
    id: redirectId,
    toDomain: 'updated-domain.com',
    redirectType: RedirectType.Permanent,
    pathForwarding: true,
    queryForwarding: true,
    samplingRate: 1.0
  });
  
  return response.data;
};

Error responses

Build docs developers (and LLMs) love