> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.finput.com.au/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.finput.com.au/_mcp/server.

# Preview what a delete would destroy

GET https://api.finput.com.au/api/v1/deletions/preview

For a client's own delete confirmation screen: the rows that would go, the links that would be broken, and the sentences to show. When `plan.blocked` is true the delete will be refused and the sentences are the refusal — render them and disable the button rather than letting the user find out on the `DELETE`.

Gated on the same permission the delete itself requires, so a caller cannot use the preview to learn about rows they could not delete. A row belonging to another organisation answers `404`, the same as one that does not exist. Works with an API token.

Reference: https://docs.finput.com.au/api/endpoints/deletions/preview-deletion

## Authentication

- `Authorization` header (bearer token, required) — JWT access token obtained from `POST /api/v1/auth/login`, or a `finput_sk_...` API token

## Request

### Query parameters

- `target` (enum, required) — What kind of row is being deleted.
  - Allowed values: `product`, `rate_bracket`, `uplift`, `approval`
- `id` (integer, required) — The row's id.

## Response

### 200

The plan and its sentences.

- `plan` (DeletePreviewPlan, optional)
- `summary_lines` (list of string, optional) — The sentences the delete modal renders — the refusal when blocked, the consequences when not.

## Errors

### 400 Bad Request Error

Unknown `target`, or `id` is not a row id.

- `error` (string, optional)
- `errors` (map from string to list of string, optional)

### 403 Forbidden Error

The caller lacks the delete permission for this target.

- `error` (string, optional)
- `errors` (map from string to list of string, optional)

### 404 Not Found Error

No such row for this caller.

- `error` (string, optional)
- `errors` (map from string to list of string, optional)

## Types

### DeletePreviewPlan

- `target` (enum, optional)
  - Allowed values: `product`, `rate_bracket`, `uplift`, `approval`
- `id` (integer, optional)
- `name` (string, optional, nullable)
- `organisation_id` (integer, optional, nullable)
- `blocked` (boolean, optional)
- `blockers` (list of DeletePreviewPlanBlockersItems, optional) — Present only when `blocked` is true.
- `removes` (map from string to integer, optional) — Row counts by kind, zero counts omitted. Present only when `blocked` is false.
- `unlinks` (map from string to any, optional)

### DeletePreviewPlanBlockersItems

- `name` (string, optional)
- `count` (integer, optional)
- `scope` (string, optional)

## Examples

**Response**

```json
{
  "plan": {
    "target": "product",
    "id": 1,
    "name": "string",
    "organisation_id": 1,
    "blocked": true,
    "blockers": [
      {
        "name": "string",
        "count": 1,
        "scope": "string"
      }
    ],
    "removes": {},
    "unlinks": {}
  },
  "summary_lines": [
    "string"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.finput.com.au/api/v1/deletions/preview"

querystring = {"id":"1","target":"product"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.finput.com.au/api/v1/deletions/preview?id=1&target=product';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.finput.com.au/api/v1/deletions/preview?id=1&target=product"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.finput.com.au/api/v1/deletions/preview?id=1&target=product")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.finput.com.au/api/v1/deletions/preview?id=1&target=product")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.finput.com.au/api/v1/deletions/preview?id=1&target=product', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.finput.com.au/api/v1/deletions/preview?id=1&target=product");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.finput.com.au/api/v1/deletions/preview?id=1&target=product")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```