---
title: Link user
slug: topic-api/link-user
docTags: 
createdAt: 2024-06-10T16:49:07.009Z
---

{
  "id": "-84voaNlLBFIPWbkhPF-q",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/extensions/users/link",
    "servers": [
      {
        "url": "https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/extensions/users/link"
      }
    ],
    "name": "Link user",
    "description": "Merge an unlinked user into an existing topic board user.",
    "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"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "existingUserId",
              "kind": "required",
              "type": "string",
              "description": "The id of the existing user",
              "example": "john@doe.com"
            },
            {
              "name": "unlinkedUser",
              "kind": "required",
              "type": "string",
              "description": "The id of the user to link",
              "example": "john@doe.net"
            }
          ],
          "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": "object",
            "description": "",
            "customType": "topic-board-user",
            "schema": [
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": "Name of the user",
                "example": "John Doe"
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "Id of the user",
                "example": "john@doe.com"
              },
              {
                "name": "unlinked",
                "kind": "optional",
                "type": "boolean",
                "description": "Set when the user is not known to the topic board",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/topic-board-user",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "aqg5x57Re3f0JdmMFMGj0",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/extensions/users/link \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data-raw '{\n     \"existingUserId\": \"john@doe.com\",\n     \"unlinkedUser\": \"john@doe.net\"\n     }'"
        },
        {
          "id": "cIP20mTvz0ewsw7u4e-zP",
          "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   \"existingUserId\": \"john@doe.com\",\n   \"unlinkedUser\": \"john@doe.net\"\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}/extensions/users/link\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "jrshRfbaE8IFmWAcdLzK3",
          "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}/extensions/users/link\")\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   \"existingUserId\": \"john@doe.com\",\n   \"unlinkedUser\": \"john@doe.net\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "UowpQ_lL-ZvcW-z4h0rab",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.catenda.com/opencde/bcf/3.0/projects/{topic-board-id}/extensions/users/link\"\n\npayload = json.dumps({\n   \"existingUserId\": \"john@doe.com\",\n   \"unlinkedUser\": \"john@doe.net\"\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": "aqg5x57Re3f0JdmMFMGj0"
    },
    "results": {
      "languages": [
        {
          "id": "jQdjoQGCkrxuVBZMOgfly",
          "language": "200",
          "code": "// OK\n{\n  \"name\": \"John Doe\",\n  \"id\": \"john@doe.com\",\n  \"unlinked\": false\n}"
        }
      ],
      "selectedLanguageId": "jQdjoQGCkrxuVBZMOgfly"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}