Skip to content
Docs

Stages new redirects for a project.

PUThttps://api.vercel.com/v1/bulk-redirects
Stages new redirects for a project and returns the new version.
https://api.vercel.com/v1/bulk-redirects
const response = await fetch('https://api.vercel.com/v1/bulk-redirects?teamId=string&slug=string', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"projectId": "example_id",
"teamId": "example_id",
"overwrite": "true",
"name": "Example Name",
"redirects": [
{
"source": "string",
"destination": "string",
"statusCode": "123",
"permanent": "true",
"caseSensitive": "true",
"query": "true",
"preserveQueryParams": "true"
}
]
}),
});
const data = await response.json();
console.log(data);
Response
{
"alias": "string",
"version": {
"alias": "string",
"createdBy": "string",
"id": "icfg_1234567890",
"isLive": "false",
"isStaging": "false",
"key": "string",
"lastModified": "123",
"name": "Example Name",
"redirectCount": "123"
}
}
AuthorizationbearerToken

Default authentication mechanism

teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
application/json
projectIdstringRequired
teamIdstringRequired
overwritebooleanOptional
namestringOptional
redirectsarrayOptional
200Success
aliasstringRequired
versionobjectRequired
400One of the provided values in the request body is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error
500Error