Create a spec file

View as Markdown
Creates a file for an OpenAPI or a protobuf 2 or 3 specification. **Note:** - If the file path contains a `/` (forward slash) character, then a folder is created. For example, if the path is the `components/schemas.json` value, then a `components` folder is created with the `schemas.json` file inside. - Creating a spec file assigns it the `DEFAULT` file type. - Multi-file specifications can only have one root file. - Files cannot exceed a maximum of 10 MB in size.

Authentication

x-api-keystring
API Key authentication via header
OR
Authorizationstring
A valid [SCIM API key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key) for calls to SCIM endpoints.
OR
AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Path parameters

specIdstringRequired
The spec's ID.

Request

Create Spec File
pathstringRequired
The file's path. Accepts JSON or YAML files.
contentstringRequired
The file's stringified contents.

Response

Successful Response
createdAtdatetime
The date and time at which the file was created.
createdByinteger
The user ID of the user that created the file.
idstring
The file's ID.
pathstring
The file's path.
updatedAtdatetime
The date and time at which the file was updated.
updatedByinteger
The ID of the user who updated the file.
typeenumDefaults to DEFAULT

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.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error