---
title: /createContacts
slug: createcontacts
createdAt: 2024-01-09T12:30:00.560Z
---

{
  "id": "7l-E07MhO_xBe1F5ThIcm",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://1.1.1.1/createContacts",
    "servers": [
      {
        "url": "http://1.1.1.1/createContacts"
      }
    ],
    "name": "",
    "description": "<ul>\n<li>\n<p>NOTE - this function can not be called from Swagger, please use createContactsForSwagger instead.</p>\n</li>\n<li>\n<p>Calling this request can be used for reconnect a MPC user to the mobile app while MPC driven is enabled by setting a new mobile app public key</p>\n</li>\n<li>\n<p>For completing the reconnect, the mobile should call to \"registerMpcUser\" after this session approved</p>\n</li>\n<li>\n<p>This request will be handled in a separate session that will contain only the \"reconnectMpcUserToMobileApp\"</p>\n</li>\n<li>\n<p>return - success or error response.</p>\n</li>\n<li>\n<p>Possible status codes:</p>\n</li>\n</ul>\n<p>0 - Contacts created successfully,</p>\n<p>1 - Contact already exists,</p>\n<p>2 - Invalid name,</p>\n<p>3 - Unknown address group,</p>\n<p>4 - Unknown Currency,</p>\n<p>5 - Unknown authorization type,</p>\n<p>6 - Invalid address,</p>\n<p>7 - Duplicate contact,</p>\n<p>8 - At most one address group per contact is supported,</p>\n<p>9 - Node is currently unavailable,</p>\n<p>10 - Smart contract contacts cannot be authorized as internal addresses,</p>\n<p>11 - Too many contacts in request</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "contacts",
          "type": "array",
          "description": "is a list of 'Contact' objects (Contact class is defined in apiclient/MpcDriven/Contact.py).",
          "schema": [],
          "itemType": "object",
          "customType": "object[]"
        },
        {
          "kind": "required",
          "name": "request_extra_data",
          "type": "object",
          "example": "",
          "description": "additional data for the administrative request",
          "default": "{\n  \"MessageNumber\": 5,\n  \"SessionId\": \"3478593863424051983840947\"\n}\n",
          "schema": []
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "customType": "createContactsRequest",
          "schema": [
            {
              "name": "FunctionData",
              "kind": "optional",
              "type": "object",
              "example": "",
              "schema": [
                {
                  "name": "Contacts",
                  "kind": "optional",
                  "type": "array",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "Name",
                      "kind": "optional",
                      "type": "string",
                      "description": "Contact name",
                      "example": "contact name",
                      "default": "contact name"
                    },
                    {
                      "name": "Currency",
                      "kind": "optional",
                      "type": "string",
                      "description": "Currency",
                      "example": "ETH",
                      "default": "ETH"
                    },
                    {
                      "name": "Address",
                      "kind": "optional",
                      "type": "string",
                      "description": "Address",
                      "example": "0x123",
                      "default": "0x123"
                    },
                    {
                      "name": "AddressGroupIds",
                      "kind": "optional",
                      "type": "array",
                      "description": "List of address group IDs",
                      "example": "[\"123\"]",
                      "itemType": "string",
                      "customType": "string[]",
                      "itemExample": "",
                      "itemDefault": ""
                    },
                    {
                      "name": "AuthorizationType",
                      "kind": "optional",
                      "type": "integer",
                      "description": "Authorization type (1 for internal, 2 for authorized)",
                      "example": 1,
                      "default": 1
                    }
                  ]
                },
                {
                  "name": "RequestExtraData",
                  "kind": "optional",
                  "type": "object",
                  "example": "",
                  "schema": [
                    {
                      "name": "MessageNumber",
                      "kind": "optional",
                      "type": "integer",
                      "description": "Message number",
                      "example": 5,
                      "default": 5
                    },
                    {
                      "name": "SessionId",
                      "kind": "optional",
                      "type": "string",
                      "description": "Session ID",
                      "example": "3478593863424051983840947",
                      "default": "3478593863424051983840947"
                    }
                  ]
                }
              ]
            },
            {
              "name": "Meta",
              "kind": "optional",
              "type": "object",
              "modelRef": "#/components/schemas/MetaTokencreateContacts",
              "customType": "MetaTokencreateContacts",
              "schema": [
                {
                  "name": "FunctionName",
                  "kind": "optional",
                  "type": "string",
                  "description": "The Function to be called",
                  "example": "createContacts",
                  "default": "createContacts"
                },
                {
                  "name": "RandomData",
                  "kind": "optional",
                  "type": "string",
                  "description": "Random Data",
                  "example": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229",
                  "default": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229"
                },
                {
                  "name": "Destination",
                  "kind": "optional",
                  "type": "string",
                  "description": "Id of the server",
                  "example": "",
                  "default": "b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea"
                },
                {
                  "name": "Time",
                  "kind": "optional",
                  "type": "string",
                  "description": "UTC Time of execution",
                  "example": "2021-02-07T18:37:46.948Z",
                  "default": "2021-02-07T18:37:46.948Z"
                },
                {
                  "name": "Source",
                  "kind": "optional",
                  "type": "string",
                  "description": "User public key",
                  "example": "",
                  "default": "048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99"
                },
                {
                  "name": "AccessToken",
                  "kind": "optional",
                  "type": "string",
                  "description": "Token used for authentication purposes",
                  "example": "51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087",
                  "default": "51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087"
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/createContactsRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "createContactsResponse",
            "schema": [
              {
                "name": "FunctionData",
                "kind": "optional",
                "type": "object",
                "example": "",
                "schema": [
                  {
                    "name": "StatusCode",
                    "kind": "optional",
                    "type": "integer",
                    "description": "Status code for the current run",
                    "example": 0,
                    "default": 0
                  }
                ]
              },
              {
                "name": "Meta",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/components/schemas/MetaResponse",
                "customType": "MetaResponse",
                "schema": [
                  {
                    "name": "AccessToken",
                    "kind": "optional",
                    "type": "string",
                    "description": "The new access token generated after this operation",
                    "example": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
                    "default": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6"
                  },
                  {
                    "name": "Destination",
                    "kind": "optional",
                    "type": "string",
                    "description": "Id of the server",
                    "example": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
                    "default": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622"
                  },
                  {
                    "name": "Source",
                    "kind": "optional",
                    "type": "string",
                    "description": "User public key",
                    "example": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
                    "default": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355"
                  },
                  {
                    "name": "Time",
                    "kind": "optional",
                    "type": "string",
                    "description": "UTC Time of execution",
                    "example": "2021-02-14 09:58:52.320",
                    "default": "2021-02-14 09:58:52.320"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/createContactsResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'http://1.1.1.1/createContacts?contacts=array&request_extra_data=%22{%5Cn%20%20%5C%22MessageNumber%5C%22%3A%205%2C%5Cn%20%20%5C%22SessionId%5C%22%3A%20%5C%223478593863424051983840947%5C%22%5Cn}%5Cn%22' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"FunctionData\": {\n     \"Contacts\": [\n     {\n     \"Name\": \"contact name\",\n     \"Currency\": \"ETH\",\n     \"Address\": \"0x123\",\n     \"AuthorizationType\": 1\n     }\n     ],\n     \"RequestExtraData\": {\n     \"MessageNumber\": 5,\n     \"SessionId\": \"3478593863424051983840947\"\n     }\n     },\n     \"Meta\": {\n     \"FunctionName\": \"createContacts\",\n     \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n     \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n     \"Time\": \"2021-02-07T18:37:46.948Z\",\n     \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n     \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\n     }\n     }'"
        },
        {
          "id": "example-1-javascript",
          "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   \"FunctionData\": {\n      \"Contacts\": [\n         {\n            \"Name\": \"contact name\",\n            \"Currency\": \"ETH\",\n            \"Address\": \"0x123\",\n            \"AuthorizationType\": 1\n         }\n      ],\n      \"RequestExtraData\": {\n         \"MessageNumber\": 5,\n         \"SessionId\": \"3478593863424051983840947\"\n      }\n   },\n   \"Meta\": {\n      \"FunctionName\": \"createContacts\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\n   }\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"http://1.1.1.1/createContacts?contacts=array&request_extra_data=\\\"{\\\\n  \\\\\\\"MessageNumber\\\\\\\": 5,\\\\n  \\\\\\\"SessionId\\\\\\\": \\\\\\\"3478593863424051983840947\\\\\\\"\\\\n}\\\\n\\\"\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://1.1.1.1/createContacts?contacts=array&request_extra_data=\\\"{\\n  \\\\\"MessageNumber\\\\\": 5,\\n  \\\\\"SessionId\\\\\": \\\\\"3478593863424051983840947\\\\\"\\n}\\n\\\"\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"FunctionData\": {\n      \"Contacts\": [\n         {\n            \"Name\": \"contact name\",\n            \"Currency\": \"ETH\",\n            \"Address\": \"0x123\",\n            \"AuthorizationType\": 1\n         }\n      ],\n      \"RequestExtraData\": {\n         \"MessageNumber\": 5,\n         \"SessionId\": \"3478593863424051983840947\"\n      }\n   },\n   \"Meta\": {\n      \"FunctionName\": \"createContacts\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\n   }\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://1.1.1.1/createContacts?contacts=array&request_extra_data=\\\"{\\\\n  \\\\\\\"MessageNumber\\\\\\\": 5,\\\\n  \\\\\\\"SessionId\\\\\\\": \\\\\\\"3478593863424051983840947\\\\\\\"\\\\n}\\\\n\\\"\"\n\npayload = json.dumps({\n   \"FunctionData\": {\n      \"Contacts\": [\n         {\n            \"Name\": \"contact name\",\n            \"Currency\": \"ETH\",\n            \"Address\": \"0x123\",\n            \"AuthorizationType\": 1\n         }\n      ],\n      \"RequestExtraData\": {\n         \"MessageNumber\": 5,\n         \"SessionId\": \"3478593863424051983840947\"\n      }\n   },\n   \"Meta\": {\n      \"FunctionName\": \"createContacts\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\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": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// success\n{\n  \"FunctionData\": {\n    \"StatusCode\": 0\n  },\n  \"Meta\": {\n    \"AccessToken\": \"a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6\",\n    \"Destination\": \"042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622\",\n    \"Source\": \"df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355\",\n    \"Time\": \"2021-02-14 09:58:52.320\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "v06sa29NTeyxulfC5NeBv",
      "type": "bulleted-list",
      "children": [
        {
          "id": "gT56Rb9QjnioQ0G0n5j4h",
          "type": "list-item",
          "children": [
            {
              "id": "cHMr2qgg7Tf9FnWMMmK7x",
              "type": "list-item-child",
              "children": [
                {
                  "text": "NOTE - this function can not be called from Swagger, please use createContactsForSwagger instead.",
                  "id": "Nk8nLRTdBaNMqydNioHsU"
                }
              ]
            }
          ]
        },
        {
          "id": "tAd3Cl3y3iB98pzNvnUiN",
          "type": "list-item",
          "children": [
            {
              "id": "ht7kJ4Ux5C_f98TW4PeOQ",
              "type": "list-item-child",
              "children": [
                {
                  "text": "Calling this request can be used for reconnect a MPC user to the mobile app while MPC driven is enabled by setting a new mobile app public key",
                  "id": "kX85bf6Z-amtLzdnzV59-"
                }
              ]
            }
          ]
        },
        {
          "id": "Hcru9_KGOcDvCV76ZyIT6",
          "type": "list-item",
          "children": [
            {
              "id": "fw5cR9WD027AcUBMch8jc",
              "type": "list-item-child",
              "children": [
                {
                  "text": "For completing the reconnect, the mobile should call to \"registerMpcUser\" after this session approved",
                  "id": "y1y9FUz7vYlgO0BKJ-a67"
                }
              ]
            }
          ]
        },
        {
          "id": "Wj9ZGu7rZ1dWOOn9AGfjN",
          "type": "list-item",
          "children": [
            {
              "id": "pl8S4H0bcZuaiKDA-EkNR",
              "type": "list-item-child",
              "children": [
                {
                  "text": "This request will be handled in a separate session that will contain only the \"reconnectMpcUserToMobileApp\"",
                  "id": "Tc9T9z0K2qYd4ggw-jTHH"
                }
              ]
            }
          ]
        },
        {
          "id": "B31pIianI8bQ6Ce3H7nmY",
          "type": "list-item",
          "children": [
            {
              "id": "Jxy5O2GAXX43464T3nFwC",
              "type": "list-item-child",
              "children": [
                {
                  "text": "return - success or error response.",
                  "id": "LVuzJbHkP4Q_aGAIo1eXy"
                }
              ]
            }
          ]
        },
        {
          "id": "DWXx_12-VEpQXJIMDT0eN",
          "type": "list-item",
          "children": [
            {
              "id": "kp2TY20MBeRAuYymr79fX",
              "type": "list-item-child",
              "children": [
                {
                  "text": "Possible status codes:",
                  "id": "dgw3ujDQLBlSqmthNKfSR"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": "cvCX0DmGhsV5tCGHEBU_J",
      "type": "paragraph",
      "children": [
        {
          "text": "0 - Contacts created successfully,",
          "id": "CywxIJYv2LRZlKu4BwxIm"
        }
      ]
    },
    {
      "id": "T0fVbGDsRu-mKrZplk3db",
      "type": "paragraph",
      "children": [
        {
          "text": "1 - Contact already exists,",
          "id": "OXy8FsYvoUZxvpqz_5qfL"
        }
      ]
    },
    {
      "id": "E4sbzBcebQenX5F6SLQYc",
      "type": "paragraph",
      "children": [
        {
          "text": "2 - Invalid name,",
          "id": "_eT3mGWj7XC0wnZFgVzv1"
        }
      ]
    },
    {
      "id": "kRKfqGTh48P1s1Y-iPkg2",
      "type": "paragraph",
      "children": [
        {
          "text": "3 - Unknown address group,",
          "id": "NTjamYTBOMwU5wserU9R5"
        }
      ]
    },
    {
      "id": "ou3BQln5ZtvDZkydWWA9g",
      "type": "paragraph",
      "children": [
        {
          "text": "4 - Unknown Currency,",
          "id": "ehSR9bA4BPOja8DUT2h_j"
        }
      ]
    },
    {
      "id": "u4skl76UOsTIkD3gI6VDC",
      "type": "paragraph",
      "children": [
        {
          "text": "5 - Unknown authorization type,",
          "id": "9q9fCJbPt7EbvKCubqEE9"
        }
      ]
    },
    {
      "id": "SC2RUyC9pl9CunNPVG1-b",
      "type": "paragraph",
      "children": [
        {
          "text": "6 - Invalid address,",
          "id": "OXJDA3YTQwyVtveHBvrlo"
        }
      ]
    },
    {
      "id": "VlkveR35vkcYrFZgSBYcO",
      "type": "paragraph",
      "children": [
        {
          "text": "7 - Duplicate contact,",
          "id": "sIi9NG6POjA5EmWi0G9l0"
        }
      ]
    },
    {
      "id": "tFxLrcTiA1C-SoCtYV7YS",
      "type": "paragraph",
      "children": [
        {
          "text": "8 - At most one address group per contact is supported,",
          "id": "EpDeYkjawV3gj5rTI8XFX"
        }
      ]
    },
    {
      "id": "jjt8lhLJl8Q3Smh29WaBW",
      "type": "paragraph",
      "children": [
        {
          "text": "9 - Node is currently unavailable,",
          "id": "xg1PoZC8HXt7j7rUJ7V3V"
        }
      ]
    },
    {
      "id": "g4d3WTR6fz7dzcsZuagEs",
      "type": "paragraph",
      "children": [
        {
          "text": "10 - Smart contract contacts cannot be authorized as internal addresses,",
          "id": "B-4CGjtHVSA4XQVIQOVxk"
        }
      ]
    },
    {
      "id": "RM8kjXg5RyNWQdsog11jr",
      "type": "paragraph",
      "children": [
        {
          "text": "11 - Too many contacts in request",
          "id": "CKwrWEF55YEsNhgZ7wGkF"
        }
      ]
    }
  ]
}