Skip to main content
Glama

Replace a collection's data

putCollection
Idempotent

Replace a Postman collection's contents with a new collection body. Provide the collection ID and updated data, or omit item IDs to recreate them.

Instructions

Replaces the contents of a collection using the Postman Collection v2.1.0 schema format. Include the collection's ID values in the request body. If you do not, the endpoint removes the existing items and creates new items.

Note:

  • The maximum collection size this endpoint accepts cannot exceed 100 MB.

  • Use the GET `/collection-updates-tasks/{taskId}` endpoint to get the collection's update status when performing an asynchronous update.

  • If you don't include the collection items' ID values from the request body, the endpoint removes the existing items and recreates the items with new ID values.

  • To copy another collection's contents to the given collection, remove all ID values before you pass it in this endpoint. If you do not, this endpoint returns an error. These values include the `id`, `uid`, and `postman_id` values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
PreferNoThe `respond-async` header to perform the update asynchronously.
collectionNoThe new collection contents that replace the existing collection.
collectionIdYesThe collection ID must be in the form <OWNER_ID>-<UUID> (e.g. 12345-33823532ab9e41c9b6fd12d0fd459b8b).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.12.3
    • addedInput schema / properties / collection / description
      Added value: +"The new collection contents that replace the existing collection."
    • addedInput schema / properties / collection / properties / info / properties / createdAt
      Added value: +{
      +  "description": "The date and time when the collection was created.",
      +  "format": "date-time",
      +  "type": "string"
      +}
    • removedInput schema / properties / collection / properties / info / properties / createdat
      Removed value: -{
      -  "description": "The date and time when the collection was created.",
      -  "format": "date-time",
      -  "type": "string"
      -}
  2. Changed13 schema fields changedv2.12.0
    • removedInput schema / properties / collection / properties / info / properties / schema / const
      Removed value: -"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    • changedInput schema / properties / collection / properties / info / properties / schema / description
      Previous value: -"The \"https://schema.getpostman.com/json/collection/v2.1.0/collection.json\" Postman Collection Format v2.1.0 schema."New value: +"The \"https://schema.postman.com/json/collection/v2.1.0/collection.json\" Postman Collection Format v2.1.0 schema."
    • addedInput schema / properties / collection / properties / info / properties / schema / enum
      Added value: +[
      +  "https://schema.postman.com/json/collection/v2.1.0/collection.json",
      +  "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
      +]
    • removedInput schema / properties / collection / properties / item / items / properties / variable / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / collection / properties / item / items / properties / variable / items / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "description": "Information about the variable.",
      +    "properties": {
      +      "description": {
      +        "description": "The variable's description.",
      +        "maxLength": 512,
      +        "type": "string"
      +      },
      +      "disabled": {
      +        "default": false,
      +        "description": "If true, the variable is not enabled. Doesn't apply to path parameter variables.",
      +        "type": "boolean"
      +      },
      +      "enabled": {
      +        "default": true,
      +        "description": "If true, the variable is enabled.",
      +        "type": "boolean"
      +      },
      +      "id": {
      +        "description": "The variable's ID. Doesn't apply to collection-level variables.",
      +        "type": "string"
      +      },
      +      "key": {
      +        "description": "The variable's key (name).",
      +        "type": "string"
      +      },
      +      "value": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "integer"
      +          }
      +        ],
      +        "description": "The key's value."
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "Information about the secret variable.",
      +    "properties": {
      +      "description": {
      +        "description": "The variable's description.",
      +        "maxLength": 512,
      +        "type": "string"
      +      },
      +      "enabled": {
      +        "default": true,
      +        "description": "If true, the variable is enabled.",
      +        "type": "boolean"
      +      },
      +      "id": {
      +        "description": "The variable's ID. Doesn't apply to collection-level variables.",
      +        "type": "string"
      +      },
      +      "key": {
      +        "description": "The variable's key (name).",
      +        "type": "string"
      +      },
      +      "secret": {
      +        "description": "If true, the variable is marked as secret and its value is retrieved from the mentioned provider in the source field.",
      +        "type": "boolean"
      +      },
      +      "source": {
      +        "additionalProperties": false,
      +        "description": "Information about the source of the variable's value.",
      +        "properties": {
      +          "postman": {
      +            "additionalProperties": false,
      +            "description": "Information about the Postman-specific source of the variable's value.",
      +            "properties": {
      +              "secretId": {
      +                "description": "The variable's secret ID.",
      +                "type": "string"
      +              },
      +              "type": {
      +                "const": "cloud",
      +                "description": "The variable's type:\n- `cloud` — The variable value is synced and stored in the Postman Cloud.\n",
      +                "type": "string"
      +              },
      +              "vaultId": {
      +                "description": "The variable's ID in the Postman Vault.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "provider": {
      +            "const": "postman",
      +            "description": "The secret's provider.",
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      }
      +    },
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / collection / properties / item / items / properties / variable / items / description
      Removed value: -"Information about the variable."
    • removedInput schema / properties / collection / properties / item / items / properties / variable / items / properties
      Removed value: -{
      -  "description": {
      -    "description": "The variable's description.",
      -    "maxLength": 512,
      -    "type": "string"
      -  },
      -  "disabled": {
      -    "default": false,
      -    "description": "If true, the variable is not enabled. Doesn't apply to path parameter variables.",
      -    "type": "boolean"
      -  },
      -  "id": {
      -    "description": "The variable's ID. Doesn't apply to collection-level variables.",
      -    "type": "string"
      -  },
      -  "key": {
      -    "description": "The variable's key (name).",
      -    "type": "string"
      -  },
      -  "value": {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "boolean"
      -      },
      -      {
      -        "type": "integer"
      -      }
      -    ],
      -    "description": "The key's value."
      -  }
      -}
    • removedInput schema / properties / collection / properties / item / items / properties / variable / items / type
      Removed value: -"object"
    • removedInput schema / properties / collection / properties / variable / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / collection / properties / variable / items / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "description": "Information about a collection-level variable. Collection variables don't support `id`, `description`, or `enabled` fields. Use `disabled` to control whether a variable is active.",
      +    "properties": {
      +      "disabled": {
      +        "default": false,
      +        "description": "If true, the variable is not enabled.",
      +        "type": "boolean"
      +      },
      +      "key": {
      +        "description": "The variable's key (name).",
      +        "type": "string"
      +      },
      +      "value": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "type": "integer"
      +          }
      +        ],
      +        "description": "The key's value."
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "Information about a collection-level secret variable. Collection variables don't have an `id` field.",
      +    "properties": {
      +      "description": {
      +        "description": "The variable's description.",
      +        "maxLength": 512,
      +        "type": "string"
      +      },
      +      "enabled": {
      +        "default": true,
      +        "description": "If true, the variable is enabled.",
      +        "type": "boolean"
      +      },
      +      "key": {
      +        "description": "The variable's key (name).",
      +        "type": "string"
      +      },
      +      "secret": {
      +        "description": "If true, the variable is marked as secret and its value is retrieved from the mentioned provider in the source field.",
      +        "type": "boolean"
      +      },
      +      "source": {
      +        "additionalProperties": false,
      +        "description": "Information about the source of the variable's value.",
      +        "properties": {
      +          "postman": {
      +            "additionalProperties": false,
      +            "description": "Information about the Postman-specific source of the variable's value.",
      +            "properties": {
      +              "secretId": {
      +                "description": "The variable's secret ID.",
      +                "type": "string"
      +              },
      +              "type": {
      +                "const": "cloud",
      +                "description": "The variable's type:\n- `cloud` — The variable value is synced and stored in the Postman Cloud.\n",
      +                "type": "string"
      +              },
      +              "vaultId": {
      +                "description": "The variable's ID in the Postman Vault.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "provider": {
      +            "const": "postman",
      +            "description": "The secret's provider.",
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      }
      +    },
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / collection / properties / variable / items / description
      Removed value: -"Information about the variable."
    • removedInput schema / properties / collection / properties / variable / items / properties
      Removed value: -{
      -  "description": {
      -    "description": "The variable's description.",
      -    "maxLength": 512,
      -    "type": "string"
      -  },
      -  "disabled": {
      -    "default": false,
      -    "description": "If true, the variable is not enabled. Doesn't apply to path parameter variables.",
      -    "type": "boolean"
      -  },
      -  "id": {
      -    "description": "The variable's ID. Doesn't apply to collection-level variables.",
      -    "type": "string"
      -  },
      -  "key": {
      -    "description": "The variable's key (name).",
      -    "type": "string"
      -  },
      -  "value": {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "boolean"
      -      },
      -      {
      -        "type": "integer"
      -      }
      -    ],
      -    "description": "The key's value."
      -  }
      -}
    • removedInput schema / properties / collection / properties / variable / items / type
      Removed value: -"object"
  3. Changed1 schema field changedv2.9.0
    • changedInput schema / properties / collection / properties / auth / properties / type / enum
      Previous value: -[
      -  "basic",
      -  "bearer",
      -  "apikey",
      -  "digest",
      -  "oauth1",
      -  "oauth2",
      -  "hawk",
      -  "awsv4",
      -  "ntlm",
      -  "edgegrid",
      -  "jwt",
      -  "asap"
      -]New value: +[
      +  "basic",
      +  "bearer",
      +  "apikey",
      +  "digest",
      +  "oauth1",
      +  "oauth2",
      +  "hawk",
      +  "awsv4",
      +  "ntlm",
      +  "edgegrid",
      +  "jwt",
      +  "asap",
      +  "noauth"
      +]
  4. Changed2 schema fields changedv2.8.9
    • addedInput schema / properties / collection / properties / item / items / properties / item
      Added value: +{
      +  "description": "A list of items contained in this folder. Use this property to create folder structures within the collection. Each item can be a request (with a 'request' property) or a nested folder (with its own 'item' property). Omit the 'request' property for folder items.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "A nested collection item — either a request (has 'request') or a folder (has 'item').",
      +    "properties": {
      +      "description": {
      +        "description": "The item's description.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "id": {
      +        "description": "The collection item's ID.",
      +        "type": "string"
      +      },
      +      "item": {
      +        "description": "Nested folder items for deeper folder structures.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "description": {
      +              "description": "The item's description.",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "id": {
      +              "description": "The collection item's ID.",
      +              "type": "string"
      +            },
      +            "item": {
      +              "description": "Further nested folder items.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "id": {
      +                    "type": "string"
      +                  },
      +                  "name": {
      +                    "type": "string"
      +                  },
      +                  "request": {
      +                    "additionalProperties": false,
      +                    "properties": {
      +                      "method": {
      +                        "type": "string"
      +                      },
      +                      "url": {
      +                        "anyOf": [
      +                          {
      +                            "type": "string"
      +                          },
      +                          {
      +                            "additionalProperties": false,
      +                            "properties": {
      +                              "raw": {
      +                                "type": "string"
      +                              }
      +                            },
      +                            "type": "object"
      +                          }
      +                        ]
      +                      }
      +                    },
      +                    "type": "object"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "name": {
      +              "description": "The item's name.",
      +              "type": "string"
      +            },
      +            "request": {
      +              "additionalProperties": false,
      +              "description": "The request definition.",
      +              "properties": {
      +                "body": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "mode": {
      +                      "type": "string"
      +                    },
      +                    "raw": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "header": {
      +                  "items": {
      +                    "additionalProperties": false,
      +                    "properties": {
      +                      "key": {
      +                        "type": "string"
      +                      },
      +                      "value": {
      +                        "type": "string"
      +                      }
      +                    },
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                },
      +                "method": {
      +                  "enum": [
      +                    "GET",
      +                    "PUT",
      +                    "POST",
      +                    "PATCH",
      +                    "DELETE",
      +                    "COPY",
      +                    "HEAD",
      +                    "OPTIONS",
      +                    "LINK",
      +                    "UNLINK",
      +                    "PURGE",
      +                    "LOCK",
      +                    "UNLOCK",
      +                    "PROPFIND",
      +                    "VIEW"
      +                  ],
      +                  "type": "string"
      +                },
      +                "url": {
      +                  "anyOf": [
      +                    {
      +                      "type": "string"
      +                    },
      +                    {
      +                      "additionalProperties": false,
      +                      "properties": {
      +                        "raw": {
      +                          "type": "string"
      +                        }
      +                      },
      +                      "type": "object"
      +                    }
      +                  ]
      +                }
      +              },
      +              "type": "object"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "name": {
      +        "description": "The item's name.",
      +        "type": "string"
      +      },
      +      "request": {
      +        "additionalProperties": false,
      +        "description": "The request definition. Include for request items, omit for folder items.",
      +        "properties": {
      +          "auth": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "type": {
      +                "enum": [
      +                  "noauth",
      +                  "basic",
      +                  "bearer",
      +                  "apikey",
      +                  "digest",
      +                  "oauth1",
      +                  "oauth2",
      +                  "hawk",
      +                  "awsv4",
      +                  "ntlm",
      +                  "edgegrid"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "body": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "mode": {
      +                "enum": [
      +                  "raw",
      +                  "urlencoded",
      +                  "formdata",
      +                  "file",
      +                  "graphql"
      +                ],
      +                "type": "string"
      +              },
      +              "options": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "raw": {
      +                    "additionalProperties": false,
      +                    "properties": {
      +                      "language": {
      +                        "type": "string"
      +                      }
      +                    },
      +                    "type": "object"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "raw": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "header": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "description": {
      +                  "type": "string"
      +                },
      +                "key": {
      +                  "type": "string"
      +                },
      +                "value": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "method": {
      +            "description": "The HTTP method.",
      +            "enum": [
      +              "GET",
      +              "PUT",
      +              "POST",
      +              "PATCH",
      +              "DELETE",
      +              "COPY",
      +              "HEAD",
      +              "OPTIONS",
      +              "LINK",
      +              "UNLINK",
      +              "PURGE",
      +              "LOCK",
      +              "UNLOCK",
      +              "PROPFIND",
      +              "VIEW"
      +            ],
      +            "type": "string"
      +          },
      +          "url": {
      +            "anyOf": [
      +              {
      +                "description": "The request's URL string.",
      +                "type": "string"
      +              },
      +              {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "host": {
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "path": {
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "protocol": {
      +                    "type": "string"
      +                  },
      +                  "query": {
      +                    "items": {
      +                      "additionalProperties": false,
      +                      "properties": {
      +                        "key": {
      +                          "type": "string"
      +                        },
      +                        "value": {
      +                          "type": "string"
      +                        }
      +                      },
      +                      "type": "object"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "raw": {
      +                    "description": "The request's raw URL.",
      +                    "type": "string"
      +                  }
      +                },
      +                "type": "object"
      +              }
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / collection / properties / item / items / properties / request / properties / auth / properties / type / enum
      Previous value: -[
      -  "basic",
      -  "bearer",
      -  "apikey",
      -  "digest",
      -  "oauth1",
      -  "oauth2",
      -  "hawk",
      -  "awsv4",
      -  "ntlm",
      -  "edgegrid",
      -  "jwt",
      -  "asap"
      -]New value: +[
      +  "basic",
      +  "bearer",
      +  "apikey",
      +  "digest",
      +  "oauth1",
      +  "oauth2",
      +  "hawk",
      +  "awsv4",
      +  "ntlm",
      +  "edgegrid",
      +  "jwt",
      +  "asap",
      +  "noauth"
      +]
  5. Changed2 schema fields changedv2.8.7
    • addedInput schema / properties / collection / properties / item / items / properties / createdAt
      Added value: +{
      +  "description": "The date and time at which the collection item was created.",
      +  "format": "date-time",
      +  "type": "string"
      +}
    • addedInput schema / properties / collection / properties / item / items / properties / updatedAt
      Added value: +{
      +  "description": "The date and time at which the collection item was updated.",
      +  "format": "date-time",
      +  "type": "string"
      +}
  6. First observed

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes beyond the annotations by disclosing critical behavioral details: the destructive nature of omitting ID values (removes existing items and recreates them), the 100 MB size limit, the async behavior with 202 Accepted responses, and the error condition when copying from another collection without removing IDs. The annotations mark destructiveHint=false, but the description appropriately warns about data loss when IDs are omitted, which is valuable context. It doesn't contradict the annotations since the tool itself isn't inherently destructive—it's the user's input that determines destructiveness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections and bullet points. It front-loads the core purpose and the most critical warning about ID values. The additional documentation links are useful but somewhat verbose; the protocol profile behavior link and the repeated note about ID removal could be consolidated. Overall, it's appropriately sized for a complex tool with significant behavioral nuances.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (nested collection schema, async behavior, destructive potential), the description covers the essential operational aspects: the schema format, ID handling rules, size limit, async option, and status-check endpoint. There's no output schema, but the description mentions the 202 response for async operations. It could mention the success response for synchronous operations, but the core information needed to call the tool correctly is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, so the baseline is 3. The description adds meaningful value by explaining the critical ID-related behavior: including IDs preserves items, omitting them removes and recreates items, and copying from another collection requires removing all ID values. This directly informs how to construct the 'collection' parameter. The Prefer parameter is also explained in the description with the async behavior and response code.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool replaces the contents of a collection using the Postman Collection v2.1.0 schema format. It distinguishes itself from sibling tools like createCollection (which creates new collections) and updateCollectionRequest (which updates individual requests) by focusing on full replacement of collection data. The title 'Replace a collection's data' reinforces the specific verb-resource relationship.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: it's for replacing collection contents, and it warns about the critical behavior of ID handling. It also mentions the async update option via the Prefer header and directs users to the GET /collection-updates-tasks/{taskId} endpoint for status checks. While it doesn't explicitly name sibling alternatives, the replacement semantics are clear enough to distinguish from create/update operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.