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
Function signature
export const updateRedirect = async (data: UpdateRedirectProps): Promise<AxiosResponse>
Request body
The ID of the redirect to be updated
The new domain to which the redirect points
The type of redirect. Must be either permanent or temporary
Indicates whether the path should be forwarded
Indicates whether the query parameters should be forwarded
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
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
Returned when the request body is invalid or missing required fields
Returned when the user is not authenticated
Returned when the user does not have permission to update this redirect
Returned when the redirect with the specified ID does not exist
Show 500 - Internal Server Error
Returned when an unexpected error occurs on the server