updateSpecFile
Modify API specification files in Postman by updating content, renaming files, or changing file types to manage OpenAPI documentation structure.
Instructions
Updates an API specification's file.
Note:
This endpoint does not accept an empty request body. You must pass one of the accepted values.
This endpoint does not accept multiple request body properties in a single call. For example, you cannot pass both the `content` and `type` property at the same time.
Multi-file specifications can only have one root file.
When updating a file type to `ROOT`, the previous root file is updated to the `DEFAULT` file type.
Files cannot exceed a maximum of 10 MB in size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| specId | Yes | The spec's ID. | |
| filePath | Yes | The path to the file. | |
| name | No | The file's name. | |
| type | No | The type of file: - `ROOT` — The file containing the full OpenAPI structure. This serves as the entry point for the API spec and references other (`DEFAULT`) spec files. Multi-file specs can only have one root file. - `DEFAULT` — A file referenced by the `ROOT` file. | |
| content | No | The specification's stringified contents. |