Logo
30daysofpostman API Documentation

API-Schema

Number of APIs: 4


1. Create a schema

POST https://api.getpostman.com/apis/{{apiId}}/versions/{{apiVersionId}}/schemas

Creates a schema. The request body must contain a schema object with the following properties:

  • type — A string value that contains the schema's type. One of:
    • openapi3_1
    • openapi3
    • openapi2
    • openapi1
    • raml
    • raml1
    • wsdl1
    • wsdl2
    • graphql
    • proto2
    • graphql
    • proto3
  • language — A string value that contains the schema's language. One of:
    • OpenAPI and RAML — json or yaml
    • GraphQL — graphql
    • WSDL — xml
    • Protobuf — proto
  • schema — Optional. A string value that contains the schema's contents.

Requires an API Key as the X-Api-Key request header or an apikey URL query parameter.



2. Update a schema

PUT https://api.getpostman.com/apis/{{apiId}}/versions/{{apiVersionId}}/schemas/{{schemaId}}

Updates a schema. The request body must contain a schema object with the following properties:

  • type — A string value that contains the schema's type. One of:
    • openapi3_1
    • openapi3
    • openapi2
    • openapi1
    • raml
    • raml1
    • wsdl1
    • wsdl2
    • graphql
    • proto2
    • graphql
    • proto3
  • language — A string value that contains the schema's language. One of:
    • OpenAPI and RAML — json or yaml
    • GraphQL — graphql
    • WSDL — xml
    • Protobuf — proto
  • schema — Optional. A string value that contains the schema's contents.

Requires an API Key as the X-Api-Key request header or an apikey URL query parameter.



3. Get Schema

GET https://api.getpostman.com/apis/{{apiId}}/versions/{{apiVersionId}}/schemas/{{schemaId}}

This call fetches a single schema having the specified id.

Response contains a schema object with all the details related to the schema, namely, id, language, type, schema etc.

Requires API Key as X-Api-Key request header or apikey URL query parameter.



4. Create collection from schema

POST https://api.getpostman.com/apis/{{apiId}}/versions/{{apiVersionId}}/schemas/{{schemaId}}/collections?workspace=c90a3482-f80d-43d6-9dfb-0830f5e43605

This call creates a collection and links it to an API as one or multiple relations.

Request body requires two keys: - name - Name of the collection to be created. - relations - A list of relation(s) to be created.

The allowed relation types are contracttest, integrationtest, testsuite, and documentation.

Requires API Key as X-Api-Key request header or apikey URL query parameter.



ENDPOINTS