{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "https://schema.getpostman.com/json/collection/v2.0.0/",
    "type": "object",
    "properties": {
        "info": {
            "$ref": "#/definitions/info"
        },
        "item": {
            "type": "array",
            "description": "Items are the basic unit for a Postman collection. You can think of them as corresponding to a single API endpoint. Each Item has one request and may have multiple API responses associated with it.",
            "items": {
                "title": "Items",
                "oneOf": [
                    {
                        "$ref": "#/definitions/item"
                    },
                    {
                        "$ref": "#/definitions/item-group"
                    }
                ]
            }
        },
        "event": {
            "description": "Postman allows you to configure scripts to run when specific events occur. These scripts are stored here, and can be referenced in the collection by their ID.",
            "type": "array",
            "items": {
                "$ref": "#/definitions/event"
            }
        },
        "variable": {
            "description": "Collection variables allow you to define a set of variables, that are a *part of the collection*, as opposed to environments, which are separate entities.\n*Note: Collection variables must not contain any sensitive information.*",
            "type": "array",
            "items": {
                "$ref": "#/definitions/variable"
            }
        },
        "auth": {
            "$ref": "#/definitions/auth"
        }
    },
    "required": [
        "info",
        "item"
    ],
    "definitions": {
        "auth": {
            "type": "object",
            "title": "Auth",
            "id": "#/definitions/auth",
            "description": "Represents authentication helpers provided by Postman",
            "properties": {
                "type": {
                    "type": "string",
                    "enum": [
                        "awsv4",
                        "basic",
                        "digest",
                        "hawk",
                        "noauth",
                        "oauth1",
                        "oauth2"
                    ]
                },
                "awsv4": {
                    "type": "object",
                    "properties": {
                        "accessKey": {
                            "type": "string"
                        },
                        "secretKey": {
                            "type": "string"
                        },
                        "region": {
                            "type": "string"
                        },
                        "service": {
                            "type": "string"
                        }
                    }
                },
                "basic": {
                    "type": "object",
                    "properties": {
                        "username": {
                            "type": "string"
                        },
                        "password": {
                            "type": "string"
                        }
                    }
                },
                "digest": {
                    "type": "object",
                    "properties": {
                        "username": {
                            "type": "string"
                        },
                        "realm": {
                            "type": "string"
                        },
                        "password": {
                            "type": "string"
                        },
                        "nonce": {
                            "type": "string"
                        },
                        "nonceCount": {
                            "type": "string"
                        },
                        "algorithm": {
                            "type": "string"
                        },
                        "qop": {
                            "type": "string"
                        },
                        "clientNonce": {
                            "type": "string"
                        }
                    }
                },
                "hawk": {
                    "type": "object",
                    "properties": {
                        "authId": {
                            "type": "string"
                        },
                        "authKey": {
                            "type": "string"
                        },
                        "algorithm": {
                            "type": "string"
                        },
                        "user": {
                            "type": "string"
                        },
                        "nonce": {
                            "type": "string"
                        },
                        "extraData": {
                            "type": "string"
                        },
                        "appId": {
                            "type": "string"
                        },
                        "delegation": {
                            "type": "string"
                        }
                    }
                },
                "noauth": {},
                "oauth1": {
                    "type": "object",
                    "properties": {
                        "consumerKey": {
                            "type": "string"
                        },
                        "consumerSecret": {
                            "type": "string"
                        },
                        "token": {
                            "type": "string"
                        },
                        "tokenSecret": {
                            "type": "string"
                        },
                        "signatureMethod": {
                            "type": "string"
                        },
                        "timeStamp": {
                            "type": "string"
                        },
                        "nonce": {
                            "type": "string"
                        },
                        "version": {
                            "type": "string"
                        },
                        "realm": {
                            "type": "string"
                        },
                        "encodeOAuthSign": {
                            "type": "string"
                        }
                    }
                },
                "oauth2": {
                    "type": "object",
                    "properties": {
                        "addTokenTo": {
                            "type": "string"
                        },
                        "callBackUrl": {
                            "type": "string"
                        },
                        "authUrl": {
                            "type": "string"
                        },
                        "accessTokenUrl": {
                            "type": "string"
                        },
                        "clientId": {
                            "type": "string"
                        },
                        "clientSecret": {
                            "type": "string"
                        },
                        "scope": {
                            "type": "string"
                        },
                        "requestAccessTokenLocally": {
                            "type": "string"
                        }
                    }
                }
            },
            "required": [
                "type"
            ]
        },
        "cookie": {
            "type": "object",
            "title": "Cookie",
            "id": "#/definitions/cookie",
            "description": "A Cookie, that follows the [Google Chrome format](https://developer.chrome.com/extensions/cookies)",
            "properties": {
                "domain": {
                    "type": "string",
                    "description": "The domain for which this cookie is valid."
                },
                "expires": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "number"
                        }
                    ],
                    "description": "When the cookie expires."
                },
                "maxAge": {
                    "type": "string"
                },
                "hostOnly": {
                    "type": "boolean",
                    "description": "True if the cookie is a host-only cookie. (i.e. a request's URL domain must exactly match the domain of the cookie)."
                },
                "httpOnly": {
                    "type": "boolean",
                    "description": "Indicates if this cookie is HTTP Only. (if True, the cookie is inaccessible to client-side scripts)"
                },
                "name": {
                    "type": "string",
                    "description": "This is the name of the Cookie."
                },
                "path": {
                    "type": "string",
                    "description": "The path associated with the Cookie."
                },
                "secure": {
                    "type": "boolean",
                    "description": "Indicates if the 'secure' flag is set on the Cookie, meaning that it is transmitted over secure connections only. (typically HTTPS)"
                },
                "session": {
                    "type": "boolean",
                    "description": "True if the cookie is a session cookie."
                },
                "value": {
                    "type": "string",
                    "description": "The value of the Cookie."
                },
                "extensions": {
                    "type": "array",
                    "description": "Custom attributes for a cookie go here, such as the [Priority Field](https://code.google.com/p/chromium/issues/detail?id=232693)"
                }
            },
            "required": [
                "domain",
                "path"
            ]
        },
        "description": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "#/definitions/description",
            "description": "A Description can be a raw text, or be an object, which holds the description along with its format.",
            "oneOf": [
                {
                    "type": "object",
                    "title": "Description",
                    "properties": {
                        "content": {
                            "type": "string",
                            "description": "The content of the description goes here, as a raw string."
                        },
                        "type": {
                            "type": "string",
                            "description": "Holds the mime type of the raw description content. E.g: 'text/markdown' or 'text/html'.\nThe type is used to correctly render the description when generating documentation, or in the Postman app."
                        },
                        "version": {
                            "description": "Description can have versions associated with it, which should be put in this property."
                        }
                    }
                },
                {
                    "type": "string"
                }
            ]
        },
        "event": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "#/definitions/event",
            "title": "Event",
            "description": "An Event",
            "type": "object",
            "properties": {
                "listen": {
                    "type": "string",
                    "description": "Can be set to `test` or `prerequest` for test scripts or pre-request scripts respectively."
                },
                "script": {
                    "$ref": "#/definitions/script"
                },
                "disabled": {
                    "type": "boolean",
                    "description": "Indicates whether the event is disabled. If absent, the event is assumed to be enabled."
                }
            },
            "required": [
                "listen"
            ]
        },
        "header": {
            "type": "object",
            "title": "Header",
            "id": "#/definitions/header",
            "description": "Represents a single HTTP Header",
            "properties": {
                "key": {
                    "description": "This holds the LHS of the HTTP Header, e.g ``Content-Type`` or ``X-Custom-Header``",
                    "type": "string"
                },
                "value": {
                    "type": "string",
                    "description": "The value (or the RHS) of the Header is stored in this field."
                }
            },
            "required": [
                "key",
                "value"
            ]
        },
        "info": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "#/definitions/info",
            "title": "Information",
            "description": "Detailed description of the info block",
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "title": "Name of the collection",
                    "description": "A collection's friendly name is defined by this field. You would want to set this field to a value that would allow you to easily identify this collection among a bunch of other collections, as such outlining its usage or content."
                },
                "_postman_id": {
                    "type": "string",
                    "description": "Every collection is identified by the unique value of this field. The value of this field is usually easiest to generate using a UID generator function. If you already have a collection, it is recommended that you maintain the same id since changing the id usually implies that is a different collection than it was originally.\n *Note: This field exists for compatibility reasons with Collection Format V1.*"
                },
                "description": {
                    "$ref": "#/definitions/description"
                },
                "version": {
                    "oneOf": [
                        {
                            "type": "object",
                            "title": "Version",
                            "description": "Postman allows you to version your collections as they grow, and this field holds the version number. While optional, it is recommended that you use this field to its fullest extent!",
                            "properties": {
                                "major": {
                                    "description": "Increment this number if you make changes to the collection that changes its behaviour. E.g: Removing or adding new test scripts. (partly or completely).",
                                    "type": "string"
                                },
                                "minor": {
                                    "description": "You should increment this number if you make changes that will not break anything that uses the collection. E.g: removing a folder.",
                                    "type": "string"
                                },
                                "patch": {
                                    "description": "Ideally, minor changes to a collection should result in the increment of this number.",
                                    "type": "string"
                                },
                                "identifier": {
                                    "description": "A human friendly identifier to make sense of the version numbers. E.g: 'beta-3'",
                                    "type": "string",
                                    "maxLength": 10
                                },
                                "meta": {}
                            },
                            "required": [
                                "major",
                                "minor",
                                "patch"
                            ]
                        },
                        {
                            "type": "string"
                        }
                    ]
                },
                "schema": {
                    "description": "This should ideally hold a link to the Postman schema that is used to validate this collection. E.g: https://schema.getpostman.com/collection/v1",
                    "type": "string"
                }
            },
            "required": [
                "name",
                "schema"
            ]
        },
        "item-group": {
            "title": "Folder",
            "id": "#/definitions/item-group",
            "description": "One of the primary goals of Postman is to organize the development of APIs. To this end, it is necessary to be able to group requests together. This can be achived using 'Folders'. A folder just is an ordered set of requests.",
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "A folder's friendly name is defined by this field. You would want to set this field to a value that would allow you to easily identify this folder."
                },
                "description": {
                    "type": "string",
                    "description": "Essays about the folder go into this field!"
                },
                "item": {
                    "description": "Items are entities which contain an actual HTTP request, and sample responses attached to it. Folders may contain many items.",
                    "type": "array",
                    "items": {
                        "title": "Items",
                        "anyOf": [
                            {
                                "$ref": "#/definitions/item"
                            },
                            {
                                "$ref": "#/definitions/item-group"
                            }
                        ]
                    }
                },
                "auth": {
                    "$ref": "#/definitions/auth"
                }
            },
            "required": [
                "item"
            ]
        },
        "item": {
            "type": "object",
            "title": "Item",
            "id": "#/definitions/item",
            "description": "Items are entities which contain an actual HTTP request, and sample responses attached to it.",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "A unique ID that is used to identify collections internally"
                },
                "name": {
                    "description": "A friendly name can be attached to each Item.",
                    "type": "string"
                },
                "event": {
                    "description": "Postman allows you to configure scripts to run when specific events occur. These scripts are stored here, and can be referenced in the collection by their ID.",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/event"
                    }
                },
                "request": {
                    "$ref": "#/definitions/request"
                },
                "response": {
                    "type": "array",
                    "title": "Responses",
                    "items": {
                        "$ref": "#/definitions/response"
                    }
                }
            },
            "required": [
                "request"
            ]
        },
        "request": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "#/definitions/request",
            "title": "Request",
            "description": "A request represents an HTTP request. If a string, the string is assumed to be the request URL and the method is assumed to be 'GET'.",
            "oneOf": [
                {
                    "type": "object",
                    "title": "Request",
                    "properties": {
                        "url": {
                            "$ref": "#/definitions/url"
                        },
                        "auth": {
                            "$ref": "#/definitions/auth"
                        },
                        "method": {
                            "description": "The HTTP method associated with this request.",
                            "type": "string",
                            "enum": [
                                "GET",
                                "PUT",
                                "POST",
                                "PATCH",
                                "DELETE",
                                "COPY",
                                "HEAD",
                                "OPTIONS",
                                "LINK",
                                "UNLINK",
                                "PURGE",
                                "LOCK",
                                "UNLOCK",
                                "PROPFIND",
                                "VIEW"
                            ]
                        },
                        "header": {
                            "oneOf": [
                                {
                                    "type": "array",
                                    "title": "Headers",
                                    "description": "No HTTP request is complete without its headers, and the same is true for a Postman request. This field is an array containing all the headers.",
                                    "items": {
                                        "$ref": "#/definitions/header"
                                    }
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "body": {
                            "type": "object",
                            "description": "This field contains the data usually contained in the request body.",
                            "properties": {
                                "mode": {
                                    "description": "Postman stores the type of data associated with this request in this field.",
                                    "enum": [
                                        "raw",
                                        "urlencoded",
                                        "formdata"
                                    ]
                                },
                                "raw": {
                                    "type": "string"
                                },
                                "urlencoded": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "title": "UrlEncodedParameter",
                                        "properties": {
                                            "key": {
                                                "type": "string"
                                            },
                                            "value": {
                                                "type": "string"
                                            },
                                            "enabled": {
                                                "type": "boolean"
                                            }
                                        }
                                    }
                                },
                                "formdata": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "title": "FormParameter",
                                        "properties": {
                                            "key": {
                                                "type": "string"
                                            },
                                            "value": {
                                                "type": "string"
                                            },
                                            "enabled": {
                                                "type": "boolean"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                {
                    "type": "string"
                }
            ]
        },
        "response": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "#/definitions/response",
            "title": "Response",
            "description": "A response represents an HTTP response.",
            "properties": {
                "originalRequest": {
                    "$ref": "#/definitions/request"
                },
                "responseTime": {
                    "title": "ResponseTime",
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "number"
                        }
                    ],
                    "description": "The time taken by the request to complete. If a number, the unit is milliseconds."
                },
                "header": {
                    "title": "Headers",
                    "oneOf": [
                        {
                            "type": "array",
                            "title": "Header",
                            "description": "No HTTP request is complete without its headers, and the same is true for a Postman request. This field is an array containing all the headers.",
                            "items": {
                                "oneOf": [
                                    {
                                        "$ref": "#/definitions/header"
                                    },
                                    {
                                        "title": "Header",
                                        "type": "string"
                                    }
                                ]
                            }
                        },
                        {
                            "type": "string"
                        }
                    ]
                },
                "cookie": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/cookie"
                    }
                },
                "body": {
                    "type": "string",
                    "description": "The raw text of the response."
                },
                "status": {
                    "type": "string",
                    "description": "The response status, e.g: '200 OK'"
                },
                "code": {
                    "type": "integer",
                    "description": "The numerical response code, example: 200, 201, 404, etc."
                }
            }
        },
        "script": {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "#/definitions/script",
            "title": "Script",
            "description": "A script is a snippet of Javascript code that can be used to to perform setup or teardown operations on a particular response.",
            "oneOf": [
                {
                    "title": "Script",
                    "type": "object",
                    "properties": {
                        "id": {
                            "description": "A unique, user defined identifier that can  be used to refer to this script from requests.",
                            "type": "string"
                        },
                        "type": {
                            "description": "Type of the script. E.g: 'text/javascript'",
                            "type": "string"
                        },
                        "exec": {
                            "oneOf": [
                                {
                                    "type": "array",
                                    "description": "This is an array of strings, where each line represents a single line of code. Having lines separate makes it possible to easily track changes made to scripts.",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "src": {
                            "$ref": "#/definitions/url"
                        },
                        "name": {
                            "type": "string",
                            "description": "Script name"
                        }
                    }
                },
                {
                    "type": "string"
                }
            ]
        },
        "url": {
            "description": "If object, contains the complete broken-down URL for this request. If string, contains the literal request URL.",
            "id": "#/definitions/url",
            "title": "Url",
            "oneOf": [
                {
                    "type": "object",
                    "properties": {
                        "protocol": {
                            "type": "string",
                            "description": "The protocol associated with the request, E.g: 'http'"
                        },
                        "domain": {
                            "title": "Domain",
                            "description": "The domain for the URL, E.g: api.yourdomain.com. Can be stored as a string or as an array of strings.",
                            "oneOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    },
                                    "description": "The domain, split into subdomain strings."
                                }
                            ]
                        },
                        "path": {
                            "oneOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "array",
                                    "description": "The complete path of the current url, broken down into segments. A segment could be a string, or a path variable.",
                                    "items": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "port": {
                            "type": "string",
                            "description": "The port number present in this URL. An empty value implies 80/443 depending on whether the protocol field contains http/https."
                        },
                        "query": {
                            "type": "array",
                            "description": "An array of QueryParams, which is basically the query string part of the URL, parsed into separate variables",
                            "items": {
                                "type": "object",
                                "title": "QueryParam",
                                "properties": {
                                    "key": {
                                        "type": "string"
                                    },
                                    "value": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string"
                                    }
                                }
                            }
                        },
                        "hash": {
                            "description": "Contains the URL fragment (if any). Usually this is not transmitted over the network, but it could be useful to store this in some cases.",
                            "type": "string"
                        },
                        "variable": {
                            "type": "array",
                            "description": "Postman supports path variables with the syntax `/path/:variableName/to/somewhere`. These variables are stored in this field.",
                            "items": {
                                "$ref": "#/definitions/variable"
                            }
                        }
                    }
                },
                {
                    "type": "string"
                }
            ]
        },
        "variable": {
            "id": "#/definitions/variable",
            "title": "Variable",
            "description": "Using variables in your Postman requests eliminates the need to duplicate requests, which can save a lot of time. Variables can be defined, and referenced to from any part of a request.",
            "type": "object",
            "properties": {
                "id": {
                    "description": "A variable ID is a unique user-defined value that identifies the variable within a collection. In traditional terms, this would be a variable name.",
                    "type": "string"
                },
                "value": {
                    "description": "The value that a variable holds in this collection. Ultimately, the variables will be replaced by this value, when say running a set of requests from a collection"
                },
                "type": {
                    "description": "A variable may have multiple types. This field specifies the type of the variable.",
                    "type": "string"
                },
                "name": {
                    "type": "string",
                    "description": "Variable name"
                }
            }
        }
    }
}