billing.cost-views.update

Change a saved view, its sharing or its monthly mail

PATCH /billing/api/cost-views/{id}IAM billing:UpdateCostViewChanges state

Request syntax

PATCH /billing/api/cost-views/{id}
{
  "name": "string",
  "description": "string",
  "state": "object",
  "shared": "boolean",
  "report": "object"
}

Path parameters

  • idRequired

    string

    Constraints: uuid

Request body

  • nameOptional

    string

    1–100 characters, trimmed; unique in the organization (409 when taken)

    Constraints: 1-100 chars

  • descriptionOptional

    string

    New description, at most 500 characters; omitted: unchanged

    Constraints: max 500 chars

  • stateOptional

    object

    The explorer question: range (relative preset or fixed dates), granularity, groupBy, filters — the same shapes as cost-explorer/query. Grouping or filtering by provider needs iam:UpdateOrganization (403)

    Constraints: JSON

  • sharedOptional

    boolean

    true: visible to everyone with billing:GetCostAndUsage; false: only to its creator; omitted: unchanged

  • reportOptional

    object

    Replace the monthly mail settings: {enabled, recipients (at most 20 addresses)}; omitted: unchanged

    Constraints: JSON

Response

200 with the view after the change, as `list` shows it. 409 when the new name is taken; 404 when it is not in your organization or is someone else’s private view; 403 for a provider dimension without iam:UpdateOrganization.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow billing:UpdateCostView on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud billing cost-views update id

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_billing_cost-views_update.