---
title: Add associations
slug: document-api/add-associations
docTags: 
createdAt: 2025-10-20T09:39:14.635Z
---

{
  "id": "RX5c4WniY3rFIG90Df4g0",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/associations",
    "servers": [
      {
        "url": "https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/associations"
      }
    ],
    "name": "Add associations",
    "description": "<p>Associate a library item to IFC products.</p>\n<p>IFC products are represented by their IfcGloballyUniqueId.</p>\n<p>Supported library types are <strong>document</strong>, <strong>link</strong> and <strong>classification</strong>.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project-id",
          "type": "string",
          "example": "af2d8af0fa54465b89bf26dd3d92cfd0",
          "description": "Catenda project id"
        },
        {
          "kind": "required",
          "name": "library-id",
          "type": "string",
          "description": "Id of the library"
        },
        {
          "kind": "required",
          "name": "library-item-id",
          "type": "string",
          "description": "Id of the library item"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "revision",
          "type": "string",
          "description": "<p>Specify which revisions are used to resolve global id from objectId by providing a comma separated list. If not present, the latest revisions in all models in the project are used.</p>"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "description": "",
          "schema": [
            {
              "name": "globalId",
              "kind": "optional",
              "type": "string",
              "description": "A 22 character IfcGloballyUniqueId.",
              "example": "2_TmT90tD0x9tJSTsyTb1J"
            },
            {
              "name": "objectId",
              "kind": "optional",
              "type": "string",
              "description": "The object id of a product.",
              "example": 192042324556
            }
          ],
          "itemType": "object",
          "customType": "object[]",
          "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": "array",
            "description": "",
            "customType": "library-item-association[]",
            "schema": [
              {
                "name": "globalId",
                "kind": "optional",
                "type": "string",
                "description": "A 22 character IfcGloballyUniqueId.",
                "example": "2_TmT90tD0x9tJSTsyTb1J"
              },
              {
                "name": "createdAt",
                "kind": "optional",
                "type": "string",
                "description": "The date and time the association was created.",
                "example": "2023-12-09T10:07:56Z"
              },
              {
                "name": "user",
                "kind": "optional",
                "type": "object",
                "description": "<p>Represents a User, Organization or Team.</p>\n<p>A User is someone with a Catenda account, commonly representing a person.</p>\n<p>An Organization represents a company, project organization or an application. Organizations do not have a username and cannot sign in to Catenda.</p>\n<p>A Team represents a group of users within a project. Teams do not have a username and cannot sign in to Catenda.</p>",
                "modelRef": "#/components/schemas/user",
                "customType": "user",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": "Represented as compacted UUID using 32 hexadecimal characters",
                    "example": "524809076a694255b989d236517a55da"
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>The name of the user, limited to 128 characters</p>",
                    "example": "John Doe"
                  },
                  {
                    "name": "username",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The handle the user identifies with.</p>\n<p>Commonly the username will be in email address format. Usernames are unique but subject to change, we recommend using the id field to reference users instead.</p>\n<p>If the user represents an organization or a team the value is always null.</p>\n<p>Limited to 50 characters.</p>",
                    "example": "john@doe.com"
                  },
                  {
                    "name": "email",
                    "kind": "optional",
                    "type": "string",
                    "description": "Email address of the User",
                    "example": "john@doe.com"
                  },
                  {
                    "name": "createdAt",
                    "kind": "optional",
                    "type": "string",
                    "description": "The date and time the user was created in ISO 8601 format",
                    "example": "2016-09-20T14:55:22.000Z"
                  },
                  {
                    "name": "avatarUrl",
                    "kind": "optional",
                    "type": "string",
                    "description": "The URL for the user avatar",
                    "example": "https://api.catenda.com/v2/avatar/397t0ccd8f74516096c738de15dc6512"
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string<user | organization | team>",
                    "description": "<p>The type of user, valid values are:</p>\n<ul>\n<li>user</li>\n<li>organization</li>\n<li>team</li>\n</ul>",
                    "example": "user",
                    "enum": [
                      "user",
                      "organization",
                      "team"
                    ]
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/library-item-association",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "SPjMphnLrJw09kvOOSUgb",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/associations \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "6KsqNHetZES-HLnCmrIps",
          "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   {}\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/{library-id}/items/{library-item-id}/associations\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "qitw9IQRRf5TmF54E4meS",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/associations\")\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   {}\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "AyzyH3vJD8Zf1lrOJ4WHo",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/associations\"\n\npayload = json.dumps([\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": "SPjMphnLrJw09kvOOSUgb"
    },
    "results": {
      "languages": [
        {
          "id": "yl2F-JwnwodOL4j_BQd4j",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"globalId\": \"2_TmT90tD0x9tJSTsyTb1J\",\n    \"createdAt\": \"2023-12-09T10:07:56Z\",\n    \"user\": {\n      \"id\": \"524809076a694255b989d236517a55da\",\n      \"name\": \"John Doe\",\n      \"username\": \"john@doe.com\",\n      \"email\": \"john@doe.com\",\n      \"createdAt\": \"2016-09-20T14:55:22.000Z\",\n      \"avatarUrl\": \"https://api.catenda.com/v2/avatar/397t0ccd8f74516096c738de15dc6512\",\n      \"type\": \"user\"\n    }\n  }\n]"
        }
      ],
      "selectedLanguageId": "yl2F-JwnwodOL4j_BQd4j"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}