Create a collection
POST {{baseUrl}}/collections
Creates a collection using the [Qodex Collection v2.1.0 schema format] 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, thehttps://schema.getQodex.com/json/collection/v2.1.0/collection.jsonURL.
item— An object that contains the HTTP request and response information.request— An object that contains the collection's request information. For a complete list of values, refer to the Request entry in the [Qodex Collection Format documentation] If you pass an empty object for this value, the system defaults to an untitled GET request.
Note:
If you do not include the
workspacequery parameter, the system creates the collection in yourMy Workspace
workspace.For a complete list of available property values for this endpoint, use the following references available in the [Qodex Collection Format documentation]
infoobject — Refer to the Information entry.itemobject — Refer to the Items entry.
For all other possible values, refer to the [Qodex Collection Format documentation]
Request Params
| Key | Datatype | Required | Description |
|---|---|---|---|
workspace | string | A workspace ID in which to create the collection. |
If you do not include this query parameter, the system creates the collection in your "My Workspace" workspace. |
Request Body
{"collection"=>{"info"=>{"name"=>"{{collectionName}}", "schema"=>"{{collectionSchemaUrl}}"}}}
RESPONSES
status: OK
{"collection":{"id":"12ece9e1-2abf-4edc-8e34-de66e74114d2","name":"Test Collection","uid":"12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2"}}