Logo
15_Days_of_Postman_-_for_testers_IvanKo API Documentation

Replace a collection's data

PUT {{baseUrl}}/collections/{{collectionId}}

Replaces the contents of a collection using the [Qodex Collection v2 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.

The maximum collection size this endpoint accepts cannot exceed 20 MB.

Include a collection object in the request body that contains the following required properties:

  • info — An object that contains the following properties:
    • name — A string value that contains the collection's name.
    • schema — A string value that contains a URL to the collection's schema. For example, the https://schema.getQodex.com/collection/v1 URL.
  • item — An object that contains the collection's information.

For a complete list of available property values for this endpoint, use the following references available in the [collection.json schema file]

  • info object — Use "#/definitions/info".
  • item object — Use "#/definitions/item".

For all other possible values, refer to the [collection.json schema file] For more information about the Collection Format, see the [Qodex Collection Format documentation]

Note:

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

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Content-Type
string




RESPONSES

status OK

{ "collection": { "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2", "name": "Test Collection", "uid": "12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2" } }



Curl
curl -X PUT 'https://api.getpostman.com/collections/collectionId' -H 'Content-Type: application/json' -d '{"collection":{"info":{"name":"collectionName","schema":"collectionSchemaUrl"},"item":[{}]}}'

ENDPOINTS