> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Create or update a schema file

PUT https://api.getpostman.com/apis/{apiId}/schemas/{schemaId}/files/{file-path}
Content-Type: application/json

Creates or updates an API schema file.

**Note:**

- If the provided file path exists, the file is updated with the new contents.
- If the provided file path does not exist, then a new schema file is created.
- If the file path contains a `/` (forward slash) character, then a folder is created. For example, if the file path is the `dir/schema.json` value, then a `dir` folder is created with the `schema.json` file inside.
- You can only update the `root` tag for protobuf specifications.


Reference: https://learning.postman.com/api-docs/api-reference/api/create-update-api-schema-file

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /apis/{apiId}/schemas/{schemaId}/files/{file-path}:
    put:
      operationId: createUpdateApiSchemaFile
      summary: Create or update a schema file
      description: >
        Creates or updates an API schema file.


        **Note:**


        - If the provided file path exists, the file is updated with the new
        contents.

        - If the provided file path does not exist, then a new schema file is
        created.

        - If the file path contains a `/` (forward slash) character, then a
        folder is created. For example, if the file path is the
        `dir/schema.json` value, then a `dir` folder is created with the
        `schema.json` file inside.

        - You can only update the `root` tag for protobuf specifications.
      tags:
        - api
      parameters:
        - name: apiId
          in: path
          description: The API's ID.
          required: true
          schema:
            $ref: '#/components/schemas/apiId'
        - name: schemaId
          in: path
          description: The API schema's ID.
          required: true
          schema:
            $ref: '#/components/schemas/apiSchemaId'
        - name: file-path
          in: path
          description: The path to the schema file.
          required: true
          schema:
            $ref: '#/components/schemas/file-path'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          description: >-
            The `application/vnd.api.v10+json` request header required to use
            the endpoint.
          required: true
          schema:
            $ref: '#/components/schemas/v10Accept'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createUpdateApiSchemaFileResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateUpdateApiSchemaFileRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatusInstance'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateUpdateApiSchemaFileRequestForbiddenError
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateUpdateApiSchemaFileRequestNotFoundError
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateUpdateApiSchemaFileRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createUpdateApiSchemaFile'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    apiId:
      type: string
      title: apiId
    apiSchemaId:
      type: string
      title: apiSchemaId
    file-path:
      type: string
      title: file-path
    v10Accept:
      type: string
      enum:
        - application/vnd.api.v10+json
      title: v10Accept
    CreateUpdateApiSchemaFileRoot:
      type: object
      properties:
        enabled:
          type: boolean
          description: >-
            If true, tag the file as the root file. You can only update the root
            tag for protobuf specifications.
      description: Information about the schema's root file.
      title: CreateUpdateApiSchemaFileRoot
    createUpdateApiSchemaFile:
      type: object
      properties:
        name:
          type: string
          description: The schema file's name.
        root:
          $ref: '#/components/schemas/CreateUpdateApiSchemaFileRoot'
          description: Information about the schema's root file.
        content:
          type: string
          description: The schema file's stringified contents.
      description: Information about schema file.
      title: createUpdateApiSchemaFile
    CreateUpdateApiSchemaFileResponseRoot:
      type: object
      properties:
        enabled:
          type: boolean
          description: If true, the file is the schema's the root file.
      description: Information about the schema's root file.
      title: CreateUpdateApiSchemaFileResponseRoot
    createUpdateApiSchemaFileResponse:
      type: object
      properties:
        createdBy:
          type: string
          description: The user ID of the user that created the file.
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the file was created.
        root:
          $ref: '#/components/schemas/CreateUpdateApiSchemaFileResponseRoot'
          description: Information about the schema's root file.
        name:
          type: string
          description: The schema file's name.
        path:
          type: string
          description: The file system path to the schema file.
        updatedBy:
          type: string
          description: The user ID of the user that last updated the file.
        id:
          type: string
          description: The schema file's ID.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the file was last updated.
      description: Information about the schema file.
      title: createUpdateApiSchemaFileResponse
    CommonErrorTypeTitleDetailDetail:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: Information about the error.
      title: CommonErrorTypeTitleDetailDetail
    commonErrorTypeTitleDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailDetail'
          description: Information about the error.
      title: commonErrorTypeTitleDetail
    apiErrorNameMessage:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      title: apiErrorNameMessage
    CommonErrorNameMessageError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: CommonErrorNameMessageError
    commonErrorNameMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageError'
          description: Information about the error.
      title: commonErrorNameMessage
    CreateUpdateApiSchemaFileRequestBadRequestError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/apiErrorNameMessage'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: CreateUpdateApiSchemaFileRequestBadRequestError
    commonErrorTypeTitleDetailStatusInstance:
      type: object
      properties:
        type:
          type: string
          format: uri-reference
          description: >-
            The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that
            identifies the type of problem.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: An explanation about the problem.
        status:
          type: integer
          description: The HTTP status code generated by the origin server.
        instance:
          type: string
          description: >-
            The URI reference that identifies the specific occurrence of the
            problem.
      title: commonErrorTypeTitleDetailStatusInstance
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    commonErrorTypeTitleMessageDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        message:
          type: string
          description: The error message.
        detail:
          type: object
          additionalProperties:
            description: Any type
          description: Information about the error.
      title: commonErrorTypeTitleMessageDetail
    CreateUpdateApiSchemaFileRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorTypeTitleMessageDetail'
      title: CreateUpdateApiSchemaFileRequestForbiddenError
    CommonErrorErrorObjTypeTitleDetailError:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Details about the error.
      description: Information about the error.
      title: CommonErrorErrorObjTypeTitleDetailError
    commonErrorErrorObjTypeTitleDetail:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorErrorObjTypeTitleDetailError'
          description: Information about the error.
      title: commonErrorErrorObjTypeTitleDetail
    CreateUpdateApiSchemaFileRequestNotFoundError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorErrorObjTypeTitleDetail'
      title: CreateUpdateApiSchemaFileRequestNotFoundError
    CreateUpdateApiSchemaFileRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: CreateUpdateApiSchemaFileRequestInternalServerError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples

### Successful Response



**Request**

```json
undefined
```

**Response**

```json
{
  "createdBy": "12345678",
  "createdAt": "2024-07-18T13:47:39.000Z",
  "root": {
    "enabled": true
  },
  "name": "index.json",
  "path": "index.json",
  "updatedBy": "12345678",
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "updatedAt": "2024-07-18T13:48:28.000Z"
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

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

```go Successful Response
package main

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

func main() {

	url := "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

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

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	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 Successful Response
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

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

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

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json', [
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### JSON Schema



**Request**

```json
{
  "content": "{\n  \"openapi\": \"3.0.0\",\n  \"info\": {\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  ]\n}"
}
```

**Response**

```json
{
  "createdBy": "12345678",
  "createdAt": "2024-07-18T13:47:39.000Z",
  "root": {
    "enabled": true
  },
  "name": "index.json",
  "path": "index.json",
  "updatedBy": "12345678",
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "updatedAt": "2024-07-18T13:48:28.000Z"
}
```

**SDK Code**

```python JSON Schema
import requests

url = "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

payload = { "content": "{
  \"openapi\": \"3.0.0\",
  \"info\": {
    \"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\": [

      ]
    }
  ]
}" }
headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript JSON Schema
const url = 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"content":"{\n  \"openapi\": \"3.0.0\",\n  \"info\": {\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  ]\n}"}'
};

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

```go JSON Schema
package main

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

func main() {

	url := "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

	payload := strings.NewReader("{\n  \"content\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"info\\\": {\\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  ]\\n}\"\n}")

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

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	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 JSON Schema
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"info\\\": {\\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  ]\\n}\"\n}"

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

```java JSON Schema
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"info\\\": {\\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  ]\\n}\"\n}")
  .asString();
```

```php JSON Schema
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json', [
  'body' => '{
  "content": "{\\n  \\"openapi\\": \\"3.0.0\\",\\n  \\"info\\": {\\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  ]\\n}"
}',
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp JSON Schema
using RestSharp;

var client = new RestClient("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"content\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"info\\\": {\\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  ]\\n}\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift JSON Schema
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["content": "{
  \"openapi\": \"3.0.0\",
  \"info\": {
    \"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\": [

      ]
    }
  ]
}"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### YAML Schema



**Request**

```json
{
  "content": "openapi: \"3.1.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"Sample API\"\n  description: Buy or rent spacecrafts\n\npaths:\n  /spacecrafts/{spacecraftId}:\n    parameters:\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    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        404:\n          description: No spacecraft found for the provided `spacecraftId`\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n        500:\n          description: Unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    SpacecraftId:\n      description: The unique identifier of a spacecraft\n      type: string\n    Spacecraft:\n      type: object\n      required:\n        - id\n        - name\n        - type\n      properties:\n        id:\n          $ref: \"#/components/schemas/SpacecraftId\"\n        name:\n          type: string\n        type:\n          type: string\n          enum:\n            - capsule\n            - probe\n            - satellite\n            - spaceplane\n            - station\n        description:\n          type: string\n    Error:\n      type: object\n      required:\n        - message\n      properties:\n        message:\n          description: A human readable error message\n          type: string\n  securitySchemes:\n    ApiKey:\n      type: apiKey\n      in: header\n      name: X-Api-Key\nsecurity:\n  - ApiKey: []\n"
}
```

**Response**

```json
{
  "createdBy": "12345678",
  "createdAt": "2024-07-18T13:47:39.000Z",
  "root": {
    "enabled": true
  },
  "name": "index.json",
  "path": "index.json",
  "updatedBy": "12345678",
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "updatedAt": "2024-07-18T13:48:28.000Z"
}
```

**SDK Code**

```python YAML Schema
import requests

url = "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

payload = { "content": "openapi: \"3.1.0\"
info:
  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: []
" }
headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript YAML Schema
const url = 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"content":"openapi: \"3.1.0\"\ninfo:\n  version: \"1.0.0\"\n  title: \"Sample API\"\n  description: Buy or rent spacecrafts\n\npaths:\n  /spacecrafts/{spacecraftId}:\n    parameters:\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    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        404:\n          description: No spacecraft found for the provided `spacecraftId`\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\n        500:\n          description: Unexpected error\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Error\"\ncomponents:\n  schemas:\n    SpacecraftId:\n      description: The unique identifier of a spacecraft\n      type: string\n    Spacecraft:\n      type: object\n      required:\n        - id\n        - name\n        - type\n      properties:\n        id:\n          $ref: \"#/components/schemas/SpacecraftId\"\n        name:\n          type: string\n        type:\n          type: string\n          enum:\n            - capsule\n            - probe\n            - satellite\n            - spaceplane\n            - station\n        description:\n          type: string\n    Error:\n      type: object\n      required:\n        - message\n      properties:\n        message:\n          description: A human readable error message\n          type: string\n  securitySchemes:\n    ApiKey:\n      type: apiKey\n      in: header\n      name: X-Api-Key\nsecurity:\n  - ApiKey: []\n"}'
};

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

```go YAML Schema
package main

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

func main() {

	url := "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

	payload := strings.NewReader("{\n  \"content\": \"openapi: \\\"3.1.0\\\"\\ninfo:\\n  version: \\\"1.0.0\\\"\\n  title: \\\"Sample API\\\"\\n  description: Buy or rent spacecrafts\\n\\npaths:\\n  /spacecrafts/{spacecraftId}:\\n    parameters:\\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    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        404:\\n          description: No spacecraft found for the provided `spacecraftId`\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\n        500:\\n          description: Unexpected error\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\ncomponents:\\n  schemas:\\n    SpacecraftId:\\n      description: The unique identifier of a spacecraft\\n      type: string\\n    Spacecraft:\\n      type: object\\n      required:\\n        - id\\n        - name\\n        - type\\n      properties:\\n        id:\\n          $ref: \\\"#/components/schemas/SpacecraftId\\\"\\n        name:\\n          type: string\\n        type:\\n          type: string\\n          enum:\\n            - capsule\\n            - probe\\n            - satellite\\n            - spaceplane\\n            - station\\n        description:\\n          type: string\\n    Error:\\n      type: object\\n      required:\\n        - message\\n      properties:\\n        message:\\n          description: A human readable error message\\n          type: string\\n  securitySchemes:\\n    ApiKey:\\n      type: apiKey\\n      in: header\\n      name: X-Api-Key\\nsecurity:\\n  - ApiKey: []\\n\"\n}")

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

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	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 YAML Schema
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"openapi: \\\"3.1.0\\\"\\ninfo:\\n  version: \\\"1.0.0\\\"\\n  title: \\\"Sample API\\\"\\n  description: Buy or rent spacecrafts\\n\\npaths:\\n  /spacecrafts/{spacecraftId}:\\n    parameters:\\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    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        404:\\n          description: No spacecraft found for the provided `spacecraftId`\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\n        500:\\n          description: Unexpected error\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\ncomponents:\\n  schemas:\\n    SpacecraftId:\\n      description: The unique identifier of a spacecraft\\n      type: string\\n    Spacecraft:\\n      type: object\\n      required:\\n        - id\\n        - name\\n        - type\\n      properties:\\n        id:\\n          $ref: \\\"#/components/schemas/SpacecraftId\\\"\\n        name:\\n          type: string\\n        type:\\n          type: string\\n          enum:\\n            - capsule\\n            - probe\\n            - satellite\\n            - spaceplane\\n            - station\\n        description:\\n          type: string\\n    Error:\\n      type: object\\n      required:\\n        - message\\n      properties:\\n        message:\\n          description: A human readable error message\\n          type: string\\n  securitySchemes:\\n    ApiKey:\\n      type: apiKey\\n      in: header\\n      name: X-Api-Key\\nsecurity:\\n  - ApiKey: []\\n\"\n}"

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

```java YAML Schema
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"openapi: \\\"3.1.0\\\"\\ninfo:\\n  version: \\\"1.0.0\\\"\\n  title: \\\"Sample API\\\"\\n  description: Buy or rent spacecrafts\\n\\npaths:\\n  /spacecrafts/{spacecraftId}:\\n    parameters:\\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    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        404:\\n          description: No spacecraft found for the provided `spacecraftId`\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\n        500:\\n          description: Unexpected error\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\ncomponents:\\n  schemas:\\n    SpacecraftId:\\n      description: The unique identifier of a spacecraft\\n      type: string\\n    Spacecraft:\\n      type: object\\n      required:\\n        - id\\n        - name\\n        - type\\n      properties:\\n        id:\\n          $ref: \\\"#/components/schemas/SpacecraftId\\\"\\n        name:\\n          type: string\\n        type:\\n          type: string\\n          enum:\\n            - capsule\\n            - probe\\n            - satellite\\n            - spaceplane\\n            - station\\n        description:\\n          type: string\\n    Error:\\n      type: object\\n      required:\\n        - message\\n      properties:\\n        message:\\n          description: A human readable error message\\n          type: string\\n  securitySchemes:\\n    ApiKey:\\n      type: apiKey\\n      in: header\\n      name: X-Api-Key\\nsecurity:\\n  - ApiKey: []\\n\"\n}")
  .asString();
```

```php YAML Schema
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json', [
  'body' => '{
  "content": "openapi: \\"3.1.0\\"\\ninfo:\\n  version: \\"1.0.0\\"\\n  title: \\"Sample API\\"\\n  description: Buy or rent spacecrafts\\n\\npaths:\\n  /spacecrafts/{spacecraftId}:\\n    parameters:\\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    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        404:\\n          description: No spacecraft found for the provided `spacecraftId`\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\"#/components/schemas/Error\\"\\n        500:\\n          description: Unexpected error\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\"#/components/schemas/Error\\"\\ncomponents:\\n  schemas:\\n    SpacecraftId:\\n      description: The unique identifier of a spacecraft\\n      type: string\\n    Spacecraft:\\n      type: object\\n      required:\\n        - id\\n        - name\\n        - type\\n      properties:\\n        id:\\n          $ref: \\"#/components/schemas/SpacecraftId\\"\\n        name:\\n          type: string\\n        type:\\n          type: string\\n          enum:\\n            - capsule\\n            - probe\\n            - satellite\\n            - spaceplane\\n            - station\\n        description:\\n          type: string\\n    Error:\\n      type: object\\n      required:\\n        - message\\n      properties:\\n        message:\\n          description: A human readable error message\\n          type: string\\n  securitySchemes:\\n    ApiKey:\\n      type: apiKey\\n      in: header\\n      name: X-Api-Key\\nsecurity:\\n  - ApiKey: []\\n"
}',
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp YAML Schema
using RestSharp;

var client = new RestClient("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"content\": \"openapi: \\\"3.1.0\\\"\\ninfo:\\n  version: \\\"1.0.0\\\"\\n  title: \\\"Sample API\\\"\\n  description: Buy or rent spacecrafts\\n\\npaths:\\n  /spacecrafts/{spacecraftId}:\\n    parameters:\\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    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        404:\\n          description: No spacecraft found for the provided `spacecraftId`\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\n        500:\\n          description: Unexpected error\\n          content:\\n            application/json:\\n              schema:\\n                $ref: \\\"#/components/schemas/Error\\\"\\ncomponents:\\n  schemas:\\n    SpacecraftId:\\n      description: The unique identifier of a spacecraft\\n      type: string\\n    Spacecraft:\\n      type: object\\n      required:\\n        - id\\n        - name\\n        - type\\n      properties:\\n        id:\\n          $ref: \\\"#/components/schemas/SpacecraftId\\\"\\n        name:\\n          type: string\\n        type:\\n          type: string\\n          enum:\\n            - capsule\\n            - probe\\n            - satellite\\n            - spaceplane\\n            - station\\n        description:\\n          type: string\\n    Error:\\n      type: object\\n      required:\\n        - message\\n      properties:\\n        message:\\n          description: A human readable error message\\n          type: string\\n  securitySchemes:\\n    ApiKey:\\n      type: apiKey\\n      in: header\\n      name: X-Api-Key\\nsecurity:\\n  - ApiKey: []\\n\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift YAML Schema
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["content": "openapi: \"3.1.0\"
info:
  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: []
"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### GraphQL Schema



**Request**

```json
{
  "content": "type Query {\r\n  allPosts: [Post]\r\n  allUsers: [User]\r\n  postById(id: Int!): Post\r\n  userById(id: Int!): User\r\n}\r\n\r\ntype Mutation {\r\n  createPost(input: CreatePostInput!): CreatePostPayload\r\n  createUser(input: CreateUserInput!): CreateUserPayload\r\n}\r\n\r\ntype Post {\r\n  id: Int!\r\n  title: String\r\n  body: String\r\n  createdDate: Datetime\r\n  authorId: Int!\r\n  userByAuthorId: User\r\n}\r\n\r\ntype User {\r\n  id: Int!\r\n  username: String\r\n  createdDate: Datetime\r\n  postsByAuthorId: [Post]\r\n}\r\n\r\ntype CreatePostPayload {\r\n  clientMutationId: String\r\n  post: Post\r\n  userByAuthorId: User\r\n}\r\n\r\ninput CreatePostInput {\r\n  clientMutationId: String\r\n  post: PostInput!\r\n}\r\n\r\ninput PostInput {\r\n  id: Int\r\n  title: String\r\n  body: String\r\n  createdDate: Datetime\r\n  authorId: Int!\r\n}\r\n\r\ntype CreateUserPayload {\r\n  clientMutationId: String\r\n  user: User\r\n}\r\n\r\ninput CreateUserInput {\r\n  clientMutationId: String\r\n  user: UserInput!\r\n}\r\n\r\ninput UserInput {\r\n  id: Int\r\n  username: String\r\n  createdDate: Datetime\r\n}\r\n\r\nscalar Datetime\r\n"
}
```

**Response**

```json
{
  "createdBy": "12345678",
  "createdAt": "2024-07-18T13:47:39.000Z",
  "root": {
    "enabled": true
  },
  "name": "index.json",
  "path": "index.json",
  "updatedBy": "12345678",
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "updatedAt": "2024-07-18T13:48:28.000Z"
}
```

**SDK Code**

```python GraphQL Schema
import requests

url = "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

payload = { "content": "type Query {
  allPosts: [Post]
  allUsers: [User]
  postById(id: Int!): Post
  userById(id: Int!): User
}

type Mutation {
  createPost(input: CreatePostInput!): CreatePostPayload
  createUser(input: CreateUserInput!): CreateUserPayload
}

type Post {
  id: Int!
  title: String
  body: String
  createdDate: Datetime
  authorId: Int!
  userByAuthorId: User
}

type User {
  id: Int!
  username: String
  createdDate: Datetime
  postsByAuthorId: [Post]
}

type CreatePostPayload {
  clientMutationId: String
  post: Post
  userByAuthorId: User
}

input CreatePostInput {
  clientMutationId: String
  post: PostInput!
}

input PostInput {
  id: Int
  title: String
  body: String
  createdDate: Datetime
  authorId: Int!
}

type CreateUserPayload {
  clientMutationId: String
  user: User
}

input CreateUserInput {
  clientMutationId: String
  user: UserInput!
}

input UserInput {
  id: Int
  username: String
  createdDate: Datetime
}

scalar Datetime
" }
headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript GraphQL Schema
const url = 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"content":"type Query {\r\n  allPosts: [Post]\r\n  allUsers: [User]\r\n  postById(id: Int!): Post\r\n  userById(id: Int!): User\r\n}\r\n\r\ntype Mutation {\r\n  createPost(input: CreatePostInput!): CreatePostPayload\r\n  createUser(input: CreateUserInput!): CreateUserPayload\r\n}\r\n\r\ntype Post {\r\n  id: Int!\r\n  title: String\r\n  body: String\r\n  createdDate: Datetime\r\n  authorId: Int!\r\n  userByAuthorId: User\r\n}\r\n\r\ntype User {\r\n  id: Int!\r\n  username: String\r\n  createdDate: Datetime\r\n  postsByAuthorId: [Post]\r\n}\r\n\r\ntype CreatePostPayload {\r\n  clientMutationId: String\r\n  post: Post\r\n  userByAuthorId: User\r\n}\r\n\r\ninput CreatePostInput {\r\n  clientMutationId: String\r\n  post: PostInput!\r\n}\r\n\r\ninput PostInput {\r\n  id: Int\r\n  title: String\r\n  body: String\r\n  createdDate: Datetime\r\n  authorId: Int!\r\n}\r\n\r\ntype CreateUserPayload {\r\n  clientMutationId: String\r\n  user: User\r\n}\r\n\r\ninput CreateUserInput {\r\n  clientMutationId: String\r\n  user: UserInput!\r\n}\r\n\r\ninput UserInput {\r\n  id: Int\r\n  username: String\r\n  createdDate: Datetime\r\n}\r\n\r\nscalar Datetime\r\n"}'
};

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

```go GraphQL Schema
package main

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

func main() {

	url := "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

	payload := strings.NewReader("{\n  \"content\": \"type Query {\\r\\n  allPosts: [Post]\\r\\n  allUsers: [User]\\r\\n  postById(id: Int!): Post\\r\\n  userById(id: Int!): User\\r\\n}\\r\\n\\r\\ntype Mutation {\\r\\n  createPost(input: CreatePostInput!): CreatePostPayload\\r\\n  createUser(input: CreateUserInput!): CreateUserPayload\\r\\n}\\r\\n\\r\\ntype Post {\\r\\n  id: Int!\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ntype User {\\r\\n  id: Int!\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n  postsByAuthorId: [Post]\\r\\n}\\r\\n\\r\\ntype CreatePostPayload {\\r\\n  clientMutationId: String\\r\\n  post: Post\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ninput CreatePostInput {\\r\\n  clientMutationId: String\\r\\n  post: PostInput!\\r\\n}\\r\\n\\r\\ninput PostInput {\\r\\n  id: Int\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n}\\r\\n\\r\\ntype CreateUserPayload {\\r\\n  clientMutationId: String\\r\\n  user: User\\r\\n}\\r\\n\\r\\ninput CreateUserInput {\\r\\n  clientMutationId: String\\r\\n  user: UserInput!\\r\\n}\\r\\n\\r\\ninput UserInput {\\r\\n  id: Int\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n}\\r\\n\\r\\nscalar Datetime\\r\\n\"\n}")

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

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	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 GraphQL Schema
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"type Query {\\r\\n  allPosts: [Post]\\r\\n  allUsers: [User]\\r\\n  postById(id: Int!): Post\\r\\n  userById(id: Int!): User\\r\\n}\\r\\n\\r\\ntype Mutation {\\r\\n  createPost(input: CreatePostInput!): CreatePostPayload\\r\\n  createUser(input: CreateUserInput!): CreateUserPayload\\r\\n}\\r\\n\\r\\ntype Post {\\r\\n  id: Int!\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ntype User {\\r\\n  id: Int!\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n  postsByAuthorId: [Post]\\r\\n}\\r\\n\\r\\ntype CreatePostPayload {\\r\\n  clientMutationId: String\\r\\n  post: Post\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ninput CreatePostInput {\\r\\n  clientMutationId: String\\r\\n  post: PostInput!\\r\\n}\\r\\n\\r\\ninput PostInput {\\r\\n  id: Int\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n}\\r\\n\\r\\ntype CreateUserPayload {\\r\\n  clientMutationId: String\\r\\n  user: User\\r\\n}\\r\\n\\r\\ninput CreateUserInput {\\r\\n  clientMutationId: String\\r\\n  user: UserInput!\\r\\n}\\r\\n\\r\\ninput UserInput {\\r\\n  id: Int\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n}\\r\\n\\r\\nscalar Datetime\\r\\n\"\n}"

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

```java GraphQL Schema
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"type Query {\\r\\n  allPosts: [Post]\\r\\n  allUsers: [User]\\r\\n  postById(id: Int!): Post\\r\\n  userById(id: Int!): User\\r\\n}\\r\\n\\r\\ntype Mutation {\\r\\n  createPost(input: CreatePostInput!): CreatePostPayload\\r\\n  createUser(input: CreateUserInput!): CreateUserPayload\\r\\n}\\r\\n\\r\\ntype Post {\\r\\n  id: Int!\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ntype User {\\r\\n  id: Int!\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n  postsByAuthorId: [Post]\\r\\n}\\r\\n\\r\\ntype CreatePostPayload {\\r\\n  clientMutationId: String\\r\\n  post: Post\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ninput CreatePostInput {\\r\\n  clientMutationId: String\\r\\n  post: PostInput!\\r\\n}\\r\\n\\r\\ninput PostInput {\\r\\n  id: Int\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n}\\r\\n\\r\\ntype CreateUserPayload {\\r\\n  clientMutationId: String\\r\\n  user: User\\r\\n}\\r\\n\\r\\ninput CreateUserInput {\\r\\n  clientMutationId: String\\r\\n  user: UserInput!\\r\\n}\\r\\n\\r\\ninput UserInput {\\r\\n  id: Int\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n}\\r\\n\\r\\nscalar Datetime\\r\\n\"\n}")
  .asString();
```

```php GraphQL Schema
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json', [
  'body' => '{
  "content": "type Query {\\r\\n  allPosts: [Post]\\r\\n  allUsers: [User]\\r\\n  postById(id: Int!): Post\\r\\n  userById(id: Int!): User\\r\\n}\\r\\n\\r\\ntype Mutation {\\r\\n  createPost(input: CreatePostInput!): CreatePostPayload\\r\\n  createUser(input: CreateUserInput!): CreateUserPayload\\r\\n}\\r\\n\\r\\ntype Post {\\r\\n  id: Int!\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ntype User {\\r\\n  id: Int!\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n  postsByAuthorId: [Post]\\r\\n}\\r\\n\\r\\ntype CreatePostPayload {\\r\\n  clientMutationId: String\\r\\n  post: Post\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ninput CreatePostInput {\\r\\n  clientMutationId: String\\r\\n  post: PostInput!\\r\\n}\\r\\n\\r\\ninput PostInput {\\r\\n  id: Int\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n}\\r\\n\\r\\ntype CreateUserPayload {\\r\\n  clientMutationId: String\\r\\n  user: User\\r\\n}\\r\\n\\r\\ninput CreateUserInput {\\r\\n  clientMutationId: String\\r\\n  user: UserInput!\\r\\n}\\r\\n\\r\\ninput UserInput {\\r\\n  id: Int\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n}\\r\\n\\r\\nscalar Datetime\\r\\n"
}',
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp GraphQL Schema
using RestSharp;

var client = new RestClient("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"content\": \"type Query {\\r\\n  allPosts: [Post]\\r\\n  allUsers: [User]\\r\\n  postById(id: Int!): Post\\r\\n  userById(id: Int!): User\\r\\n}\\r\\n\\r\\ntype Mutation {\\r\\n  createPost(input: CreatePostInput!): CreatePostPayload\\r\\n  createUser(input: CreateUserInput!): CreateUserPayload\\r\\n}\\r\\n\\r\\ntype Post {\\r\\n  id: Int!\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ntype User {\\r\\n  id: Int!\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n  postsByAuthorId: [Post]\\r\\n}\\r\\n\\r\\ntype CreatePostPayload {\\r\\n  clientMutationId: String\\r\\n  post: Post\\r\\n  userByAuthorId: User\\r\\n}\\r\\n\\r\\ninput CreatePostInput {\\r\\n  clientMutationId: String\\r\\n  post: PostInput!\\r\\n}\\r\\n\\r\\ninput PostInput {\\r\\n  id: Int\\r\\n  title: String\\r\\n  body: String\\r\\n  createdDate: Datetime\\r\\n  authorId: Int!\\r\\n}\\r\\n\\r\\ntype CreateUserPayload {\\r\\n  clientMutationId: String\\r\\n  user: User\\r\\n}\\r\\n\\r\\ninput CreateUserInput {\\r\\n  clientMutationId: String\\r\\n  user: UserInput!\\r\\n}\\r\\n\\r\\ninput UserInput {\\r\\n  id: Int\\r\\n  username: String\\r\\n  createdDate: Datetime\\r\\n}\\r\\n\\r\\nscalar Datetime\\r\\n\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift GraphQL Schema
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["content": "type Query {
  allPosts: [Post]
  allUsers: [User]
  postById(id: Int!): Post
  userById(id: Int!): User
}

type Mutation {
  createPost(input: CreatePostInput!): CreatePostPayload
  createUser(input: CreateUserInput!): CreateUserPayload
}

type Post {
  id: Int!
  title: String
  body: String
  createdDate: Datetime
  authorId: Int!
  userByAuthorId: User
}

type User {
  id: Int!
  username: String
  createdDate: Datetime
  postsByAuthorId: [Post]
}

type CreatePostPayload {
  clientMutationId: String
  post: Post
  userByAuthorId: User
}

input CreatePostInput {
  clientMutationId: String
  post: PostInput!
}

input PostInput {
  id: Int
  title: String
  body: String
  createdDate: Datetime
  authorId: Int!
}

type CreateUserPayload {
  clientMutationId: String
  user: User
}

input CreateUserInput {
  clientMutationId: String
  user: UserInput!
}

input UserInput {
  id: Int
  username: String
  createdDate: Datetime
}

scalar Datetime
"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Update root Tag



**Request**

```json
{
  "root": {
    "enabled": true
  }
}
```

**Response**

```json
{
  "createdBy": "12345678",
  "createdAt": "2024-07-18T13:47:39.000Z",
  "root": {
    "enabled": true
  },
  "name": "index.json",
  "path": "index.json",
  "updatedBy": "12345678",
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "updatedAt": "2024-07-18T13:48:28.000Z"
}
```

**SDK Code**

```python Update root Tag
import requests

url = "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

payload = { "root": { "enabled": True } }
headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update root Tag
const url = 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json';
const options = {
  method: 'PUT',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"root":{"enabled":true}}'
};

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

```go Update root Tag
package main

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

func main() {

	url := "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json"

	payload := strings.NewReader("{\n  \"root\": {\n    \"enabled\": true\n  }\n}")

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

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	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 Update root Tag
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")

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

request = Net::HTTP::Put.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"root\": {\n    \"enabled\": true\n  }\n}"

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

```java Update root Tag
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"root\": {\n    \"enabled\": true\n  }\n}")
  .asString();
```

```php Update root Tag
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json', [
  'body' => '{
  "root": {
    "enabled": true
  }
}',
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update root Tag
using RestSharp;

var client = new RestClient("https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"root\": {\n    \"enabled\": true\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update root Tag
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["root": ["enabled": true]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files/postman%2Fcollection%2Fc1.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```