> 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.

# Update a spec file

PATCH https://api.getpostman.com/specs/{specId}/files/{filePath}
Content-Type: application/json

Updates a file for an OpenAPI or protobuf 2 or 3 specification.

**Note:**

- This endpoint does not accept an empty request body. You must pass one of the accepted values.
- This endpoint does not accept multiple request body properties in a single call. For example, you cannot pass both the `content` and `type` property at the same time.
- Multi-file specifications can only have one root file.
- When updating a file type to `ROOT`, the previous root file is updated to the `DEFAULT` file type.
- Files cannot exceed a maximum of 10 MB in size.


Reference: https://learning.postman.com/api-docs/api-reference/specs/update-spec-file

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /specs/{specId}/files/{filePath}:
    patch:
      operationId: updateSpecFile
      summary: Update a spec file
      description: >
        Updates a file for an OpenAPI or protobuf 2 or 3 specification.


        **Note:**


        - This endpoint does not accept an empty request body. You must pass one
        of the accepted values.

        - This endpoint does not accept multiple request body properties in a
        single call. For example, you cannot pass both the `content` and `type`
        property at the same time.

        - Multi-file specifications can only have one root file.

        - When updating a file type to `ROOT`, the previous root file is updated
        to the `DEFAULT` file type.

        - Files cannot exceed a maximum of 10 MB in size.
      tags:
        - specs
      parameters:
        - name: specId
          in: path
          description: The spec's ID.
          required: true
          schema:
            $ref: '#/components/schemas/specId'
        - name: filePath
          in: path
          description: The path to the file.
          required: true
          schema:
            $ref: '#/components/schemas/filePath'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createUpdateSpecFileResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSpecFileRequestForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSpecFileRequestInternalServerError'
      requestBody:
        description: Update Spec File
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateSpecFile'
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:
    specId:
      type: string
      title: specId
    filePath:
      type: string
      title: filePath
    UpdateSpecFileType:
      type: string
      enum:
        - DEFAULT
        - ROOT
      description: >
        The type of file:

        - `ROOT` — The file containing the full OpenAPI structure. This serves
        as the entry point for the API spec and references other (`DEFAULT`)
        spec files. Multi-file specs can only have one root file.

        - `DEFAULT` — A file referenced by the `ROOT` file.
      title: UpdateSpecFileType
    updateSpecFile:
      type: object
      properties:
        name:
          type: string
          description: The file's name.
        type:
          $ref: '#/components/schemas/UpdateSpecFileType'
          description: >
            The type of file:

            - `ROOT` — The file containing the full OpenAPI structure. This
            serves as the entry point for the API spec and references other
            (`DEFAULT`) spec files. Multi-file specs can only have one root
            file.

            - `DEFAULT` — A file referenced by the `ROOT` file.
        content:
          type: string
          description: The specification's stringified contents.
      description: >-
        You must pass one of the accepted values in this request body. Also,
        this request body does not accept multiple properties in a single call.
        For example, you cannot pass both the `content` and `type` property at
        the same time.
      title: updateSpecFile
    CreateUpdateSpecFileResponseType:
      type: string
      enum:
        - DEFAULT
        - ROOT
      default: DEFAULT
      description: >
        The type of file:

        - `ROOT` — The file containing the full OpenAPI structure. This serves
        as the entry point for the API spec and references other (`DEFAULT`)
        spec files. Multi-file specs can only have one root file.

        - `DEFAULT` — A file referenced by the `ROOT` file.
      title: CreateUpdateSpecFileResponseType
    createUpdateSpecFileResponse:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the file was created.
        createdBy:
          type: integer
          description: The user ID of the user that created the file.
        id:
          type: string
          description: The file's ID.
        path:
          type: string
          description: The file's path.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the file was updated.
        updatedBy:
          type: integer
          description: The ID of the user who updated the file.
        type:
          $ref: '#/components/schemas/CreateUpdateSpecFileResponseType'
          default: DEFAULT
          description: >
            The type of file:

            - `ROOT` — The file containing the full OpenAPI structure. This
            serves as the entry point for the API spec and references other
            (`DEFAULT`) spec files. Multi-file specs can only have one root
            file.

            - `DEFAULT` — A file referenced by the `ROOT` file.
      description: Information about the API specification file.
      title: createUpdateSpecFileResponse
    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
    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
    UpdateSpecFileRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatusInstance'
      title: UpdateSpecFileRequestForbiddenError
    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
    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
    UpdateSpecFileRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: UpdateSpecFileRequestInternalServerError
  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

### JSON Spec File



**Request**

```json
undefined
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python JSON Spec File
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript JSON Spec File
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'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 JSON Spec File
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

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

	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 Spec File
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

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

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

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

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp JSON Spec File
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift JSON Spec File
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### YAML Spec File



**Request**

```json
undefined
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.yaml",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python YAML Spec File
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript YAML Spec File
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'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 YAML Spec File
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

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

	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 Spec File
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

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

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

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

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp YAML Spec File
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift YAML Spec File
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Protobuf Spec File



**Request**

```json
undefined
```

**Response**

```json
{
  "createdAt": "2026-04-14T17:44:29.389Z",
  "createdBy": 12345678,
  "id": "799c482f-ffe6-4399-a919-b3cf6a3da888",
  "path": "file.proto",
  "updatedAt": "2026-04-14T17:44:29.389Z",
  "updatedBy": 12345678,
  "type": "DEFAULT"
}
```

**SDK Code**

```python Protobuf Spec File
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Protobuf Spec File
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'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 Protobuf Spec File
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

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

	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 Protobuf Spec File
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

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

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

```java Protobuf Spec File
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Protobuf Spec File
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Protobuf Spec File
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Protobuf Spec File
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Nested Spec File



**Request**

```json
undefined
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "e8a015e0-f472-4bb3-a523-57ce7c4583ed",
  "path": "components/schemas/spacecrafts.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "DEFAULT"
}
```

**SDK Code**

```python Nested Spec File
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Nested Spec File
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'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 Nested Spec File
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

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

	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 Nested Spec File
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

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

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

```java Nested Spec File
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Nested Spec File
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Nested Spec File
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Nested Spec File
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Update JSON Spec File



**Request**

```json
{
  "content": "{\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\": \"../schemas/spacecrafts.json#/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}"
}
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python Update JSON Spec File
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

payload = { "content": "{
  \"SpacecraftId\": {
    \"description\": \"The unique identifier of a spacecraft\",
    \"type\": \"string\"
  },
  \"Spacecraft\": {
    \"type\": \"object\",
    \"required\": [
      \"id\",
      \"name\",
      \"type\"
    ],
    \"properties\": {
      \"id\": {
        \"$ref\": \"../schemas/spacecrafts.json#/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\"
      }
    }
  }
}" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update JSON Spec File
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"content":"{\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\": \"../schemas/spacecrafts.json#/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}"}'
};

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

```go Update JSON Spec File
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

	payload := strings.NewReader("{\n  \"content\": \"{\\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\\\": \\\"../schemas/spacecrafts.json#/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}")

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

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

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

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

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

}
```

```ruby Update JSON Spec File
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"{\\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\\\": \\\"../schemas/spacecrafts.json#/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}"

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

```java Update JSON Spec File
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"{\\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\\\": \\\"../schemas/spacecrafts.json#/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}")
  .asString();
```

```php Update JSON Spec File
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'body' => '{
  "content": "{\\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\\": \\"../schemas/spacecrafts.json#/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}"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update JSON Spec File
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"content\": \"{\\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\\\": \\\"../schemas/spacecrafts.json#/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}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update JSON Spec File
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["content": "{
  \"SpacecraftId\": {
    \"description\": \"The unique identifier of a spacecraft\",
    \"type\": \"string\"
  },
  \"Spacecraft\": {
    \"type\": \"object\",
    \"required\": [
      \"id\",
      \"name\",
      \"type\"
    ],
    \"properties\": {
      \"id\": {
        \"$ref\": \"../schemas/spacecrafts.json#/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\"
      }
    }
  }
}"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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 YAML Spec File



**Request**

```json
{
  "content": "SpacecraftId:\n  description: The unique identifier of a spacecraft\n  type: string\nSpacecraft:\n  type: object\n  required:\n  - id\n  - name\n  - type\n  properties:\n    id:\n      \"$ref\": \"#/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\nError:\n  type: object\n  required:\n  - message\n  properties:\n    message:\n      description: A human readable error message\n      type: string\n"
}
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python Update YAML Spec File
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

payload = { "content": "SpacecraftId:
  description: The unique identifier of a spacecraft
  type: string
Spacecraft:
  type: object
  required:
  - id
  - name
  - type
  properties:
    id:
      \"$ref\": \"#/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
" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update YAML Spec File
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"content":"SpacecraftId:\n  description: The unique identifier of a spacecraft\n  type: string\nSpacecraft:\n  type: object\n  required:\n  - id\n  - name\n  - type\n  properties:\n    id:\n      \"$ref\": \"#/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\nError:\n  type: object\n  required:\n  - message\n  properties:\n    message:\n      description: A human readable error message\n      type: string\n"}'
};

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

```go Update YAML Spec File
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

	payload := strings.NewReader("{\n  \"content\": \"SpacecraftId:\\n  description: The unique identifier of a spacecraft\\n  type: string\\nSpacecraft:\\n  type: object\\n  required:\\n  - id\\n  - name\\n  - type\\n  properties:\\n    id:\\n      \\\"$ref\\\": \\\"#/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\\nError:\\n  type: object\\n  required:\\n  - message\\n  properties:\\n    message:\\n      description: A human readable error message\\n      type: string\\n\"\n}")

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

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

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

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

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

}
```

```ruby Update YAML Spec File
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"SpacecraftId:\\n  description: The unique identifier of a spacecraft\\n  type: string\\nSpacecraft:\\n  type: object\\n  required:\\n  - id\\n  - name\\n  - type\\n  properties:\\n    id:\\n      \\\"$ref\\\": \\\"#/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\\nError:\\n  type: object\\n  required:\\n  - message\\n  properties:\\n    message:\\n      description: A human readable error message\\n      type: string\\n\"\n}"

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

```java Update YAML Spec File
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"SpacecraftId:\\n  description: The unique identifier of a spacecraft\\n  type: string\\nSpacecraft:\\n  type: object\\n  required:\\n  - id\\n  - name\\n  - type\\n  properties:\\n    id:\\n      \\\"$ref\\\": \\\"#/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\\nError:\\n  type: object\\n  required:\\n  - message\\n  properties:\\n    message:\\n      description: A human readable error message\\n      type: string\\n\"\n}")
  .asString();
```

```php Update YAML Spec File
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'body' => '{
  "content": "SpacecraftId:\\n  description: The unique identifier of a spacecraft\\n  type: string\\nSpacecraft:\\n  type: object\\n  required:\\n  - id\\n  - name\\n  - type\\n  properties:\\n    id:\\n      \\"$ref\\": \\"#/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\\nError:\\n  type: object\\n  required:\\n  - message\\n  properties:\\n    message:\\n      description: A human readable error message\\n      type: string\\n"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update YAML Spec File
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"content\": \"SpacecraftId:\\n  description: The unique identifier of a spacecraft\\n  type: string\\nSpacecraft:\\n  type: object\\n  required:\\n  - id\\n  - name\\n  - type\\n  properties:\\n    id:\\n      \\\"$ref\\\": \\\"#/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\\nError:\\n  type: object\\n  required:\\n  - message\\n  properties:\\n    message:\\n      description: A human readable error message\\n      type: string\\n\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update YAML Spec File
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["content": "SpacecraftId:
  description: The unique identifier of a spacecraft
  type: string
Spacecraft:
  type: object
  required:
  - id
  - name
  - type
  properties:
    id:
      \"$ref\": \"#/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
"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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 Protobuf Spec File



**Request**

```json
{
  "content": "syntax = \"proto3\";\n\npackage com.book;\n\nmessage Book {\n  int64 isbn = 1;\n  string title = 2;\n  string author = 3;\n}\n\nmessage GetBookRequest {\n  int64 isbn = 1;\n}\n\nmessage GetBookViaAuthor {\n  string author = 1;\n}\n\nservice BookService {\n  rpc GetBook (GetBookRequest) returns (Book) {}\n  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}\n  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}\n  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}\n}\n"
}
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python Update Protobuf Spec File
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

payload = { "content": "syntax = \"proto3\";

package com.book;

message Book {
  int64 isbn = 1;
  string title = 2;
  string author = 3;
}

message GetBookRequest {
  int64 isbn = 1;
}

message GetBookViaAuthor {
  string author = 1;
}

service BookService {
  rpc GetBook (GetBookRequest) returns (Book) {}
  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}
  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}
  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}
}
" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Protobuf Spec File
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"content":"syntax = \"proto3\";\n\npackage com.book;\n\nmessage Book {\n  int64 isbn = 1;\n  string title = 2;\n  string author = 3;\n}\n\nmessage GetBookRequest {\n  int64 isbn = 1;\n}\n\nmessage GetBookViaAuthor {\n  string author = 1;\n}\n\nservice BookService {\n  rpc GetBook (GetBookRequest) returns (Book) {}\n  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}\n  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}\n  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}\n}\n"}'
};

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

```go Update Protobuf Spec File
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

	payload := strings.NewReader("{\n  \"content\": \"syntax = \\\"proto3\\\";\\n\\npackage com.book;\\n\\nmessage Book {\\n  int64 isbn = 1;\\n  string title = 2;\\n  string author = 3;\\n}\\n\\nmessage GetBookRequest {\\n  int64 isbn = 1;\\n}\\n\\nmessage GetBookViaAuthor {\\n  string author = 1;\\n}\\n\\nservice BookService {\\n  rpc GetBook (GetBookRequest) returns (Book) {}\\n  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}\\n  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}\\n  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}\\n}\\n\"\n}")

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

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

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

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

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

}
```

```ruby Update Protobuf Spec File
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"syntax = \\\"proto3\\\";\\n\\npackage com.book;\\n\\nmessage Book {\\n  int64 isbn = 1;\\n  string title = 2;\\n  string author = 3;\\n}\\n\\nmessage GetBookRequest {\\n  int64 isbn = 1;\\n}\\n\\nmessage GetBookViaAuthor {\\n  string author = 1;\\n}\\n\\nservice BookService {\\n  rpc GetBook (GetBookRequest) returns (Book) {}\\n  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}\\n  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}\\n  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}\\n}\\n\"\n}"

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

```java Update Protobuf Spec File
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"syntax = \\\"proto3\\\";\\n\\npackage com.book;\\n\\nmessage Book {\\n  int64 isbn = 1;\\n  string title = 2;\\n  string author = 3;\\n}\\n\\nmessage GetBookRequest {\\n  int64 isbn = 1;\\n}\\n\\nmessage GetBookViaAuthor {\\n  string author = 1;\\n}\\n\\nservice BookService {\\n  rpc GetBook (GetBookRequest) returns (Book) {}\\n  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}\\n  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}\\n  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}\\n}\\n\"\n}")
  .asString();
```

```php Update Protobuf Spec File
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'body' => '{
  "content": "syntax = \\"proto3\\";\\n\\npackage com.book;\\n\\nmessage Book {\\n  int64 isbn = 1;\\n  string title = 2;\\n  string author = 3;\\n}\\n\\nmessage GetBookRequest {\\n  int64 isbn = 1;\\n}\\n\\nmessage GetBookViaAuthor {\\n  string author = 1;\\n}\\n\\nservice BookService {\\n  rpc GetBook (GetBookRequest) returns (Book) {}\\n  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}\\n  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}\\n  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}\\n}\\n"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update Protobuf Spec File
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"content\": \"syntax = \\\"proto3\\\";\\n\\npackage com.book;\\n\\nmessage Book {\\n  int64 isbn = 1;\\n  string title = 2;\\n  string author = 3;\\n}\\n\\nmessage GetBookRequest {\\n  int64 isbn = 1;\\n}\\n\\nmessage GetBookViaAuthor {\\n  string author = 1;\\n}\\n\\nservice BookService {\\n  rpc GetBook (GetBookRequest) returns (Book) {}\\n  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}\\n  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}\\n  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}\\n}\\n\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Protobuf Spec File
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["content": "syntax = \"proto3\";

package com.book;

message Book {
  int64 isbn = 1;
  string title = 2;
  string author = 3;
}

message GetBookRequest {
  int64 isbn = 1;
}

message GetBookViaAuthor {
  string author = 1;
}

service BookService {
  rpc GetBook (GetBookRequest) returns (Book) {}
  rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}
  rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}
  rpc GetBooks (stream GetBookRequest) returns (stream Book) {}
}
"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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 File Type



**Request**

```json
{
  "type": "ROOT"
}
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python Update File Type
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

payload = { "type": "ROOT" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update File Type
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"type":"ROOT"}'
};

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

```go Update File Type
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

	payload := strings.NewReader("{\n  \"type\": \"ROOT\"\n}")

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

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

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

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

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

}
```

```ruby Update File Type
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"ROOT\"\n}"

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

```java Update File Type
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"ROOT\"\n}")
  .asString();
```

```php Update File Type
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'body' => '{
  "type": "ROOT"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update File Type
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"ROOT\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update File Type
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["type": "ROOT"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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 File Name



**Request**

```json
{
  "name": "index.json"
}
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python Update File Name
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

payload = { "name": "index.json" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update File Name
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"index.json"}'
};

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

```go Update File Name
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

	payload := strings.NewReader("{\n  \"name\": \"index.json\"\n}")

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

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

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

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

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

}
```

```ruby Update File Name
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"index.json\"\n}"

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

```java Update File Name
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"index.json\"\n}")
  .asString();
```

```php Update File Name
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'body' => '{
  "name": "index.json"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update File Name
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"index.json\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update File Name
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["name": "index.json"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Invalid Request Body



**Request**

```json
{
  "name": "index.json",
  "type": "ROOT"
}
```

**Response**

```json
{
  "createdAt": "2025-07-22T19:29:08.000Z",
  "createdBy": 12345678,
  "id": "2fdc8ea1-d02e-4e50-989e-6fa28f42b995",
  "path": "schemas.json",
  "updatedAt": "2025-07-22T19:29:57.000Z",
  "updatedBy": 12345678,
  "type": "ROOT"
}
```

**SDK Code**

```python Invalid Request Body
import requests

url = "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

payload = {
    "name": "index.json",
    "type": "ROOT"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Invalid Request Body
const url = 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"index.json","type":"ROOT"}'
};

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

```go Invalid Request Body
package main

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

func main() {

	url := "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json"

	payload := strings.NewReader("{\n  \"name\": \"index.json\",\n  \"type\": \"ROOT\"\n}")

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

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

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

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

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

}
```

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

url = URI("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"index.json\",\n  \"type\": \"ROOT\"\n}"

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

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

HttpResponse<String> response = Unirest.patch("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"index.json\",\n  \"type\": \"ROOT\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json', [
  'body' => '{
  "name": "index.json",
  "type": "ROOT"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Invalid Request Body
using RestSharp;

var client = new RestClient("https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"index.json\",\n  \"type\": \"ROOT\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Invalid Request Body
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "index.json",
  "type": "ROOT"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/specs/73e15000-bc7a-4802-b80e-05fff18fd7f8/files/index.json")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```