Guides
Sandbox control
Mimicr's control API, CLI and MCP server to drive the other side, wait for events, move the clock and inject failures.
Trace's API only lets you act as the customer. To test end to end, Mimicr also lets you act as the other side: compliance, the QR payer, the Pix rail and the back office. All of it lives in the control API, at https://api.mimicr.dev/v1/trace, and the same commands exist in the console, the CLI and the MCP server.
Authentication
Use an organization API key (mk_…), created in the organization settings, "API keys" tab. Read keys can only query; actions, clock, chaos and reset need a write key.
curl --url https://api.mimicr.dev/v1/trace \ --header 'Authorization: Bearer mk_...'
With the CLI (Node 18+):
npx mimicr login mk_... npx mimicr status trace
The key can also come from --key or the MIMICR_API_KEY variable. Output is JSON and the exit code is 1 on an HTTP error.
Routes
| Method and path | Purpose |
|---|---|
GET /v1/trace | Sandbox state: host, credentials, customer, virtual Pix key, rates, toggles, chaos and clock |
POST /v1/trace/activate | Activates the organization's sandbox (201); if already active, 409 trace_already_active |
POST /v1/trace/reset | Deletes the test data; keeps credentials, rates and settings and returns the clock to real time |
POST /v1/trace/sweep | Runs the due automatic steps and pending deliveries now |
GET /v1/trace/wait | Waits until an object or a delivery shows up (long poll) |
GET /v1/trace/clock | Sandbox time (now) and offset (offset_ms) |
POST /v1/trace/clock/advance | Moves the clock forward and runs the steps that became due |
GET /v1/trace/objects | Lists sandbox objects |
GET /v1/trace/objects/{kind}/{id} | One object |
GET /v1/trace/deliveries | Lists webhook deliveries |
GET /v1/trace/deliveries/{id} | One delivery, with request_headers: the headers sent, including X-Message-Signature |
POST /v1/trace/deliveries/{id}/resend | Resends it as a new delivery |
GET /v1/trace/actions | Lists the actions and their parameters |
POST /v1/trace/actions/{id} | Runs an action |
GET /v1/trace/chaos | Chaos configuration per area |
PUT /v1/trace/chaos/{area} | Changes chaos for accounts, operations or beneficiaries |
PUT /v1/trace/homolog | Turns the automatic steps on or off |
PUT /v1/trace/rates | Price of 1 USDT and 1 USDC in BRL |
Control API errors use {"error": {...}} with lowercase codes (for example trace_not_active, unknown_action, action_failed, wait_timeout), unlike Trace's envelope.
Objects and deliveries
Objects are the sandbox's resources. kind is one of account, ubo, document, quote, operation, beneficiary, instruction or subscription; id is the same id as in Trace's API; parent links an instruction to its beneficiary, and a UBO or an operation to its account.
/objects filter | Example |
|---|---|
kind | kind=operation,instruction |
status | status=PROCESSING,ACTION_REQUIRED |
id | id=<operation-id> |
parent | parent=<account-id> |
since | since=2026-11-05T20:00:00Z (updated since) |
limit | 50 by default, up to 200 |
/deliveries filter | Example |
|---|---|
resource | resource=OPERATION |
event | event=OPERATION_COMPLETED,OPERATION_FAILED |
status | status=FAILED (PENDING, SUCCESS or FAILED) |
ref | ref=<operation, account or beneficiary id> |
since, limit | as above |
Filters accept several comma-separated values.
Wait
GET /v1/trace/wait answers as soon as something matches the filters, or 408 wait_timeout. Parameters: on (object or delivery), the filters above (at least one of id, parent, kind, status, event, resource and ref) and timeout in seconds (default 25, max 50). While waiting, the simulator runs the due steps.
curl --url 'https://api.mimicr.dev/v1/trace/wait?on=object&id=<operation-id>&status=COMPLETED&timeout=30' \ --header 'Authorization: Bearer mk_...'
npx mimicr wait trace object id=<operation-id> status=COMPLETED npx mimicr wait trace delivery event=OPERATION_COMPLETED ref=<operation-id> --timeout 50
Other-side actions
curl --request POST \
--url https://api.mimicr.dev/v1/trace/actions/deposit.pay \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "operationId": "<operation-id>" }'{
"ok": true,
"action": "deposit.pay",
"message": "Depósito COMPLETED: webhook OPERATION_COMPLETED enviado.",
"data": { "id": "<operation-id>", "type": "DEPOSIT", "status": "COMPLETED" }
}With the CLI: npx mimicr action trace deposit.pay operationId=<id> (true and false become booleans). An action that does not fit the current state answers 422 action_failed with the reason. Action messages are in Portuguese.
| Action | Parameters | Effect |
|---|---|---|
account.create_active | accountType (VIRTUAL default, NAMED, NAMED_NON_RESIDENT), legalName | Creates an ACTIVE account with BRL, USDT and USDC, no onboarding, in the sandbox customer's name |
account.approve | accountId (required), activateFiat (default true) | Compliance approves: documents and UBOs approved, crypto ACTIVE; with activateFiat, BRL ACTIVE and account ACTIVE |
account.reject_requirement | accountId, requirement (required), message | Sends back a document (by documentType) or an owner field; account in ACTION_REQUIRED, ACCOUNT_ACTION_REQUIRED |
account.reject | accountId (required), message | Rejects the account (REJECTED) |
account.fail_asset | accountId, asset (BRL, USDT, USDC) (required) | An asset in ONBOARDING becomes FAILED, ACCOUNT_ASSET_FAILED |
account.receive_pix | accountId, amount (required, e.g. 1000.00), payerName | Unrequested Pix to the account's key: COMPLETED deposit with quote: null |
account.receive_crypto | accountId, asset (USDT, USDC), amount (required, e.g. 250.000000) | Stablecoins received at the account's wallet: COMPLETED deposit with quote: null |
deposit.pay | operationId (required) | The payer pays the QR now (COMPLETED), including the 8.00 amount |
deposit.expire | operationId (required) | The QR expires unpaid (FAILED, QR_CODE_EXPIRED) |
operation.settle | operationId (required), force | Settles a withdrawal, swap or transfer, or takes a refund from REFUNDING to REFUNDED; force skips the .09 rule and chaos |
operation.fail | operationId (required), code (default PROCESSING_ERROR), message | The rail refuses: FAILED with the reason and the reserve released |
operation.require_document | operationId (required), documentType (FINANCIAL_CAPACITY default, INVOICE) | Compliance pauses an operation in PROCESSING: ACTION_REQUIRED, OPERATION_ACTION_REQUIRED |
instruction.approve | instructionId (required) | Approves a pending instruction, BENEFICIARY_INSTRUCTION_APPROVED |
instruction.reject | instructionId (required), message (default "An unknown error occurred.") | Rejects with COMPLIANCE_REJECTED |
instruction.require_document | instructionId (required), message | Asks (again) for the custody attestation of a CRYPTO instruction |
webhook.resend | logId (required), retry | Resends a delivery as a new log, with the same X-Message-Id; retry=true retries the same log |
Homologation toggles
All on by default.
curl --request PUT \
--url https://api.mimicr.dev/v1/trace/homolog \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "autoApproveAccounts": false, "autoSettleOperations": false }'| Toggle | When on |
|---|---|
autoApproveAccounts | Account review settles on its own |
autoPayDeposits | The QR is paid on its own (the 8.00 and 9.00 rules still apply) |
autoSettleOperations | Withdrawals, swaps, transfers and refunds advance on their own |
autoReviewInstructions | Payment instruction review settles on its own |
Or with the CLI: npx mimicr put /v1/trace/homolog autoPayDeposits=false.
Rates
curl --request PUT \
--url https://api.mimicr.dev/v1/trace/rates \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "USDT": "5.37" }'The value is the price of one unit in BRL, as a decimal string. USDT ↔ USDC is always 1:1.
Clock
curl --request POST \
--url https://api.mimicr.dev/v1/trace/clock/advance \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "hours": 24 }'The body accepts seconds, minutes, hours and days, added together, up to 400 days per call. The response is {now, offset_ms}. After the move, the due steps run right away. With the CLI: npx mimicr clock trace +30m, +2h or +1d.
Common uses:
- Expire a quote (30 s) and test
QUOTE_EXPIRED. - Expire the QR of an
8.00deposit (24 h). - Expire the token (23 h) and test
EXPIRED_ACCESS_TOKEN.
Reset returns the clock to real time.
Chaos
curl --request PUT \
--url https://api.mimicr.dev/v1/trace/chaos/operations \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true, "apiErrorRate": 20, "apiErrorStatus": 503, "latencyMinMs": 500, "latencyMaxMs": 2000, "opsFailRate": 10, "opsFailCode": "PROCESSING_ERROR" }'| Field | Meaning |
|---|---|
enabled | Turns the area on or off |
apiErrorRate | % of calls that answer an error |
apiErrorStatus | 500, 503 or 429 |
apiErrorWhen | before (nothing is processed) or after (processes, then answers the error) |
latencyMinMs, latencyMaxMs | Extra latency, up to 20,000 ms |
opsFailRate, opsFailCode | % of operations that fail: on operations, PROCESSING_ERROR or INSUFFICIENT_BALANCE; on beneficiaries, COMPLIANCE_REJECTED; accounts has none |
webhookFailRate | % of deliveries whose first attempt fails |
webhookDuplicateRate | % of events delivered twice |
The areas cover /v1/accounts (accounts), /v1/beneficiaries (beneficiaries) and /v1/quotes, /v1/operations and /v1/reports (operations). The token endpoint and the Webhooks API are never affected. Fields you do not send keep their current value.
MCP server
Agents can use https://api.mimicr.dev/mcp (Streamable HTTP, same mk_… key). Its tools cover an overview, the reference, control API calls, simulated API calls, actions, waiting and moving the clock. npx mimicr mcp prints the command to connect it in Claude Code and the JSON for other clients.
End-to-end test example
npx mimicr reset trace ACCOUNT=$(npx mimicr action trace account.create_active | jq -r .data.id) npx mimicr action trace account.receive_pix accountId=$ACCOUNT amount=1000.00 # your app creates a quote and a withdrawal against https://trace.mimicr.dev and keeps the withdrawal id npx mimicr wait trace object id=<withdrawal-id> status=COMPLETED