> For the complete documentation index, see [llms.txt](https://gitbook-v2-ddzba6384-gitbook.vercel.app/url/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-v2-ddzba6384-gitbook.vercel.app/url/gitbook.com/docs/developers/gitbook-api/api-reference.md).

# API reference

Explore the endpoints available from GitBook’s API

The GitBook API provides developers with a powerful and flexible way to interact with GitBook's platform programmatically. It offers endpoints to manage content and integrate GitBook functionalities into external applications.

This API is RESTful and supports standard HTTP methods like `GET`, `POST`, `PATCH`, and `DELETE`.

### API tasks

Use these API references to complete common tasks:

| Task                                                 | API reference                                                                                                            |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| Manage organizations                                 | [Organizations](/url/gitbook.com/docs/developers/gitbook-api/api-reference/organizations.md)                             |
| Create and manage spaces                             | [Spaces](/url/gitbook.com/docs/developers/gitbook-api/api-reference/spaces.md)                                           |
| Create and manage collections                        | [Collections](/url/gitbook.com/docs/developers/gitbook-api/api-reference/collections.md)                                 |
| Create and manage published docs sites               | [Published docs sites](/url/gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites.md)                         |
| Manage members, teams, and permissions               | [Organization members](/url/gitbook.com/docs/developers/gitbook-api/api-reference/organizations/organization-members.md) |
| Import and export pages, files, and reusable content | [Content import and export](/url/gitbook.com/docs/developers/gitbook-api/api-reference/imports.md)                       |
| Create and manage change requests                    | [Change requests](/url/gitbook.com/docs/developers/gitbook-api/api-reference/change-requests.md)                         |
| Create and manage comments                           | [Comments](/url/gitbook.com/docs/developers/gitbook-api/api-reference/change-requests/change-request-comments.md)        |
| Configure custom hostnames, URLs, and search         | [Site customization](/url/gitbook.com/docs/developers/gitbook-api/api-reference/custom-hostnames.md)                     |
| Monitor content performance                          | [Analytics](/url/gitbook.com/docs/developers/gitbook-api/api-reference/docs-sites/site-insights.md)                      |
| Manage integrations and OpenAPI documentation        | [Integrations](/url/gitbook.com/docs/developers/gitbook-api/api-reference/integrations.md)                               |

### OpenAPI spec

You can view GitBook’s hosted OpenAPI spec used to generate our API docs [here](https://api.gitbook.com/openapi.json). Learn more about creating your own API references in our [product docs](/url/gitbook.com/docs/create-content/openapi.md).


---

# 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 dynamically by asking a question.

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

```
GET https://gitbook-v2-ddzba6384-gitbook.vercel.app/url/gitbook.com/docs/developers/gitbook-api/api-reference.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 `build a script that syncs our docs to a CMS` 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.
