Update a URL redirect rule for a site
Updates an existing redirect rule for a site. Only provided fields are updated.
A unique entity identifier
^[a-zA-Z0-9_-]+$The unique id of the site
The unique id of the site redirect
The source path to redirect from.
^\/(?!\*)(?!.*\*.+)(?:[A-Za-z0-9\-._~+]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~+]|%[0-9A-Fa-f]{2})+)*(?:\/\*|\*)?$Capture and append the wildcard-matched suffix to the destination URL.
When true, it can be used to promote a draft redirect to live.
Whether the redirect is permanent for public live traffic.
OK
The unique identifier for the redirect.
The source path to redirect from.
^\/(?!\*)(?!.*\*.+)(?:[A-Za-z0-9\-._~+]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~+]|%[0-9A-Fa-f]{2})+)*(?:\/\*|\*)?$Whether the redirect is draft and not live.
Capture and append the wildcard-matched suffix to the destination URL.
Whether the redirect is configured as permanent. Permanent redirects are served as HTTP 308 for public live traffic and HTTP 307 in non-public contexts.
When the redirect was created.
When the redirect was last updated. Absent if never updated since creation.
PATCH /v1/orgs/{organizationId}/sites/{siteId}/redirects/{siteRedirectId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 131
{
"source": "text",
"captureWildcard": true,
"draft": true,
"permanent": true,
"destination": {
"kind": "site-section",
"siteSectionId": "text"
}
}OK
{
"object": "site-redirect",
"id": "text",
"source": "text",
"draft": true,
"captureWildcard": true,
"permanent": true,
"destination": {
"kind": "site-section",
"siteSectionId": "text"
},
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Last updated
Was this helpful?