Skip to navigation

Requests, retries and idempotency

How to call the API so that a retry never creates a duplicate.

Networks fail. The rules below let you retry any request without charging twice, creating a second verification or recording a second decision.

Idempotency

The two contracts identify a repeated request differently.

Send your own unique value as metadata.requestId when you create a verification.

{
"country": "NG",
"idType": "bvn",
"idNumber": "00000000001",
"metadata": { "requestId": "order_1001", "userId": "user_42" }
}
  • A repeat with the same requestId returns the original verification with 200. No new verification is created and nothing is charged again.
  • Use a value tied to your own business action, such as an order or application ID, so that a retry after a crash still carries it.
  • One-off checks accept a top-level requestId with the same behaviour.
  • Sessions are keyed by externalUserId: a returning customer resumes their existing attempt.

What is safe to retry

SituationRetry?How
GET request failed or timed outYesRetry as is.
Write with an idempotency key or requestId timed outYesResend the same body and key.
Write with no idempotency identity timed outNot blindlyRead the current state first, then decide.
429YesWait, then retry with increasing delays.
502, 503YesBack off, starting at a second and doubling, for a bounded number of attempts.
400, 401, 403, 404, 409, 422NoThe request will fail the same way. Fix it first.

A risk decision that could not be made is never an approval. If a transaction or activity call fails or times out, hold the action or apply your own fallback rule. Do not treat an error as ALLOW.

Pagination

FamilyStyleParameters
Risk IntelligenceCursorlimit (1 to 100, default 50) and cursor. Pass the cursor from the previous page until none is returned.
Identity verification listsPage numberpage and pageSize (up to 100). The response carries the total.

A few Risk Intelligence list endpoints are page-numbered instead; their reference pages say so.

Request IDs

On /api/v1 you may send X-Request-Id (up to 128 characters) to correlate a call with your own logs. Every /api/v1 error returns a request_id. Quote it when you contact support.

Versioning

Versioning applies to the Risk Intelligence and Trust endpoints under /api/v1: wallet and transaction screenings, risk assessments, monitoring, transactions, crypto, activities, cases, signals, alerts, webhooks, risk intelligence and /api/v1/versions. These are the responses that carry X-Myaza-API-Version. The identity verification endpoints under /api/v1 (/verify, /verifications, /config, /checks, /upload, /sessions and the rest) do not read the version headers and do not return them.

  • The current API version is v2. Pin it with the optional request header Toden-Version: v2; leave the header out to use the current version. The /api/v1 in the URL is the base path, not the API version, and does not change.
  • 2026-08-11 is v2’s identifier and keeps working as an alias: Toden-Version: 2026-08-11 means the same as Toden-Version: v2. Signed webhook envelopes carry "version": "2026-08-11" for the same reason.
  • Each of these responses names the version that answered in the Toden-Version: v2 response header, beside X-Myaza-API-Version: v1, which names the base path and is unchanged. Browser callers can read Toden-Version.
  • Myaza-Version, the header’s earlier name, keeps working with the same values. If you send both headers they must name the same version, or the request is refused with 400 conflicting_api_version. On these endpoints an unknown version is refused with 400 unsupported_api_version, which lists the accepted values.
  • GET /api/v1/versions lists the versions this API accepts.
  • Additive changes are not breaking: new optional response fields, new endpoints, new webhook event types. Write clients that ignore what they do not recognise.
  • A new enum value can still break a client that matches exhaustively. Always include a default branch.
  • Removing or renaming a field, making an optional field required, or changing what a field means requires a new version.