> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites/site-redirects.md).

# Site redirects

Establish redirects for pages that have moved or changed in your docs site.

Keep your site's content fresh without breaking old links. This API allows you to create and manage redirection rules.

## The SiteRedirect object

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"components":{"schemas":{"SiteRedirect":{"type":"object","properties":{"object":{"type":"string","enum":["site-redirect"]},"id":{"type":"string","description":"The unique identifier for the redirect."},"source":{"$ref":"#/components/schemas/SiteRedirectSourcePath"},"draft":{"type":"boolean","description":"Whether the redirect is draft and not live."},"captureWildcard":{"type":"boolean","description":"Capture and append the wildcard-matched suffix to the destination URL."},"permanent":{"type":"boolean","description":"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."},"destination":{"$ref":"#/components/schemas/SiteRedirectDestination"},"createdAt":{"type":"string","format":"date-time","description":"When the redirect was created."},"updatedAt":{"type":"string","format":"date-time","description":"When the redirect was last updated. Absent if never updated since creation."}},"required":["object","id","source","draft","captureWildcard","permanent","destination","createdAt"]},"SiteRedirectSourcePath":{"type":"string","description":"The source path to redirect from.","maxLength":512,"pattern":"^\\/(?!\\*)(?!.*\\*.+)(?:[A-Za-z0-9\\-._~+]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~+]|%[0-9A-Fa-f]{2})+)*(?:\\/\\*|\\*)?$"},"SiteRedirectDestination":{"oneOf":[{"$ref":"#/components/schemas/SiteRedirectDestinationSiteSection"},{"$ref":"#/components/schemas/SiteRedirectDestinationSiteSpace"},{"$ref":"#/components/schemas/SiteRedirectDestinationPage"},{"$ref":"#/components/schemas/SiteRedirectDestinationExternal"}]},"SiteRedirectDestinationSiteSection":{"type":"object","properties":{"kind":{"type":"string","enum":["site-section"]},"siteSectionId":{"type":"string","description":"Unique identifier for the site section to redirect to"}},"required":["kind","siteSectionId"]},"SiteRedirectDestinationSiteSpace":{"type":"object","properties":{"kind":{"type":"string","enum":["site-space"]},"siteSpaceId":{"type":"string","description":"Unique identifier for the site space to redirect to"}},"required":["kind","siteSpaceId"]},"SiteRedirectDestinationPage":{"type":"object","properties":{"kind":{"type":"string","enum":["site-page"]},"siteSpaceId":{"type":"string","description":"Unique identifier for the site space of the page"},"pageId":{"type":"string","description":"Unique identifier for the page within the site space to redirect to"}},"required":["kind","siteSpaceId","pageId"]},"SiteRedirectDestinationExternal":{"type":"object","properties":{"kind":{"type":"string","enum":["external"]},"url":{"$ref":"#/components/schemas/URL"}},"required":["kind","url"]},"URL":{"type":"string","format":"uri","maxLength":2048}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites/site-redirects.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
