# `GET /v1/workspace/domain/changes` — Review the changes

Part of the [Bkper Managed Agent API](https://bkper.com/docs/api/managed-agent.md). Read its guide for authentication, conventions, and examples.

Everything Save would publish: each marked file as published at the base and in the working copy, with the working copy's `fingerprint` for Save. The user's verified domain's, for everyone in it; changes only for the domain's admin (403 workspace_forbidden), and none without a domain.

## Operation contract

```json
{
  "operationId": "getDomainContextChanges",
  "tags": [
    "Workspace"
  ],
  "summary": "Review the changes",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [],
  "description": "Everything Save would publish: each marked file as published at the base and in the working copy, with the working copy's `fingerprint` for Save. The user's verified domain's, for everyone in it; changes only for the domain's admin (403 workspace_forbidden), and none without a domain.",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/WorkspaceChanges"
          }
        }
      }
    },
    "400": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "410": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "411": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "503": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

## Schemas

### WorkspaceChanges

```json
{
  "type": "object",
  "properties": {
    "repository": {
      "type": "string"
    },
    "fingerprint": {
      "type": "string",
      "pattern": "^[0-9a-f]{40,64}$",
      "description": "The working copy reviewed: what Save sends."
    },
    "base": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The published commit compared with; null while nothing was published."
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "before": {
            "description": "As published at the base; absent when added.",
            "type": "object",
            "properties": {
              "size": {
                "type": "number",
                "description": "Bytes."
              },
              "text": {
                "description": "UTF-8 text up to 256 KiB, while the answer's text stays within 1 MiB; else only the size.",
                "type": "string"
              }
            },
            "required": [
              "size"
            ]
          },
          "after": {
            "description": "In the working copy; absent when deleted.",
            "type": "object",
            "properties": {
              "size": {
                "type": "number",
                "description": "Bytes."
              },
              "text": {
                "description": "UTF-8 text up to 256 KiB, while the answer's text stays within 1 MiB; else only the size.",
                "type": "string"
              }
            },
            "required": [
              "size"
            ]
          }
        },
        "required": [
          "path"
        ]
      },
      "description": "Each marked file, in path order: at most 100."
    },
    "truncated": {
      "description": "true when more files differ than `files` lists.",
      "type": "boolean"
    }
  },
  "required": [
    "repository",
    "fingerprint",
    "base",
    "files"
  ],
  "description": "The review: everything Save would publish, as one commit's changes show, deletions included."
}
```

### Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open."
        },
        "type": {
          "description": "Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.",
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "host": {
          "description": "host_in_use: the host another service holds.",
          "type": "string"
        },
        "service": {
          "description": "host_in_use: the id of the service that holds the host.",
          "type": "string"
        },
        "reason": {
          "description": "file_invalid: why the change, or a picture, was refused. Open: path | text | size | skill | skills | count | type.",
          "type": "string"
        },
        "paths": {
          "description": "file_exists from an add: every path of the request where a file is and `replace` was not set, all at once, so the person can be asked once. publish_conflict: the files someone published changes to the same lines of.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "publishers": {
          "description": "publish_conflict: who published those changes, by name.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "code"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

## Authentication

```json
{
  "bearerAuth": {
    "type": "http",
    "scheme": "bearer"
  }
}
```
