---
updatedAt: 2025-03-10T14:02:42.000Z
agentTools:
  projectIndex: https://docs.umbrellacost.io/llms.txt
---

# Edit MSP Billing Rules

The call is used to update an existing MSP Billing Rule using its ID The billing rule ID is retrieved by the GET billing rules request.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Resellers",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.umbrellacost.io"
    }
  ],
  "x-readme": {
    "explorer-enabled": false
  },
  "paths": {
    "/api/v2/msp/billing-rules/v2": {
      "put": {
        "description": "The call is used to update an existing MSP Billing Rule using its ID The billing rule ID is retrieved by the GET billing rules request.",
        "summary": "Edit MSP Billing Rules",
        "tags": [
          "MSP Billing Rules"
        ],
        "operationId": "put_apiv2mspbilling-rulesv2",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ruleId": {
                      "type": "string",
                      "description": ""
                    },
                    "orgId": {
                      "type": "string",
                      "description": ""
                    },
                    "accountKey": {
                      "type": "string",
                      "description": ""
                    },
                    "description": {
                      "type": "object",
                      "description": ""
                    },
                    "margin": {
                      "type": "object",
                      "description": ""
                    },
                    "filters": {
                      "type": "object",
                      "description": ""
                    },
                    "sourceTemplateId": {
                      "type": "string",
                      "description": ""
                    },
                    "accountId": {
                      "type": "string",
                      "description": ""
                    },
                    "scope": {
                      "type": "object",
                      "description": ""
                    },
                    "linkedAccountIds": {
                      "type": "object",
                      "description": ""
                    },
                    "startMonth": {
                      "type": "string",
                      "description": ""
                    },
                    "endMonth": {
                      "type": "string",
                      "description": ""
                    }
                  }
                },
                "examples": {
                  "newExample": {
                    "summary": "Response Example",
                    "value": {
                      "ruleId": "123123",
                      "orgId": "432423",
                      "accountKey": 432432,
                      "description": {
                        "name": "test_v2",
                        "description": null
                      },
                      "margin": {
                        "type": "update_cost_with_factor",
                        "factor": 0.14,
                        "costType": "relative"
                      },
                      "filters": {},
                      "sourceTemplateId": null,
                      "accountId": "***",
                      "scope": {
                        "level": "customer",
                        "customerNames": [
                          "Customer5"
                        ],
                        "startMonth": "2024-11",
                        "endMonth": "2024-11"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "apikey",
            "in": "header",
            "required": true,
            "description": "",
            "schema": {
              "type": "string",
              "default": ""
            }
          }
        ],
        "x-readme": {
          "code-samples": [
            {
              "code": "curl --location --request PUT 'https://api-front.umbrellacost.io/api/v2/msp/billing-rules/v2' \\\n--header 'apikey: {{account-api-key}}' \\\n--header 'Authorization: {{Bearer-Token}}' \\\n--data '{\n    \"ruleId\": \"123123\",\n    \"description\": {\n        \"name\": \"test_v2\",\n        \"description\": null\n    },\n    \"margin\": {\n        \"type\": \"update_cost_with_factor\",\n        \"factor\": 0.14,\n        \"costType\": \"relative\"\n    },\n    \"scope\": {\n        \"level\": \"customer\",\n        \"customerNames\": [\"Customer5\"],\n        \"startMonth\": \"2024-11\",\n        \"endMonth\": \"2024-11\"\n    }\n}'",
              "language": "shell",
              "name": "Example v2 (new) - Edit an MSP Billing Rule"
            }
          ],
          "samples-languages": [
            "shell"
          ]
        }
      }
    }
  }
}
```