vault/website/content/api-docs/system/internal-specs-openapi.mdx
Erica Thompson 0660ea6fac
Update README (#31244)
* Update README

Let contributors know that docs will now be located in UDR

* Add comments to each mdx doc

Comment has been added to all mdx docs that are not partials

* chore: added changelog

changelog check failure

* wip: removed changelog

* Fix content errors

* Doc spacing

* Update website/content/docs/deploy/kubernetes/vso/helm.mdx

Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>

---------

Co-authored-by: jonathanfrappier <92055993+jonathanfrappier@users.noreply.github.com>
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
2025-07-22 08:12:22 -07:00

79 lines
3.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
layout: api
page_title: /sys/internal/specs/openapi - HTTP API
description: >-
The `/sys/internal/specs/openapi` endpoint is used to generate an OpenAPI
document of the mounted backends.
---
> [!IMPORTANT]
> **Documentation Update:** Product documentation, which were located in this repository under `/website`, are now located in [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs), colocated with all other product documentation. Contributions to this content should be done in the `web-unified-docs` repo, and not this one. Changes made to `/website` content in this repo will not be reflected on the developer.hashicorp.com website.
# `/sys/internal/specs/openapi`
The `/sys/internal/specs/openapi` endpoint is used to generate an OpenAPI document of the mounted backends.
The response conforms to the [OpenAPI V3 specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md),
with path names matching the mount names used by the Vault server (i.e. customizations with `-path` will be reflected).
The set of included paths is based on the permissions of the request token.
The response may include Vault-specific [extensions](https://github.com/oai/openapi-specification/blob/master/versions/3.0.2.md#specification-extensions). Three are currently defined:
- `x-vault-sudo` - Endpoint requires [sudo](/vault/docs/concepts/policies#sudo) privileges.
- `x-vault-unauthenticated` - Endpoint is unauthenticated.
- `x-vault-create-supported` - Endpoint allows creation of new items, in addition to updating existing items.
Basic documentation will be generated for all paths, but a newer path definition structure now allows for
more detailed documentation to be added. At this time the `/sys` endpoints have been updated to use the new
structure, and other endpoints will be modified incrementally.
## Get OpenAPI document
This endpoint returns a single OpenAPI document describing all paths visible to the requester.
| Method | Path |
| :----- | :---------------------------- |
| `GET` | `/sys/internal/specs/openapi` |
### Parameters
- `generic_mount_paths` `(bool: false)` Used to specify whether to use generic mount paths. If set, the mount paths will be replaced with a dynamic parameter: `{mountPath}`
### Sample request
```shell-session
$ curl http://127.0.0.1:8200/v1/sys/internal/specs/openapi?generic_mount_paths=false
```
### Sample response
```json
{
"openapi": "3.0.2",
"info": {
"title": "HashiCorp Vault API",
"description": "HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`.",
"version": "1.0.0",
"license": {
"name": "Mozilla Public License 2.0",
"url": "https://www.mozilla.org/en-US/MPL/2.0"
}
},
"paths": {
"/auth/token/create": {
"description": "The token create path is used to create new tokens.",
"post": {
"summary": "The token create path is used to create new tokens.",
"tags": [
"auth"
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
...
```