Postman API
  1. API
Postman API
  • API
    • Get all APIs
      GET
    • Create API
      POST
    • Delete an API
      DELETE
    • Single API
      GET
    • Update an API
      PUT
    • Get All API Versions
      GET
    • Create API Version
      POST
    • Delete an API Version
      DELETE
    • Get an API Version
      GET
    • Update an API Version
      PUT
    • Get contract test relations
      GET
    • Get documentation relations
      GET
    • Get environment relations
      GET
    • Get integration test relations
      GET
    • Get monitor relations
      GET
    • Get linked relations
      GET
    • Create relations
      POST
    • Create Schema
      POST
    • Get Schema
      GET
    • Update Schema
      PUT
    • Create collection from schema
      POST
    • Get test suite relations
      GET
    • Sync relations with schema
      PUT
  • Collections
    • All Collections
      GET
    • Create Collection
      POST
    • Create a Fork
      POST
    • Merge a Fork
      POST
    • Delete Collection
      DELETE
    • Single Collection
      GET
    • Update Collection
      PUT
  • Environments
    • All Environments
    • Create Environment
    • Delete Environment
    • Single Environment
    • Update Environment
  • Import
    • Import exported data
    • Import external API specification
  • User
    • API Key Owner
  • Mocks
    • All Mocks
    • Create Mock
    • Delete Mock
    • Single Mock
    • Update Mock
    • Publish Mock
    • Unpublish Mock
  • Monitors
    • All Monitors
    • Create Monitor
    • Delete Monitor
    • Single Monitor
    • Update Monitor
    • Run a Monitor
  • Webhooks
    • Create Webhook
  • Workspaces
    • All workspaces
    • Create Workspace
    • Delete Workspace
    • Single workspace
    • Update Workspace
  1. API

Create Schema

POST
/apis/{apiId}/versions/{apiVersionId}/schemas
APISchema
This call creates a new schema.
Request body should contain a schema object which should atleast have these properties with string values:
type: Allowed types are openapi3, openapi2, openapi1, raml and graphql.
language : Allowed languages are json and yaml for OpenAPI and RAML schema types. GraphQL schema type accepts only graphql language.
schema: Optional. If passed, must be the content of the schema as a string.
Response contains a schema object with all the details related to the created schema, namely, id, language, type etc.
Requires API Key as X-Api-Key request header or apikey URL query parameter.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.getpostman.com/apis//versions//schemas' \
--header 'Content-Type: application/json' \
--data-raw '{
    "schema": {
        "language": "yaml",
        "schema": "{\n  \"openapi\": \"3.0.0\",\n  \"info\": null,\n  \"version\": \"v1.0\",\n  \"title\": \"APi\",\n  \"servers\": [\n    {\n      \"url\": \"http://localhost:3000\"\n    }\n  ],\n  \"paths\": {\n    \"/user\": {\n      \"get\": {\n        \"summary\": \"Returns details about a particular user\",\n        \"operationId\": \"listUser\",\n        \"tags\": [\n          \"user\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"query\",\n            \"description\": \"ID of the user\",\n            \"required\": true,\n            \"schema\": {\n              \"type\": \"integer\",\n              \"format\": \"int32\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"Details about a user by ID\",\n            \"headers\": {\n              \"x-next\": {\n                \"description\": \"A link to the next page of responses\",\n                \"schema\": {\n                  \"type\": \"string\"\n                }\n              }\n            },\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"\\\\'\''#/components/schemas/User\\\\'\''\"\n                }\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"Unexpected error\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"\\\\'\''#/components/schemas/Error\\\\'\''\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"User\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\",\n          \"name\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"tag\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"Error\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"code\",\n          \"message\"\n        ],\n        \"properties\": {\n          \"code\": {\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          },\n          \"message\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    }\n  }\n}",
        "type": "openapi3"
    }
}'
Response Response Example
{
  "schema": {
    "apiVersion": "ad810c39-df60-434e-a76f-a2192cd8d81f",
    "createdAt": "2019-02-12T19:34:49.000Z",
    "createdBy": "5665",
    "id": "e3b3a0b7-34d5-4fc5-83e0-118bd9e8c822",
    "language": "yaml",
    "type": "openapi3",
    "updateBy": "5665",
    "updatedAt": "2019-02-12T19:34:49.000Z"
  }
}

Request

Path Params
apiId
string 
required
apiVersionId
string 
required
Body Params application/json
schema
object 
optional
language
string 
optional
Example:
yaml
schema
string 
optional
Example:
{ "openapi": "3.0.0", "info": null, "version": "v1.0", "title": "APi", "servers": [ { "url": "http://localhost:3000" } ], "paths": { "/user": { "get": { "summary": "Returns details about a particular user", "operationId": "listUser", "tags": [ "user" ], "parameters": [ { "name": "id", "in": "query", "description": "ID of the user", "required": true, "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Details about a user by ID", "headers": { "x-next": { "description": "A link to the next page of responses", "schema": { "type": "string" } } }, "content": { "application/json": { "schema": { "$ref": "\\'#/components/schemas/User\\'" } } } }, "default": { "description": "Unexpected error", "content": { "application/json": { "schema": { "$ref": "\\'#/components/schemas/Error\\'" } } } } } } } }, "components": { "schemas": { "User": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } }, "Error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } } } }
type
string 
optional
Example:
openapi3
Examples

Responses

🟢200Create schema
application/json
Body
schema
object 
optional
apiVersion
string 
optional
Example:
ad810c39-df60-434e-a76f-a2192cd8d81f
createdAt
string 
optional
Example:
2019-02-12T19:34:49.000Z
createdBy
string 
optional
Example:
5665
id
string 
optional
Example:
e3b3a0b7-34d5-4fc5-83e0-118bd9e8c822
language
string 
optional
Example:
yaml
type
string 
optional
Example:
openapi3
updateBy
string 
optional
Example:
5665
updatedAt
string 
optional
Example:
2019-02-12T19:34:49.000Z
Previous
Create relations
Next
Get Schema
Built with