> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# API definition security validation

POST https://api.postman.com/security/api-validation
Content-Type: application/json

**This endpoint is deprecated.**

Performs an analysis on the given definition and returns any issues based on your [predefined rulesets](https://learning.postman.com/docs/api-governance/configurable-rules/configurable-rules-overview/). This endpoint can help you understand the violations' impact and offers solutions to help you resolve any errors. You can include this endpoint to your CI/CD process to automate schema validation.

**Note:**

- The maximum allowed size of the definition is 10 MB.
- You must [import and enable](https://learning.postman.com/docs/api-governance/configurable-rules/configuring-api-governance-rules/) Postman's [OWASP security rules](https://postman.postman.co/api-governance/libraries/postman_owasp/view) for this endpoint to return any security rule violations.


Reference: https://learning.postman.com/api-docs/api-reference/api-governance/schema-security-validation

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Body (application/json)

This endpoint expects a schemaSecurityValidationRequest.

- `schema` (SchemaSecurityValidationRequestSchema, optional) — The API definition to validate.

## Response

### 200

Successful Response

- `warnings` (list of map from string to any, optional) — Information about each issue discovered in the analysis. Each object includes the violation's severity and category, the location of the issue, data paths, and other information. This returns an empty object if there are no issues present in the schema. If there are issues, this returns the `possibleFixUrl` response in each warning object. This provides a link to documentation you can use to resolve the warning.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (CommonErrorNameObjectNameMessageError, optional) — Information about the error.

### 401 Unauthorized Error

Unauthorized

- `SchemaSecurityValidationRequestUnauthorizedError`

### 403 Forbidden Error

Forbidden

- `SchemaSecurityValidationRequestForbiddenError`

### 500 Internal Server Error

Internal Server Error

- `SchemaSecurityValidationRequestInternalServerError`

## Types

### SchemaSecurityValidationRequestSchema

The API definition to validate.

- `language` (enum, required) — The definition format.
  - Allowed values: `json`, `yaml`
- `schema` (string, required) — The stringified API definition.
- `type` (enum, required) — The definition type.
  - Allowed values: `openapi3`, `openapi2`

### CommonErrorNameObjectNameMessageError

Information about the error.

- `name` (CommonErrorNameObjectNameMessageErrorName, optional) — Information about the error.

### commonErrorTypeTitleDetailStatus

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### commonErrorNameMessage

- `error` (CommonErrorNameMessageError, optional) — Information about the error.

### commonErrorTypeTitleDetail

- `type` (string, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (CommonErrorTypeTitleDetailDetail, optional) — Information about the error.

### CommonErrorNameObjectNameMessageErrorName

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

### CommonErrorTypeTitleDetailStatusType

The type of error.

### CommonErrorNameMessageError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

### CommonErrorTypeTitleDetailDetail

Information about the error.

## Examples

### No Warnings Found

**Request**

```json
undefined
```

**Response**

```json
{
  "warnings": []
}
```

**SDK Code**

```python No Warnings Found
import requests

url = "https://api.postman.com/security/api-validation"

headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript No Warnings Found
const url = 'https://api.postman.com/security/api-validation';
const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go No Warnings Found
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/security/api-validation"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby No Warnings Found
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/security/api-validation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java No Warnings Found
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/security/api-validation")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php No Warnings Found
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/security/api-validation', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp No Warnings Found
using RestSharp;

var client = new RestClient("https://api.postman.com/security/api-validation");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift No Warnings Found
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/security/api-validation")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Successful Response with Governance Warnings

**Request**

```json
undefined
```

**Response**

```json
{
  "warnings": [
    {
      "category": {
        "name": "governance",
        "slug": "governance"
      },
      "checksum": "5c17d7472a8b6a22e99524fb80a4a24128bebfb9970aefa16eb496792dbc7195",
      "dataPath": [
        "paths",
        "/spacecrafts/{spacecraftId}",
        "get"
      ],
      "location": {
        "end": {
          "column": 50,
          "line": 38
        },
        "start": {
          "column": 8,
          "line": 19
        }
      },
      "message": "All of your operations need summaries.",
      "possibleFixUrl": "https://go.pstmn.io/openapi3-security-warnings#all-operations-should-have-summaries",
      "severity": "ERROR",
      "slug": "OPENAPI_SPECTRAL_6_RULE_1016",
      "type": "governance",
      "vulnerability": {
        "name": "All of your operations need summaries.",
        "slug": "OPENAPI_SPECTRAL_6_operations_summary"
      }
    }
  ]
}
```

**SDK Code**

```python Successful Response with Governance Warnings
import requests

url = "https://api.postman.com/security/api-validation"

headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Successful Response with Governance Warnings
const url = 'https://api.postman.com/security/api-validation';
const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Successful Response with Governance Warnings
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/security/api-validation"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Successful Response with Governance Warnings
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/security/api-validation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Successful Response with Governance Warnings
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/security/api-validation")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Successful Response with Governance Warnings
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/security/api-validation', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Successful Response with Governance Warnings
using RestSharp;

var client = new RestClient("https://api.postman.com/security/api-validation");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response with Governance Warnings
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/security/api-validation")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Successful Response with Security Warnings

**Request**

```json
undefined
```

**Response**

```json
{
  "warnings": [
    {
      "category": {
        "name": "security",
        "slug": "security"
      },
      "checksum": "db2c5b351010e803bb3cebf21c48275909bd89715660fa1865e8c55595d4928d",
      "dataPath": [],
      "location": {
        "end": {
          "column": 21,
          "line": 78
        },
        "start": {
          "column": 0,
          "line": 1
        }
      },
      "message": "Security field is not defined",
      "possibleFixUrl": "https://go.pstmn.io/openapi3-security-warnings#security-field-is-not-defined",
      "severity": "ERROR",
      "slug": "OPENAPI_SCHEMA_RULE_0005",
      "type": "security",
      "vulnerability": {
        "name": "Security field is not defined",
        "slug": "OPENAPI_VUL_0003"
      }
    },
    {
      "category": {
        "name": "security",
        "slug": "security"
      },
      "checksum": "44dd11f850da75d478d246361a95435c7dd8da799ce689a8648449af7b3c7b43",
      "dataPath": [
        "paths",
        "/spacecrafts/{spacecraftId}",
        "get"
      ],
      "location": {
        "end": {
          "column": 50,
          "line": 39
        },
        "start": {
          "column": 8,
          "line": 19
        }
      },
      "message": "Operation does not enforce any security scheme.",
      "possibleFixUrl": "https://go.pstmn.io/openapi3-security-warnings#operation-does-not-enforce-any-security-scheme",
      "severity": "WARN",
      "slug": "OPENAPI_SCHEMA_RULE_0017",
      "type": "security",
      "vulnerability": {
        "name": "Operation does not enforce any security scheme",
        "slug": "OPENAPI_VUL_0012"
      }
    }
  ]
}
```

**SDK Code**

```python Successful Response with Security Warnings
import requests

url = "https://api.postman.com/security/api-validation"

headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Successful Response with Security Warnings
const url = 'https://api.postman.com/security/api-validation';
const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Successful Response with Security Warnings
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/security/api-validation"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Successful Response with Security Warnings
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/security/api-validation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Successful Response with Security Warnings
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/security/api-validation")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Successful Response with Security Warnings
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/security/api-validation', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Successful Response with Security Warnings
using RestSharp;

var client = new RestClient("https://api.postman.com/security/api-validation");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response with Security Warnings
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/security/api-validation")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Request Body

**Request**

```json
{
  "schema": {
    "language": "json",
    "schema": "{\n  \"openapi\": \"3.0.0\",\n  \"servers\": [\n    {\n      \"url\": \"example.com\"\n    }\n  ],\n  \"info\": {\n    \"contact\": {\n      \"name\": \"Jon\"\n    },\n    \"version\": \"1.0.0\",\n    \"title\": \"Sample API\",\n    \"description\": \"Buy or rent spacecrafts\"\n  },\n  \"paths\": {\n    \"/spacecrafts/{spacecraftId}\": {\n      \"parameters\": [\n        {\n          \"name\": \"spacecraftId\",\n          \"description\": \"The unique identifier of the spacecraft\",\n          \"in\": \"path\",\n          \"required\": true,\n          \"schema\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          }\n        }\n      ],\n      \"get\": {\n        \"summary\": \"Read a spacecraft\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Spacecraft\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"No spacecraft found for the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          },\n          \"500\": {\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      \"SpacecraftId\": {\n        \"description\": \"The unique identifier of a spacecraft\",\n        \"type\": \"string\"\n      },\n      \"Spacecraft\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"type\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"capsule\",\n              \"probe\",\n              \"satellite\",\n              \"spaceplane\",\n              \"station\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"Error\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"message\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"description\": \"A human readable error message\",\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"securitySchemes\": {\n      \"ApiKey\": {\n        \"type\": \"apiKey\",\n        \"in\": \"header\",\n        \"name\": \"X-Api-Key\"\n      }\n    }\n  },\n  \"security\": [\n    {\n      \"ApiKey\": []\n    }\n  ]\n}",
    "type": "openapi3"
  }
}
```

**Response**

```json
{
  "warnings": []
}
```

**SDK Code**

```python Request Body
import requests

url = "https://api.postman.com/security/api-validation"

payload = { "schema": {
        "language": "json",
        "schema": "{
  \"openapi\": \"3.0.0\",
  \"servers\": [
    {
      \"url\": \"example.com\"
    }
  ],
  \"info\": {
    \"contact\": {
      \"name\": \"Jon\"
    },
    \"version\": \"1.0.0\",
    \"title\": \"Sample API\",
    \"description\": \"Buy or rent spacecrafts\"
  },
  \"paths\": {
    \"/spacecrafts/{spacecraftId}\": {
      \"parameters\": [
        {
          \"name\": \"spacecraftId\",
          \"description\": \"The unique identifier of the spacecraft\",
          \"in\": \"path\",
          \"required\": true,
          \"schema\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          }
        }
      ],
      \"get\": {
        \"summary\": \"Read a spacecraft\",
        \"responses\": {
          \"200\": {
            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Spacecraft\"
                }
              }
            }
          },
          \"404\": {
            \"description\": \"No spacecraft found for the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          },
          \"500\": {
            \"description\": \"Unexpected error\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          }
        }
      }
    }
  },
  \"components\": {
    \"schemas\": {
      \"SpacecraftId\": {
        \"description\": \"The unique identifier of a spacecraft\",
        \"type\": \"string\"
      },
      \"Spacecraft\": {
        \"type\": \"object\",
        \"required\": [
          \"id\",
          \"name\",
          \"type\"
        ],
        \"properties\": {
          \"id\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          },
          \"name\": {
            \"type\": \"string\"
          },
          \"type\": {
            \"type\": \"string\",
            \"enum\": [
              \"capsule\",
              \"probe\",
              \"satellite\",
              \"spaceplane\",
              \"station\"
            ]
          },
          \"description\": {
            \"type\": \"string\"
          }
        }
      },
      \"Error\": {
        \"type\": \"object\",
        \"required\": [
          \"message\"
        ],
        \"properties\": {
          \"message\": {
            \"description\": \"A human readable error message\",
            \"type\": \"string\"
          }
        }
      }
    },
    \"securitySchemes\": {
      \"ApiKey\": {
        \"type\": \"apiKey\",
        \"in\": \"header\",
        \"name\": \"X-Api-Key\"
      }
    }
  },
  \"security\": [
    {
      \"ApiKey\": []
    }
  ]
}",
        "type": "openapi3"
    } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Request Body
const url = 'https://api.postman.com/security/api-validation';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"schema":{"language":"json","schema":"{\n  \"openapi\": \"3.0.0\",\n  \"servers\": [\n    {\n      \"url\": \"example.com\"\n    }\n  ],\n  \"info\": {\n    \"contact\": {\n      \"name\": \"Jon\"\n    },\n    \"version\": \"1.0.0\",\n    \"title\": \"Sample API\",\n    \"description\": \"Buy or rent spacecrafts\"\n  },\n  \"paths\": {\n    \"/spacecrafts/{spacecraftId}\": {\n      \"parameters\": [\n        {\n          \"name\": \"spacecraftId\",\n          \"description\": \"The unique identifier of the spacecraft\",\n          \"in\": \"path\",\n          \"required\": true,\n          \"schema\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          }\n        }\n      ],\n      \"get\": {\n        \"summary\": \"Read a spacecraft\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Spacecraft\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"No spacecraft found for the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          },\n          \"500\": {\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      \"SpacecraftId\": {\n        \"description\": \"The unique identifier of a spacecraft\",\n        \"type\": \"string\"\n      },\n      \"Spacecraft\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"type\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"capsule\",\n              \"probe\",\n              \"satellite\",\n              \"spaceplane\",\n              \"station\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"Error\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"message\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"description\": \"A human readable error message\",\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"securitySchemes\": {\n      \"ApiKey\": {\n        \"type\": \"apiKey\",\n        \"in\": \"header\",\n        \"name\": \"X-Api-Key\"\n      }\n    }\n  },\n  \"security\": [\n    {\n      \"ApiKey\": []\n    }\n  ]\n}","type":"openapi3"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Request Body
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/security/api-validation"

	payload := strings.NewReader("{\n  \"schema\": {\n    \"language\": \"json\",\n    \"schema\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\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      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n    \"type\": \"openapi3\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Request Body
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/security/api-validation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"schema\": {\n    \"language\": \"json\",\n    \"schema\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\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      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n    \"type\": \"openapi3\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Request Body
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/security/api-validation")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"schema\": {\n    \"language\": \"json\",\n    \"schema\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\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      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n    \"type\": \"openapi3\"\n  }\n}")
  .asString();
```

```php Request Body
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/security/api-validation', [
  'body' => '{
  "schema": {
    "language": "json",
    "schema": "{\\n  \\"openapi\\": \\"3.0.0\\",\\n  \\"servers\\": [\\n    {\\n      \\"url\\": \\"example.com\\"\\n    }\\n  ],\\n  \\"info\\": {\\n    \\"contact\\": {\\n      \\"name\\": \\"Jon\\"\\n    },\\n    \\"version\\": \\"1.0.0\\",\\n    \\"title\\": \\"Sample API\\",\\n    \\"description\\": \\"Buy or rent spacecrafts\\"\\n  },\\n  \\"paths\\": {\\n    \\"/spacecrafts/{spacecraftId}\\": {\\n      \\"parameters\\": [\\n        {\\n          \\"name\\": \\"spacecraftId\\",\\n          \\"description\\": \\"The unique identifier of the spacecraft\\",\\n          \\"in\\": \\"path\\",\\n          \\"required\\": true,\\n          \\"schema\\": {\\n            \\"$ref\\": \\"#/components/schemas/SpacecraftId\\"\\n          }\\n        }\\n      ],\\n      \\"get\\": {\\n        \\"summary\\": \\"Read a spacecraft\\",\\n        \\"responses\\": {\\n          \\"200\\": {\\n            \\"description\\": \\"The spacecraft corresponding to the provided `spacecraftId`\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Spacecraft\\"\\n                }\\n              }\\n            }\\n          },\\n          \\"404\\": {\\n            \\"description\\": \\"No spacecraft found for the provided `spacecraftId`\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Error\\"\\n                }\\n              }\\n            }\\n          },\\n          \\"500\\": {\\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      \\"SpacecraftId\\": {\\n        \\"description\\": \\"The unique identifier of a spacecraft\\",\\n        \\"type\\": \\"string\\"\\n      },\\n      \\"Spacecraft\\": {\\n        \\"type\\": \\"object\\",\\n        \\"required\\": [\\n          \\"id\\",\\n          \\"name\\",\\n          \\"type\\"\\n        ],\\n        \\"properties\\": {\\n          \\"id\\": {\\n            \\"$ref\\": \\"#/components/schemas/SpacecraftId\\"\\n          },\\n          \\"name\\": {\\n            \\"type\\": \\"string\\"\\n          },\\n          \\"type\\": {\\n            \\"type\\": \\"string\\",\\n            \\"enum\\": [\\n              \\"capsule\\",\\n              \\"probe\\",\\n              \\"satellite\\",\\n              \\"spaceplane\\",\\n              \\"station\\"\\n            ]\\n          },\\n          \\"description\\": {\\n            \\"type\\": \\"string\\"\\n          }\\n        }\\n      },\\n      \\"Error\\": {\\n        \\"type\\": \\"object\\",\\n        \\"required\\": [\\n          \\"message\\"\\n        ],\\n        \\"properties\\": {\\n          \\"message\\": {\\n            \\"description\\": \\"A human readable error message\\",\\n            \\"type\\": \\"string\\"\\n          }\\n        }\\n      }\\n    },\\n    \\"securitySchemes\\": {\\n      \\"ApiKey\\": {\\n        \\"type\\": \\"apiKey\\",\\n        \\"in\\": \\"header\\",\\n        \\"name\\": \\"X-Api-Key\\"\\n      }\\n    }\\n  },\\n  \\"security\\": [\\n    {\\n      \\"ApiKey\\": []\\n    }\\n  ]\\n}",
    "type": "openapi3"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Request Body
using RestSharp;

var client = new RestClient("https://api.postman.com/security/api-validation");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"schema\": {\n    \"language\": \"json\",\n    \"schema\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\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      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n    \"type\": \"openapi3\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Request Body
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["schema": [
    "language": "json",
    "schema": "{
  \"openapi\": \"3.0.0\",
  \"servers\": [
    {
      \"url\": \"example.com\"
    }
  ],
  \"info\": {
    \"contact\": {
      \"name\": \"Jon\"
    },
    \"version\": \"1.0.0\",
    \"title\": \"Sample API\",
    \"description\": \"Buy or rent spacecrafts\"
  },
  \"paths\": {
    \"/spacecrafts/{spacecraftId}\": {
      \"parameters\": [
        {
          \"name\": \"spacecraftId\",
          \"description\": \"The unique identifier of the spacecraft\",
          \"in\": \"path\",
          \"required\": true,
          \"schema\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          }
        }
      ],
      \"get\": {
        \"summary\": \"Read a spacecraft\",
        \"responses\": {
          \"200\": {
            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Spacecraft\"
                }
              }
            }
          },
          \"404\": {
            \"description\": \"No spacecraft found for the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          },
          \"500\": {
            \"description\": \"Unexpected error\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          }
        }
      }
    }
  },
  \"components\": {
    \"schemas\": {
      \"SpacecraftId\": {
        \"description\": \"The unique identifier of a spacecraft\",
        \"type\": \"string\"
      },
      \"Spacecraft\": {
        \"type\": \"object\",
        \"required\": [
          \"id\",
          \"name\",
          \"type\"
        ],
        \"properties\": {
          \"id\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          },
          \"name\": {
            \"type\": \"string\"
          },
          \"type\": {
            \"type\": \"string\",
            \"enum\": [
              \"capsule\",
              \"probe\",
              \"satellite\",
              \"spaceplane\",
              \"station\"
            ]
          },
          \"description\": {
            \"type\": \"string\"
          }
        }
      },
      \"Error\": {
        \"type\": \"object\",
        \"required\": [
          \"message\"
        ],
        \"properties\": {
          \"message\": {
            \"description\": \"A human readable error message\",
            \"type\": \"string\"
          }
        }
      }
    },
    \"securitySchemes\": {
      \"ApiKey\": {
        \"type\": \"apiKey\",
        \"in\": \"header\",
        \"name\": \"X-Api-Key\"
      }
    }
  },
  \"security\": [
    {
      \"ApiKey\": []
    }
  ]
}",
    "type": "openapi3"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/security/api-validation")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```