---
title: /editTransactionPolicyForSwagger
slug: edittransactionpolicyforswagger
createdAt: 2024-01-09T12:30:00.566Z
---

{
  "id": "Uj_QlFQzBzn6i2G0Tr60G",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://1.1.1.1/editTransactionPolicyForSwagger",
    "servers": [
      {
        "url": "http://1.1.1.1/editTransactionPolicyForSwagger"
      }
    ],
    "name": "",
    "description": "<ul>\n<li>Allows creating a transaction policy for MPC driven system</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "example": "123",
          "description": "random UUID generated by the client",
          "default": "123"
        },
        {
          "kind": "required",
          "name": "name",
          "type": "string",
          "example": "newPolicy",
          "description": "the name to the new policy",
          "default": "newPolicy"
        },
        {
          "kind": "required",
          "name": "user_ids",
          "type": "array",
          "description": "initiator User IDs (should be empty if all_users is True)",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "required",
          "name": "user_group_ids",
          "type": "array",
          "description": "initiator User Group IDs (should be empty if all_users is True)",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "required",
          "name": "all_users",
          "type": "boolean",
          "example": "True",
          "description": "<p>all users are allowed to be initiators with this policy (should be False if specific users or user groups are used)</p>",
          "default": "True"
        },
        {
          "kind": "required",
          "name": "account_ids",
          "type": "array",
          "description": "account IDs that transactions can be sent from",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "required",
          "name": "currencies",
          "type": "array",
          "description": "list of specific assets that are relevant for this policy (should be empty if all_assets parameter is True)",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "required",
          "name": "all_assets",
          "type": "boolean",
          "example": "True",
          "description": "<p>All relevant assets are associated with this policy (should be False if specific assets are selected in currencies parameter)</p>",
          "default": "True"
        },
        {
          "kind": "required",
          "name": "policy_type",
          "type": "string",
          "example": "TRANSFER",
          "description": "<p>the policy type (0 for transfer, 1 for smart contract, 4 for raw signing)</p>",
          "default": "TRANSFER"
        },
        {
          "kind": "required",
          "name": "session_id",
          "type": "string",
          "example": "3478593863424051983840947",
          "description": "the session id of the contract in string",
          "default": "3478593863424051983840947"
        },
        {
          "kind": "required",
          "name": "administrative_message_number",
          "type": "integer",
          "example": 5,
          "description": "the administrative message number",
          "default": 5
        },
        {
          "kind": "optional",
          "name": "allow_smart_contract_transaction",
          "type": "boolean",
          "example": "True",
          "description": "<p>whether or not smart contract transactions are allowed (only relevant for Policy Type 0)</p>",
          "default": "True"
        },
        {
          "kind": "optional",
          "name": "all_addresses",
          "type": "boolean",
          "example": "True",
          "description": "<p>can transfer to all addresses (should be False if specific contacts or address groups are selected - only relevant for Policy Type 0)</p>",
          "default": "True"
        },
        {
          "kind": "optional",
          "name": "contact_ids",
          "type": "array",
          "description": "the destination Contact IDs (only relevant for Policy Type 0)",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "address_group_ids",
          "type": "array",
          "description": "the destination Address Group IDs (only relevant for Policy Type 0)",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows",
          "type": "object",
          "example": "",
          "description": "A dictionary of flags to customize transaction policy and workflow settings. It allows you to enable or disable features like personal signing, EIP-712 signing, contract deployment, raw signing, and set transaction policy ranges and roles.",
          "default": "{\n  \"please_insert_your_object_data_inside_the_requestBody\": \"your_object_here\"\n}      \n",
          "schema": []
        },
        {
          "kind": "optional",
          "name": "frequency",
          "type": "integer",
          "example": 0,
          "description": "<p>the frequency at which the limits of the policy are reset (0 for daily, 1 for weekly - only relevant for Policy Type 0)</p>",
          "default": 0
        },
        {
          "kind": "optional",
          "name": "maximum",
          "type": "integer",
          "example": 100,
          "description": "<p>the maximum amount to be sent for this policy range, if None then it is assumed the range maximum is infinity</p>",
          "default": 100
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "customType": "editTransactionPolicyForSwaggerRequest",
          "schema": [
            {
              "name": "personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows",
              "kind": "optional",
              "type": "string",
              "example": "type_object_here",
              "default": "type_object_here"
            }
          ],
          "modelRef": "#/components/schemas/editTransactionPolicyForSwaggerRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "editTransactionPolicyForSwaggerResponse",
            "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/editTransactionPolicyForSwaggerResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'http://1.1.1.1/editTransactionPolicyForSwagger?id=123&name=newPolicy&user_ids=array&user_group_ids=array&all_users=True&account_ids=array&currencies=array&all_assets=True&policy_type=TRANSFER&session_id=3478593863424051983840947&administrative_message_number=5&allow_smart_contract_transaction=True&all_addresses=True&personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows=%22{%5Cn%20%20%5C%22please_insert_your_object_data_inside_the_requestBody%5C%22%3A%20%5C%22your_object_here%5C%22%5Cn}%20%20%20%20%20%20%5Cn%22&frequency=integer&maximum=100' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows\": \"type_object_here\"\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   \"personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows\": \"type_object_here\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"http://1.1.1.1/editTransactionPolicyForSwagger?id=123&name=newPolicy&user_ids=array&user_group_ids=array&all_users=True&account_ids=array&currencies=array&all_assets=True&policy_type=TRANSFER&session_id=3478593863424051983840947&administrative_message_number=5&allow_smart_contract_transaction=True&all_addresses=True&personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows=\\\"{\\\\n  \\\\\\\"please_insert_your_object_data_inside_the_requestBody\\\\\\\": \\\\\\\"your_object_here\\\\\\\"\\\\n}      \\\\n\\\"&frequency=integer&maximum=100\", 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/editTransactionPolicyForSwagger?id=123&name=newPolicy&user_ids=array&user_group_ids=array&all_users=True&account_ids=array&currencies=array&all_assets=True&policy_type=TRANSFER&session_id=3478593863424051983840947&administrative_message_number=5&allow_smart_contract_transaction=True&all_addresses=True&personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows=\\\"{\\n  \\\\\"please_insert_your_object_data_inside_the_requestBody\\\\\": \\\\\"your_object_here\\\\\"\\n}      \\n\\\"&frequency=integer&maximum=100\")\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   \"personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows\": \"type_object_here\"\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/editTransactionPolicyForSwagger?id=123&name=newPolicy&user_ids=array&user_group_ids=array&all_users=True&account_ids=array&currencies=array&all_assets=True&policy_type=TRANSFER&session_id=3478593863424051983840947&administrative_message_number=5&allow_smart_contract_transaction=True&all_addresses=True&personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows=\\\"{\\\\n  \\\\\\\"please_insert_your_object_data_inside_the_requestBody\\\\\\\": \\\\\\\"your_object_here\\\\\\\"\\\\n}      \\\\n\\\"&frequency=integer&maximum=100\"\n\npayload = json.dumps({\n   \"personal_sign_and_eip712_sign_and_contract_deployment_raw_signing_and_ranges_and_roles_to_workflows\": \"type_object_here\"\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": "PEKgDrpgpGmW8QL14pkSz",
      "type": "bulleted-list",
      "children": [
        {
          "id": "LjAY8yYHHSJAiQeV8s4Lb",
          "type": "list-item",
          "children": [
            {
              "id": "4mFnFLBNQyUOYNfsR3SF0",
              "type": "list-item-child",
              "children": [
                {
                  "text": "Allows creating a transaction policy for MPC driven system",
                  "id": "xT9EWj5AwqOgrQLhO88AH"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}