---
title: Create topic relations
slug: topic-api/create-topic-relations
docTags: 
createdAt: 2024-12-02T11:04:39.843Z
---

{
  "id": "PAyvfxeB62Mp5FjO_q51r",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/topics/{topic-id}/related_topics",
    "servers": [
      {
        "url": "https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/topics/{topic-id}/related_topics"
      }
    ],
    "name": "Create topic relations",
    "description": "Create new topic relations.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "topic-board-id",
          "type": "string",
          "example": "e18a2d10-1595-4e52-a941-22d43bf8d7ad",
          "description": "Id of the topic board"
        },
        {
          "kind": "required",
          "name": "topic-id",
          "type": "string",
          "example": "18d0273d-e15c-4924-97b3-6f47b233eebe",
          "description": "Topic id"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "description": "List of related topic ids",
          "schema": [
            {
              "name": "related_topic_guid",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "5ae3214f-7333-4b3c-8b0a-1f8dca44616a"
            }
          ],
          "itemType": "object",
          "customType": "object[]",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "List of related topics",
            "schema": [
              {
                "name": "related_topic_guid",
                "kind": "optional",
                "type": "string",
                "description": "Id of the related topic",
                "example": "5ae3214f-7333-4b3c-8b0a-1f8dca44616a"
              }
            ],
            "itemType": "object",
            "customType": "object[]",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "oPZfrwKU1UulFl4LgTWG-",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/topics/{topic-id}/related_topics \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {\n     \"related_topic_guid\": \"5ae3214f-7333-4b3c-8b0a-1f8dca44616a\"\n     }\n     ]'"
        },
        {
          "id": "Abu44PUfdZZpQo0TCn_eC",
          "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      \"related_topic_guid\": \"5ae3214f-7333-4b3c-8b0a-1f8dca44616a\"\n   }\n]);\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/topics/{topic-id}/related_topics\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "4FVlvj1ZkuJXHIV4Yg9XE",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/topics/{topic-id}/related_topics\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump([\n   {\n      \"related_topic_guid\": \"5ae3214f-7333-4b3c-8b0a-1f8dca44616a\"\n   }\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "aRyXOlFXIMT_jN4p4fW87",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/topics/{topic-id}/related_topics\"\n\npayload = json.dumps([\n   {\n      \"related_topic_guid\": \"5ae3214f-7333-4b3c-8b0a-1f8dca44616a\"\n   }\n])\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "oPZfrwKU1UulFl4LgTWG-"
    },
    "results": {
      "languages": [
        {
          "id": "PikNvYa50z3pBOWjWgWnV",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"related_topic_guid\": \"5ae3214f-7333-4b3c-8b0a-1f8dca44616a\"\n  }\n]"
        }
      ],
      "selectedLanguageId": "PikNvYa50z3pBOWjWgWnV"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}