Create a spec
createSpecCreate API specifications in Postman's Spec Hub with support for OpenAPI, AsyncAPI, protobuf, GraphQL, and Smithy. Manage single or multi-file specs directly from your workspace.
Instructions
Creates an API specification in Postman's Spec Hub. 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspaceId": "<workspaceId>",
"name": "<name>",
"type": "<type>",
"files": "<files>"
},
"name": "createSpec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The specification's name. | |
| type | Yes | The type of API specification. | |
| files | Yes | A list of the specification's files and their contents. | |
| workspaceId | Yes | The workspace's ID. |