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
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)>.

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
namestring
The API specification's name.
typeenum
The type of API specification.
idstring
The specification's ID.
createdAtdatetime
The date and time at which the specification file was created.
updatedAtdatetime
The date and time at which the file was last updated.
createdByinteger
The user ID of the user that created the file.
updatedByinteger
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