> For the complete documentation index, see [llms.txt](https://docs.kick.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kick.co/ai/cli/cli-use-case-library/investigation.md).

# Investigation

Kick CLI scripts for checking changes: review recent category edits, and inspect a transaction before applying a confirmed update.

Use these scripts to see what changed before you change anything else. The update script stops at a preview until you rerun it with the confirmation token.

<details>

<summary><strong>Review recent category changes</strong> (read)</summary>

To see what changed on transactions before you adjust anything else, list recent activity filtered to category updates.

**The Script**

```bash
#!/bin/bash
# review-category-activity.sh

WORKSPACE_ID="<workspace-id>"

kick --workspace "$WORKSPACE_ID" activity list \
  --resource-type transaction \
  --changed-fields categoryId \
  --limit 25 \
  --output json | jq .
```

**How to Customize**

* Add `--entity-ids` when you only care about one entity
* Pipe to a file for audit records: `> category-activity-$(date +%Y%m%d).json`

**What It Outputs**

* JSON activity rows showing recent transaction category changes

</details>

<details>

<summary><strong>Inspect a transaction before updating it</strong> (read, then write)</summary>

To review one transaction and apply a change, fetch it first. Updates require a payload file and preview confirmation. The first run only previews the update; rerun the script with the preview's `confirmationToken` to apply it.

**The Script**

```bash
#!/bin/bash
# inspect-and-update-transaction.sh
# First run: ./inspect-and-update-transaction.sh
# Second run: ./inspect-and-update-transaction.sh <confirmation-token>

WORKSPACE_ID="<workspace-id>"
TRANSACTION_ID=12345
PAYLOAD_FILE="transaction-update.json"
CONFIRMATION_TOKEN="${1:-}"

echo "Current transaction (read):"
kick --workspace "$WORKSPACE_ID" transactions get "$TRANSACTION_ID" --output json | jq .

if [ ! -f "$PAYLOAD_FILE" ]; then
  echo "Create $PAYLOAD_FILE with the fields you want to change, then re-run."
  exit 1
fi

if [ -z "$CONFIRMATION_TOKEN" ]; then
  echo ""
  echo "Preview update (no change yet):"
  kick --workspace "$WORKSPACE_ID" transactions update \
    --transaction-id "$TRANSACTION_ID" \
    --payload-file "$PAYLOAD_FILE" \
    --output json | jq .
  echo "To apply it, rerun: $0 <confirmationToken from the preview>"
else
  echo ""
  echo "Apply update (write):"
  kick --workspace "$WORKSPACE_ID" transactions update \
    --transaction-id "$TRANSACTION_ID" \
    --payload-file "$PAYLOAD_FILE" \
    --confirmation-token "$CONFIRMATION_TOKEN" \
    --output json | jq .
fi
```

**How to Customize**

* Put the fields to change in the payload file, for example `{"memo": "Owner reviewed"}`
* The token expires 45 minutes after the preview and only confirms the same transaction and payload. If you edit the payload file, run the preview again
* Check the change afterward with `kick --workspace "$WORKSPACE_ID" activity list --resource-type transaction --resource-id "$TRANSACTION_ID"`

**What It Outputs**

* Full transaction JSON from the read step
* On the first run, preview JSON with `preview.confirmationToken` (nothing changes yet)
* On the second run, the result of the applied update

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kick.co/ai/cli/cli-use-case-library/investigation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
