Erasing caller data

Feature set: Inference Contact our support for access.
This functionality evolves quickly, the behavior and APIs might change between releases without further notice.

Erasing a caller removes the identifier that the Akka Optimize portfolio service holds for a caller of your models. Run it as part of answering a request to delete an identifier that can be tied to a person, such as an IP address. Every spend figure stays the same after an erasure. Capture artifacts that the gateway router recorded, and the records derived from them, still hold the identifier; see What an erasure changes.

Before you begin

The commands on this page call the portfolio service of your Akka Optimize deployment. Before you run them:

  • Log in with the Akka CLI. The commands send the access token of your current context.

  • Set the PORTFOLIO_URL environment variable to the address of the portfolio service. Your Akka team provides it. The --url flag does not apply to these commands, and --region is refused.

Erasing a caller, including a dry run, needs delete access to the Akka Optimize portfolio.

Callers

A caller is the identifier that spend figures are attributed to, together with the source that named it. That source is the basis:

  • declared: the request carried the x-optimize-caller header, and the caller is its value.

  • forwarded: a proxy reported the address of the client, and the caller is that address.

The same value under the two bases is two different callers.

To find the callers in a period, divide its spend by caller. See Read spend for a period.

akka optimize spend get --from 2026-09-15T00:00:00Z --to 2026-09-16T00:00:00Z --by caller

What an erasure changes

The portfolio service holds each caller value in one place. The records of the exchanges hold a key that refers to it. Erasing a caller deletes the value and changes nothing else:

  • The records keep their key, which then refers to nothing. No reported figure moves.

  • Spend divided by caller reports that group as one that the service no longer holds.

An erasure does not change the following:

  • Conversation identifiers. They expire with the records that hold them.

  • Capture artifacts that the gateway router recorded. They keep the request headers, including x-optimize-caller and the forwarded address.

  • Records derived from those captures. They keep the caller in optimize.caller and the x-optimize-* request headers in optimize.optimizeHeaders.

  • Traffic that arrives later. A request with the same value under the same basis creates the caller again. To stop that, stop the caller from being identified before the request reaches Akka: remove or replace the x-optimize-caller header, or the forwarded address.

The service also removes a caller by itself once every record that names it has expired.

An erasure cannot be undone. Nothing records which value was erased, and the erasure does not write the value to the service logs.

Erase a caller

  1. Check what the erasure reaches:

    akka optimize callers erase 203.0.113.7 --basis forwarded --dry-run
    Consequence          unrecoverable
    Held                 yes
    Committed            no
    Interaction records  1840
    Records cover        2026-09-01T00:00:00Z → 2026-09-15T16:00:00Z
    Dry run: "203.0.113.7" under basis forwarded is held and would be erased. Nothing was written.

    Held states whether the service holds this caller. Interaction records is the number of records in the portfolio service that name it, and the period they cover. The count can miss traffic that is recorded while the erasure runs.

  2. Erase it:

    akka optimize callers erase 203.0.113.7 --basis forwarded

    The command shows what the erasure reaches and asks you to type the value again to confirm. A value that does not match cancels the erasure.

A value that the service does not hold is not an error. The command reports that nothing was written and exits with status 0.

In a script, pass --force to erase without the question. --force does not run the dry run first. --disable-prompt does not confirm an erasure. Without --force, a script that cannot answer the question fails and erases nothing.

The features described in this section are an add-on to Akka Automated Operations. They are not included in the base product.