> 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/openapi/list-all-openapi-spec.md).

# List all OpenAPI spec

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"openapi","description":"The OpenAPI endpoints let you integrate your existing or newly generated OpenAPI definitions into GitBook. This includes uploading, updating, and retrieving specs.\n\n{% openapi-schemas spec=\"gitbook\" schemas=\"OpenAPISpec\" grouped=\"false\" %}\n    The OpenAPISpec object\n{% endopenapi-schemas %}\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]},{"oauth":["openapi:read"]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"},"oauth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://oauth.gitbook.com/authorize","tokenUrl":"https://oauth.gitbook.com/token","scopes":{"user:read":"Read your GitBook user profile.","organization:read":"Read organization settings and metadata.","organization:write":"Create and update organization settings.","organization:members:read":"Read organization members, invites and link invites.","organization:members:write":"Manage organization members, invites and link invites.","organization:ask":"Ask AI questions across an organization's content.","organization:search":"Search across an organization's content.","space:read":"Read spaces and their content.","space:write":"Create, update and delete spaces and their content, including imports.","space:permissions:read":"Read space permissions.","space:permissions:write":"Manage space permissions.","change-request:merge":"Merge change requests, publishing their changes to the space.","site:read":"Read sites and their settings.","site:write":"Create, update and delete sites, sections and their settings.","site:publish":"Publish and unpublish sites, controlling their public exposure.","site:permissions:read":"Read site permissions.","site:permissions:write":"Manage site permissions.","site:auth:read":"Read site authentication and security configuration.","site:auth:write":"Manage site authentication and security configuration.","site:insights:read":"Read site analytics and insights.","site:ask":"Ask AI questions across a site's content.","site:search":"Search across a site's content.","openapi:read":"Read OpenAPI specifications.","openapi:write":"Create, update and delete OpenAPI specifications."}}}}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"listPage":{"name":"page","in":"query","description":"Identifier of the page results to fetch.","schema":{"type":"string"}},"listLimit":{"name":"limit","in":"query","description":"The number of results per page","schema":{"type":"number","minimum":0,"maximum":1000}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"List":{"type":"object","properties":{"next":{"type":"object","properties":{"page":{"type":"string","description":"Unique identifier to query the next results page"}},"required":["page"]},"count":{"type":"number","description":"Total count of objects in the list"}}},"OpenAPISpec":{"type":"object","properties":{"object":{"description":"The object type, which is always \"openapi-spec\"","type":"string","enum":["openapi-spec"]},"id":{"description":"Unique identifier","type":"string"},"createdAt":{"description":"Date of creation","$ref":"#/components/schemas/Timestamp"},"updatedAt":{"description":"Date of the last update","$ref":"#/components/schemas/Timestamp"},"slug":{"$ref":"#/components/schemas/OpenAPISpecSlug"},"sourceURL":{"$ref":"#/components/schemas/URL"},"processingState":{"$ref":"#/components/schemas/OpenAPISpecProcessingState"},"visibility":{"$ref":"#/components/schemas/OpenAPISpecVisibility"},"lastVersion":{"type":"string","description":"ID of the latest version of the OpenAPI specification"},"lastProcessedAt":{"description":"Date of the last processing","$ref":"#/components/schemas/Timestamp"},"lastProcessErrorCode":{"$ref":"#/components/schemas/OpenAPISpecProcessingErrorCode"},"lastProcessedErrors":{"type":"array","items":{"$ref":"#/components/schemas/OpenAPIErrorObject"}},"lastProcessedErrorCount":{"type":"integer","minimum":0,"description":"Total number of processing errors before truncation of lastProcessedErrors."},"permissions":{"type":"object","description":"The set of permissions for the OpenAPI specification.","required":["view","edit"],"properties":{"view":{"type":"boolean","description":"Can the user view the specification."},"edit":{"type":"boolean","description":"Can the user edit the specification."}}},"urls":{"type":"object","description":"URLs associated with the object","properties":{"location":{"description":"URL of the OpenAPI specification in the API","$ref":"#/components/schemas/URL"},"app":{"description":"URL of the OpenAPI specification in the application","$ref":"#/components/schemas/URL"},"published":{"type":"string","description":"URL of the published spec. Only defined when visibility is \"published.\"","format":"uri"}},"required":["app","location"]}},"required":["object","id","createdAt","updatedAt","slug","processingState","lastProcessedErrorCount","permissions","urls"]},"Timestamp":{"type":"string","format":"date-time"},"OpenAPISpecSlug":{"description":"Slug used as reference","type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"},"URL":{"type":"string","format":"uri","maxLength":2048},"OpenAPISpecProcessingState":{"description":"Processing state","enum":["pending","progress","complete"]},"OpenAPISpecVisibility":{"type":"string","description":"The visibility setting of the OpenAPI spec.\n* `private`: The spec is not publicly available.\n* `public`: The spec is available to anyone with a public link.\n","enum":["private","public"]},"OpenAPISpecProcessingErrorCode":{"description":"OpenAPI processing error code","enum":["FETCH_TIMEOUT","FETCH_ERROR","PARSE_ERROR"]},"OpenAPIErrorObject":{"type":"object","description":"OpenAPI error object.","properties":{"message":{"type":"string","description":"Description of the error."},"code":{"type":"string","description":"Unique code of the error."}},"required":["message"]}}},"paths":{"/orgs/{organizationId}/openapi":{"get":{"operationId":"listOpenAPISpecs","summary":"List all OpenAPI spec","tags":["openapi"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/listPage"},{"$ref":"#/components/parameters/listLimit"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/List"},{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/OpenAPISpec"}}}}]}}}}}}}}}
```


---

# 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 current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/openapi/list-all-openapi-spec.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
