Skip to main content
The MAM API sends a mam.allocation.terminated event when an allocation has finished terminating. This event covers both customer-initiated unsubscriptions and automatic exits caused by the configured equity stop. Registering the webhook does not generate retroactive events. Only terminations completed after registration are delivered.

Events you will receive

For CLOSE_ON_UNSUBSCRIBE, the allocation can remain in STOPPING while copied positions are closed. The webhook is sent after termination completes, not when the process first starts.

Register the destination

The 201 response returns signing_secret in plain text only once. Store it immediately in a secrets manager.

Callback request example

ExuraCopy sends an HTTP POST to the registered URL with signed headers and a JSON body:
For an equity-stop termination, the relevant fields change as follows:
stop_loss_value is the configured threshold and trigger_equity is the equity observed when the stop was triggered. Either value can be null when the source could not provide it.

Signed headers

Validate the signature

Calculate the signature over the exact body bytes before deserializing JSON:
Compare in constant time and reject timestamps with a difference greater than five minutes.

Minimal callback handler

Respond and implement idempotency

  • Persist the event before responding.
  • Enforce uniqueness on event_id.
  • Respond quickly with any 2xx; 204 No Content is sufficient.
  • A repeated delivery retains the same event_id and payload.
  • Return 2xx for an event that was already stored, without repeating side effects.
Receiving mam.allocation.terminated reports a termination that has already been processed. It does not initiate or authorize an unsubscription.
Last modified on November 3, 2026