Create a spec

View as Markdown
Creates an API specification in Postman's [Spec Hub](https://learning.postman.com/docs/design-apis/specifications/overview/). Specifications can be single or multi-file. **Note:** - Postman supports OpenAPI (2.0, 3.0, and 3.1), AsyncAPI (2.0 and 3.0), protobuf (2 and 3), GraphQL, and Smithy specifications. - 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. - Multi-file specifications can only have one root file. - Files cannot exceed a maximum of 12 MB in size.

Authentication

x-api-keystring
API Key authentication via header

Query parameters

workspaceIdstringRequired
The workspace's ID.

Request

This endpoint expects an object.
namestringRequired
The specification's name.
typeenumRequired
The type of API specification.
fileslist of objectsRequired
A list of the specification's files and their contents.

Response

Created
namestringOptional
The API specification's name.
typeenumOptional
The type of API specification.
idstringOptional
The specification's ID.
createdAtdatetimeOptional
The date and time at which the specification file was created.
updatedAtdatetimeOptional
The date and time at which the file was last updated.
createdByintegerOptional
The user ID of the user that created the file.
updatedByintegerOptional
The user ID of the user that last updated the specification file.

Errors

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