# Change a saved report

Replaces a saved report's question and its wording in ONE body — send `name`, `description`, `visibility` and `definition` together, not a field at a time, because half a definition leaves a report nobody can reason about. The report's owner or an admin; a built-in is nobody's and is duplicated rather than edited, and somebody else's private report answers 404 rather than 403.

Access class: `workspace`.

## Endpoint

`PATCH /v1/reports/views/{id}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "definition": {
      "dimensions": [
        {
          "field": "string"
        }
      ],
      "filters": [
        "string"
      ],
      "measures": [
        {
          "agg": "string",
          "field": "string"
        }
      ],
      "source": "string"
    },
    "description": "string",
    "name": "string",
    "visibility": "string"
  },
  "params": {
    ":id": "string"
  },
  "query": {}
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "view": {
      "created_at": "string",
      "definition": "string",
      "description": "string",
      "id": 1,
      "is_system": true,
      "name": "string",
      "owner_user_id": 1,
      "updated_at": "string",
      "visibility": "string"
    }
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
