---
title: /editAdministrativePolicy
slug: mihai-tests/editadministrativepolicy
createdAt: 2024-01-09T12:30:00.566Z
---

{
  "id": "mTbT9jttYVd7DuXo4Jiha",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://1.1.1.1/editAdministrativePolicy",
    "servers": [
      {
        "url": "http://1.1.1.1/editAdministrativePolicy"
      }
    ],
    "name": "",
    "description": "<ul>\n<li>\n<p>NOTE - this function can not be called from Swagger, please use editAdministrativePolicyForSwagger instead.</p>\n</li>\n<li>\n<p>This API allows to associate the different action types to the corresponding approval workflows.</p>\n</li>\n<li>\n<p>return - success or error response.</p>\n</li>\n</ul>\n<p>The order of the actions in the list defines their importance - from the most important to the less important,\ni.e. if the user did several actions in one session, the chosen approval workflow will be the one associated to\nthe most important action (the one that appears first in the list).</p>\n<ul>\n<li>Possible status codes:</li>\n</ul>\n<p>0 - Policy edited successfully,</p>\n<p>1 - Too many actions,</p>\n<p>2 - Duplicate action type,</p>\n<p>3 - Not enough actions,</p>\n<p>4 - Unknown actions,</p>\n<p>5 - Unknown approval workflows,</p>\n<p>6 - Approval workflow has an invalid type</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "actions",
          "type": "array",
          "description": "is a list of 'Action' objects (Action class is defined in apiclient/MpcDriven/Action.py).\n    It must include all the different action types defined in apiclient/MpcDriven/Action.py.\n    For example:\n    actions = [Action(ActionType.CREATE_OR_UPDATE_USER_MANAGEMENT, \"100003\"),\n    \n    Action(ActionType.CREATE_OR_UPDATE_ADDRESS_GROUPS_AND_CONTACTS, \"100004\"),\n    \n    Action(ActionType.COINS_MANAGEMENT, \"100000\"),\n    Action(ActionType.ADMINISTRATIVE_POLICY_AND_WORKFLOW, \"100001\"),\n    \n    Action(ActionType.TRANSACTION_POLICY_AND_WORKFLOW, \"100002\")]\n    In this case, the most important action is CREATE_OR_UPDATE_USER_MANAGEMENT, the next one is\n    create_or_update_address_groups_and_contacts, etc...                  \n",
          "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": "editAdministrativePolicyRequest",
          "schema": [
            {
              "name": "FunctionData",
              "kind": "optional",
              "type": "object",
              "example": "",
              "schema": [
                {
                  "name": "Actions",
                  "kind": "optional",
                  "type": "array",
                  "description": "List of actions with their types and workflow IDs",
                  "example": "[{\"ActionType\":4,\"ApprovalWorkflowId\":\"123\"},{\"ActionType\":3,\"ApprovalWorkflowId\":\"321\"},{\"ActionType\":5,\"ApprovalWorkflowId\":\"123\"}]",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "ActionType",
                      "kind": "optional",
                      "type": "integer",
                      "description": "Action type (4, 3, or 5)",
                      "example": 0
                    },
                    {
                      "name": "ApprovalWorkflowId",
                      "kind": "optional",
                      "type": "string",
                      "description": "Approval workflow ID",
                      "example": ""
                    }
                  ]
                },
                {
                  "name": "RequestExtraData",
                  "kind": "optional",
                  "type": "object",
                  "description": "Additional data for the request",
                  "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/MetaTokeneditAdministrativePolicy",
              "customType": "MetaTokeneditAdministrativePolicy",
              "schema": [
                {
                  "name": "FunctionName",
                  "kind": "optional",
                  "type": "string",
                  "description": "The Function to be called",
                  "example": "editAdministrativePolicy",
                  "default": "editAdministrativePolicy"
                },
                {
                  "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/editAdministrativePolicyRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "editAdministrativePolicyResponse",
            "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/editAdministrativePolicyResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'http://1.1.1.1/editAdministrativePolicy?actions=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     \"RequestExtraData\": {\n     \"MessageNumber\": 5,\n     \"SessionId\": \"3478593863424051983840947\"\n     }\n     },\n     \"Meta\": {\n     \"FunctionName\": \"editAdministrativePolicy\",\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      \"RequestExtraData\": {\n         \"MessageNumber\": 5,\n         \"SessionId\": \"3478593863424051983840947\"\n      }\n   },\n   \"Meta\": {\n      \"FunctionName\": \"editAdministrativePolicy\",\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/editAdministrativePolicy?actions=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/editAdministrativePolicy?actions=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      \"RequestExtraData\": {\n         \"MessageNumber\": 5,\n         \"SessionId\": \"3478593863424051983840947\"\n      }\n   },\n   \"Meta\": {\n      \"FunctionName\": \"editAdministrativePolicy\",\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/editAdministrativePolicy?actions=array&request_extra_data=\\\"{\\\\n  \\\\\\\"MessageNumber\\\\\\\": 5,\\\\n  \\\\\\\"SessionId\\\\\\\": \\\\\\\"3478593863424051983840947\\\\\\\"\\\\n}\\\\n\\\"\"\n\npayload = json.dumps({\n   \"FunctionData\": {\n      \"RequestExtraData\": {\n         \"MessageNumber\": 5,\n         \"SessionId\": \"3478593863424051983840947\"\n      }\n   },\n   \"Meta\": {\n      \"FunctionName\": \"editAdministrativePolicy\",\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": "OegIq5bHNjM4flTcdu9qm",
      "type": "bulleted-list",
      "children": [
        {
          "id": "HmOS9NLS9k1rdsM-xH1VG",
          "type": "list-item",
          "children": [
            {
              "id": "l76jPBf4IY3SvtIeQaJDa",
              "type": "list-item-child",
              "children": [
                {
                  "text": "NOTE - this function can not be called from Swagger, please use editAdministrativePolicyForSwagger instead."
                }
              ]
            }
          ]
        },
        {
          "id": "oa4HSWp_TMeqLh37uswyW",
          "type": "list-item",
          "children": [
            {
              "id": "viGspZMzFbwr-2C7Z8i29",
              "type": "list-item-child",
              "children": [
                {
                  "text": "This API allows to associate the different action types to the corresponding approval workflows."
                }
              ]
            }
          ]
        },
        {
          "id": "Aqe0y8uCBLp8B0_UuMUNL",
          "type": "list-item",
          "children": [
            {
              "id": "7x8aKFYPHZLoruVGXc3CI",
              "type": "list-item-child",
              "children": [
                {
                  "text": "return - success or error response."
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": "6ncmyyl03xEBiKX4Nbv20",
      "type": "paragraph",
      "children": [
        {
          "text": "The order of the actions in the list defines their importance - from the most important to the less important,\ni.e. if the user did several actions in one session, the chosen approval workflow will be the one associated to\nthe most important action (the one that appears first in the list)."
        }
      ]
    },
    {
      "id": "kh2CeKjhcjOuo-tTKM527",
      "type": "bulleted-list",
      "children": [
        {
          "id": "mxwqVMcSD-PNCsLqVSGHW",
          "type": "list-item",
          "children": [
            {
              "id": "U0MRlqT2EQd_tAHQrMV01",
              "type": "list-item-child",
              "children": [
                {
                  "text": "Possible status codes:"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": "JXAbKbkZY8sCsdydEUCFP",
      "type": "paragraph",
      "children": [
        {
          "text": "0 - Policy edited successfully,"
        }
      ]
    },
    {
      "id": "37ZW92uFtqx4sHMYuPIFt",
      "type": "paragraph",
      "children": [
        {
          "text": "1 - Too many actions,"
        }
      ]
    },
    {
      "id": "f7hDIb_aIovIBY6p0qDeq",
      "type": "paragraph",
      "children": [
        {
          "text": "2 - Duplicate action type,"
        }
      ]
    },
    {
      "id": "y5zsTELSqtV3fSvKRx2VE",
      "type": "paragraph",
      "children": [
        {
          "text": "3 - Not enough actions,"
        }
      ]
    },
    {
      "id": "pbPmIGN6jIHumONyII15U",
      "type": "paragraph",
      "children": [
        {
          "text": "4 - Unknown actions,"
        }
      ]
    },
    {
      "id": "Dq5DWWerUSKPS8rUbIjX9",
      "type": "paragraph",
      "children": [
        {
          "text": "5 - Unknown approval workflows,"
        }
      ]
    },
    {
      "id": "eVy9UdXhgaW57g1241JJk",
      "type": "paragraph",
      "children": [
        {
          "text": "6 - Approval workflow has an invalid type"
        }
      ]
    }
  ]
}