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

PUT https://api.getpostman.com/collections/{collectionId}/folders/{folderId}
Content-Type: application/json

Updates a folder in a collection. For a complete list of properties, refer to the **Folder** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).

**Note:**

This endpoint acts like a PATCH method. It only updates the values that you pass in the request body (for example, the `name` property). The endpoint does not update the entire resource.


Reference: https://learning.postman.com/api-docs/api-reference/collection-items/update-collection-folder

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /collections/{collectionId}/folders/{folderId}:
    put:
      operationId: updateCollectionFolder
      summary: Update a folder
      description: >
        Updates a folder in a collection. For a complete list of properties,
        refer to the **Folder** entry in the [Postman Collection Format
        documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).


        **Note:**


        This endpoint acts like a PATCH method. It only updates the values that
        you pass in the request body (for example, the `name` property). The
        endpoint does not update the entire resource.
      tags:
        - collectionItems
      parameters:
        - name: folderId
          in: path
          description: The folder's ID.
          required: true
          schema:
            $ref: '#/components/schemas/collectionFolderId'
        - name: collectionId
          in: path
          description: The collection's ID.
          required: true
          schema:
            $ref: '#/components/schemas/collectionId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updateCollectionFolderResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorNameMessageDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorNameMessageDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorNameMessageDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UpdateCollectionFolderRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateCollectionFolder'
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:
    collectionFolderId:
      type: string
      title: collectionFolderId
    collectionId:
      type: string
      title: collectionId
    updateCollectionFolder:
      type: object
      properties:
        name:
          type: string
          description: The folder's name.
        description:
          type: string
          description: The folder's description.
      description: >-
        The folder properties to update. For a complete list of properties,
        refer to the [Postman Collection Format
        documentation](https://schema.postman.com/collection/json/v1.0.0/draft-07/collection.json).
      title: updateCollectionFolder
    UpdateCollectionFolderResponseData:
      type: object
      properties:
        id:
          type: string
          description: The folder's ID.
        name:
          type: string
          description: The folder's name.
        description:
          type: string
          description: The folder's description.
        createdAt:
          type: string
          format: date-time
          description: The folder's creation date and time.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the folder was last updated.
        owner:
          type: string
          description: The user ID of the folder's owner.
        lastUpdatedBy:
          type: string
          description: The user ID of the user that last updated the folder.
        lastRevision:
          type: integer
          format: int64
          description: >-
            An internal revision ID. Its value increments each time the resource
            changes. You can use this ID to track whether there were changes
            since the last time you fetched the resource.
        collection:
          type: string
          description: The collection ID that the folder belongs to.
        folder:
          type:
            - string
            - 'null'
          description: Information about the folder.
      description: >-
        The folder's updated information, including the updated properties. For
        a complete list of properties, refer to the [Postman Collection Format
        documentation](https://schema.postman.com/collection/json/v1.0.0/draft-07/collection.json).
      title: UpdateCollectionFolderResponseData
    updateCollectionFolderResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/UpdateCollectionFolderResponseData'
          description: >-
            The folder's updated information, including the updated properties.
            For a complete list of properties, refer to the [Postman Collection
            Format
            documentation](https://schema.postman.com/collection/json/v1.0.0/draft-07/collection.json).
        meta:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            A Postman-specific response that contains information about the
            internal performed operation.
        model_id:
          type: string
          description: The folder's ID.
        revision:
          type: number
          format: double
          description: >-
            An internal revision ID. Its value increments each time the resource
            changes. You can use this ID to track whether there were changes
            since the last time you fetched the resource.
      title: updateCollectionFolderResponse
    CommonErrorNameMessageDetailsErrorDetails:
      oneOf:
        - type: object
          additionalProperties:
            description: Any type
        - type: array
          items:
            type: string
      description: Information about the error.
      title: CommonErrorNameMessageDetailsErrorDetails
    CommonErrorNameMessageDetailsError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
        details:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsErrorDetails'
          description: Information about the error.
      title: CommonErrorNameMessageDetailsError
    commonErrorNameMessageDetails:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsError'
      title: commonErrorNameMessageDetails
    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
    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
    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
    UpdateCollectionFolderRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: UpdateCollectionFolderRequestInternalServerError
  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

### Folder Updated



**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "65a99e60-8e0a-4b6e-b79c-7d8264cc5caa",
    "name": "Test Folder",
    "description": "This is a test folder.",
    "createdAt": "2022-08-29T16:49:19.964Z",
    "updatedAt": "2022-08-29T16:49:19.964Z",
    "owner": "12345678",
    "lastUpdatedBy": "12345678",
    "lastRevision": 24977100955,
    "collection": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
    "folder": null,
    "auth": null,
    "events": null,
    "folders_order": [],
    "order": [],
    "variables": null
  },
  "meta": {
    "action": "update",
    "model": "folder"
  },
  "model_id": "65a99e60-8e0a-4b6e-b79c-7d8264cc5caa",
  "revision": 24977103385
}
```

**SDK Code**

```python Folder Updated
import requests

url = "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa"

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

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

print(response.json())
```

```javascript Folder Updated
const url = 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa';
const options = {
  method: 'PUT',
  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 Folder Updated
package main

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

func main() {

	url := "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa"

	req, _ := http.NewRequest("PUT", 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 Folder Updated
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa")

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

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

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

```java Folder Updated
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Folder Updated
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Folder Updated
using RestSharp;

var client = new RestClient("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Folder Updated
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa")! 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()
```

### Update Folder



**Request**

```json
{
  "name": "Test Folder",
  "description": "This is a test collection folder."
}
```

**Response**

```json
{
  "data": {
    "id": "65a99e60-8e0a-4b6e-b79c-7d8264cc5caa",
    "name": "Test Folder",
    "description": "This is a test folder.",
    "createdAt": "2022-08-29T16:49:19.964Z",
    "updatedAt": "2022-08-29T16:49:19.964Z",
    "owner": "12345678",
    "lastUpdatedBy": "12345678",
    "lastRevision": 24977100955,
    "collection": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
    "folder": null,
    "auth": null,
    "events": null,
    "folders_order": [],
    "order": [],
    "variables": null
  },
  "meta": {
    "action": "update",
    "model": "folder"
  },
  "model_id": "65a99e60-8e0a-4b6e-b79c-7d8264cc5caa",
  "revision": 24977103385
}
```

**SDK Code**

```python Update Folder
import requests

url = "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa"

payload = {
    "name": "Test Folder",
    "description": "This is a test collection folder."
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Folder
const url = 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Test Folder","description":"This is a test collection folder."}'
};

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

```go Update Folder
package main

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

func main() {

	url := "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa"

	payload := strings.NewReader("{\n  \"name\": \"Test Folder\",\n  \"description\": \"This is a test collection folder.\"\n}")

	req, _ := http.NewRequest("PUT", 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 Folder
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa")

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

request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Test Folder\",\n  \"description\": \"This is a test collection folder.\"\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Test Folder\",\n  \"description\": \"This is a test collection folder.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa', [
  'body' => '{
  "name": "Test Folder",
  "description": "This is a test collection folder."
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Update Folder
using RestSharp;

var client = new RestClient("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Test Folder\",\n  \"description\": \"This is a test collection folder.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Folder
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Test Folder",
  "description": "This is a test collection folder."
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/folders/65a99e60-8e0a-4b6e-b79c-7d8264cc5caa")! 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()
```