---
title: Create collection
slug: document-api/create-collection
docTags: 
createdAt: 2025-10-20T09:39:14.635Z
---

{
  "id": "xtlnXiS2UcDZ8136JDHil",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.catenda.com/v2/projects/{project-id}/libraries/collections",
    "servers": [
      {
        "url": "https://api.catenda.com/v2/projects/{project-id}/libraries/collections"
      }
    ],
    "name": "Create collection",
    "description": "Add a new document library item collection.\n",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project-id",
          "type": "string",
          "example": "af2d8af0fa54465b89bf26dd3d92cfd0",
          "description": "Catenda project id"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "The name of the library item collection.",
              "example": "Collection 1"
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "The description of the library item collection.",
              "example": "Collection description"
            },
            {
              "name": "items",
              "kind": "optional",
              "type": "array",
              "description": "List of items to add to the colleciton.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "libraryId",
                  "kind": "required",
                  "type": "string",
                  "description": "The library id of the library item.",
                  "example": "ead9b194e6024e6b92cae1d791797b68"
                },
                {
                  "name": "libraryItemId",
                  "kind": "required",
                  "type": "string",
                  "description": "The id of the library item.",
                  "example": "5badf33213ae420ebf81e727d5281850"
                },
                {
                  "name": "fileId",
                  "kind": "required",
                  "type": "string",
                  "description": "<p>The id of the library item revision, defaults to the latest document revision id.</p>",
                  "example": "5dc75452-29a4-4c4a-8415-991b92a92001"
                }
              ]
            },
            {
              "name": "followLatestRevision",
              "kind": "optional",
              "type": "boolean",
              "description": "Set whether the collection uses the latest revision of all items or the revision when added to the collection.",
              "example": true
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "collection",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "<p>Id of the collection, represented as compacted UUID using 32 hexadecimal characters.</p>",
                "example": "924809076a694255b589d236517a55da"
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "The name of the collection.",
                "example": "Collection name"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "The description of the collection.",
                "example": "Collection description"
              },
              {
                "name": "finalized",
                "kind": "optional",
                "type": "boolean",
                "description": "Indicates whether the collection is finalized.\n\nFinalized collections can no longer be edited.\n",
                "example": false
              },
              {
                "name": "followLatestRevision",
                "kind": "optional",
                "type": "boolean",
                "description": "Determines whether collection items follow the latest revision of a library item or the revision when added to the collection.",
                "example": true
              },
              {
                "name": "visibility",
                "kind": "optional",
                "type": "string<private | project-members>",
                "description": "<p>Determines whether the collection is available to all project members.</p>\n<p>By default a collection becomes available to project members when it is finalized.</p>\n<p>Valid values are:</p>\n<ul>\n<li>private</li>\n<li>project-members</li>\n</ul>",
                "example": "private",
                "enum": [
                  "private",
                  "project-members"
                ]
              },
              {
                "name": "createdAt",
                "kind": "optional",
                "type": "string",
                "description": "The date and time the collection was created in ISO 8601 format.",
                "example": "2023-12-09T10:07:56.000Z"
              },
              {
                "name": "createdBy",
                "kind": "optional",
                "type": "string",
                "description": "The user id of the user who created the collection.",
                "example": "524809076a694255b989d236517a55da"
              }
            ],
            "modelRef": "#/components/schemas/collection",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "q_0dRtokIbT41Z3Gwu0dU",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.catenda.com/v2/projects/{project-id}/libraries/collections \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"name\": \"Collection 1\",\n     \"items\": [\n     {\n     \"libraryId\": \"ead9b194e6024e6b92cae1d791797b68\",\n     \"libraryItemId\": \"5badf33213ae420ebf81e727d5281850\",\n     \"fileId\": \"5dc75452-29a4-4c4a-8415-991b92a92001\"\n     }\n     ]\n     }'"
        },
        {
          "id": "xLhCDxJuJujdWJut5pYf4",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"name\": \"Collection 1\",\n   \"items\": [\n      {\n         \"libraryId\": \"ead9b194e6024e6b92cae1d791797b68\",\n         \"libraryItemId\": \"5badf33213ae420ebf81e727d5281850\",\n         \"fileId\": \"5dc75452-29a4-4c4a-8415-991b92a92001\"\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.catenda.com/v2/projects/{project-id}/libraries/collections\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "u5CaO2ncsJcXAk2CFOhNx",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.catenda.com/v2/projects/{project-id}/libraries/collections\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"name\": \"Collection 1\",\n   \"items\": [\n      {\n         \"libraryId\": \"ead9b194e6024e6b92cae1d791797b68\",\n         \"libraryItemId\": \"5badf33213ae420ebf81e727d5281850\",\n         \"fileId\": \"5dc75452-29a4-4c4a-8415-991b92a92001\"\n      }\n   ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "_XdEdNAiWTodtgJl1GQf7",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.catenda.com/v2/projects/{project-id}/libraries/collections\"\n\npayload = json.dumps({\n   \"name\": \"Collection 1\",\n   \"items\": [\n      {\n         \"libraryId\": \"ead9b194e6024e6b92cae1d791797b68\",\n         \"libraryItemId\": \"5badf33213ae420ebf81e727d5281850\",\n         \"fileId\": \"5dc75452-29a4-4c4a-8415-991b92a92001\"\n      }\n   ]\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "q_0dRtokIbT41Z3Gwu0dU"
    },
    "results": {
      "languages": [
        {
          "id": "gbKIiofjUP7KkWqaFHdZA",
          "language": "200",
          "code": "// OK\n{\n  \"id\": \"924809076a694255b589d236517a55da\",\n  \"name\": \"Collection name\",\n  \"description\": \"Collection description\",\n  \"finalized\": false,\n  \"followLatestRevision\": true,\n  \"visibility\": \"private\",\n  \"createdAt\": \"2023-12-09T10:07:56.000Z\",\n  \"createdBy\": \"524809076a694255b989d236517a55da\"\n}"
        }
      ],
      "selectedLanguageId": "gbKIiofjUP7KkWqaFHdZA"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}