Guides
Webhooks

Webhooks

Subscribe to account, beneficiary and operation events and receive each change as a signed POST.

Instead of polling the API, you register an HTTPS URL and the simulator sends a JSON POST on every event: account onboarding, payment instruction reviews and operation changes.

The flow:

  1. Run a public HTTPS endpoint that accepts POST.
  2. Register the URL in a subscription, choosing resources and events.
  3. Verify each request's signature, process it and answer 2xx.
  4. Failures are retried (if you ask for it) and recorded as execution logs, which you can resend.

Create a subscription

bash
curl --request POST \
  --url https://trace.mimicr.dev/v1/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "url": "https://api.example.com/trace-webhooks",
    "resources": [
      { "name": "OPERATION", "includeAll": true },
      { "name": "BENEFICIARY", "events": ["BENEFICIARY_INSTRUCTION_APPROVED", "BENEFICIARY_INSTRUCTION_REJECTED"] }
    ],
    "allowRetry": true
  }'

The response is 201 with the id, companyId (the customer id) and the resolved resources, each resource with its full event list. To receive everything from every resource, send "includeAll": true at the top level, without resources.

RuleError
url must be public HTTPS400 INVALID_DATA INVALID_URL
Without includeAll, each resource needs events400 INVALID_DATA REQUIRED
Each name appears once400 INVALID_DATA DUPLICATE_RESOURCE
The event must belong to the resource400 INVALID_DATA INVALID_ENUM
Up to 10 subscriptions per customer422 SUBSCRIPTION_LIMIT_REACHED

allowRetry defaults to false. The limit of 10 and the INVALID_URL and DUPLICATE_RESOURCE codes are Mimicr's choices; Trace only says a limit exists. On this API X-Idempotency-Key is optional.

References: Create a subscription, List subscriptions, Get a subscription, Delete a subscription.

Update

PATCH changes only the fields you send. A new resources replaces the whole set.

bash
curl --request PATCH \
  --url https://trace.mimicr.dev/v1/subscriptions/<subscription-id> \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "url": "https://abc123.tunnel.example.com/trace-webhooks" }'

To stop retries without removing the subscription, send { "allowRetry": false }. Reference: Update a subscription.

Events

ResourceEvents
ACCOUNTACCOUNT_CREATED, ACCOUNT_ACTION_REQUIRED, ACCOUNT_ASSET_ACTIVATED, ACCOUNT_ASSET_FAILED
BENEFICIARYBENEFICIARY_INSTRUCTION_CREATED, BENEFICIARY_INSTRUCTION_APPROVED, BENEFICIARY_INSTRUCTION_REJECTED, BENEFICIARY_INSTRUCTION_ACTION_REQUIRED
OPERATIONOPERATION_REQUESTED, OPERATION_PROCESSING, OPERATION_ACTION_REQUIRED, OPERATION_COMPLETED, OPERATION_FAILED, OPERATION_REFUNDING, OPERATION_REFUNDED

Accounts only publish these four events; poll Get an account for the other transitions (REVIEWING, OPENING, ACTIVE).

The request you receive

Headers:

HeaderContent
X-Message-IdMessage UUID; the same across retries and resends
X-Company-IdCustomer id
X-Event-TypeEvent type, e.g. OPERATION_COMPLETED
X-Resource-NameACCOUNT, BENEFICIARY or OPERATION
X-Message-SignatureHex HMAC-SHA256 of messageId + "+" + clientId, with a literal + (see Verify the signature)

Body: the resource as GET returns it, with the new currentState, plus atTime, the moment of the event.

json
{
  "id": "e2606269-48cb-44be-8e6c-dc1559d3f4d4",
  "externalId": null,
  "customer": { "id": "dca5d593-82d4-4833-9d8a-54aa6829ac1a" },
  "sourceAmount": { "value": "1.00", "asset": "BRL", "decimals": 2 },
  "targetAmount": { "value": "1.00", "asset": "BRL", "decimals": 2 },
  "transactions": [
    { "id": "E18236120202611052012dee4de3e4e0", "direction": "CREDIT", "amount": { "value": "1.00", "asset": "BRL", "decimals": 2 }, "status": "CONFIRMED" }
  ],
  "currentState": { "status": "COMPLETED", "createdAt": "2026-11-05T20:12:32Z" },
  "intent": { "type": "DEPOSIT", "fundingInstruction": null },
  "atTime": "2026-11-05T20:12:32Z"
}
  • OPERATION: the full operation.
  • ACCOUNT: the full account. In Mimicr, ACCOUNT_ASSET_ACTIVATED and ACCOUNT_ASSET_FAILED also carry asset, the asset of the event.
  • BENEFICIARY: the full beneficiary plus instruction, the affected payment instruction.

The atTime field and the body matching GET are Mimicr's choices based on Trace's examples.

Any 2xx is a success. In Mimicr, the simulator waits up to 10 seconds for your response; answer fast and process afterwards.

Test in Mimicr

Events come from your own calls and from the other-side actions (see Testing in the sandbox). To avoid depending on your server during an automated test, wait for the delivery through the control API:

bash
npx mimicr wait trace delivery event=OPERATION_COMPLETED ref=<operation-id>
bash
curl --url 'https://api.mimicr.dev/v1/trace/wait?on=delivery&event=OPERATION_COMPLETED&ref=<operation-id>&timeout=30' \
  --header 'Authorization: Bearer mk_...'

The response carries the delivery with status, http_status, body and the attempts. ref is the id of the operation, account or beneficiary. Deliveries only exist if a subscription covers the event. The console's Webhooks tab shows the same history.

To receive them on your machine, expose your handler through an HTTPS tunnel and update the subscription URL.