{"openapi":"3.1.0","info":{"title":"Unibid API","version":"1.0.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Bearer"},"guestCookie":{"type":"apiKey","in":"cookie","name":"unibid_guest","description":"Guest session cookie; also send Authorization: Bearer guest."},"externalLeadKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"All /ext/lead endpoints require x-api-key only when INCOMING_LEADS_API_KEY is configured; otherwise access is unauthenticated. CORS preflight OPTIONS does not require a key."}},"schemas":{"PartnerAttribution":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"]},"PartnerAttributionInput":{"type":"object","properties":{"partnerId":{"type":"string","format":"uuid"}},"required":["partnerId"]},"RegistrationInput":{"type":"object","properties":{"jurisdiction":{"type":"string","enum":["AR","BR"],"default":"AR"},"attributionToken":{"type":"string","minLength":1}}},"Instrument":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"symbol":{"type":"string","minLength":1},"category":{"type":"string","enum":["Forex","Metals","Crypto"]},"precision":{"type":"integer","minimum":0},"payoutBps":{"type":"integer","minimum":0,"maximum":10000},"available":{"type":"boolean"}},"required":["id","symbol","category","precision","payoutBps","available"]},"ApiError":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]},"Account":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["DEMO","REAL"]},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"paymentAvailability":{"type":"object","properties":{"depositsAvailable":{"type":"boolean"},"withdrawalsAvailable":{"type":"boolean"}},"required":["depositsAvailable","withdrawalsAvailable"]},"operationsAllowed":{"type":"boolean"},"market":{"type":"object","properties":{"minimumStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumUiStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"suggestedStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"stakeStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMarginStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMinimumMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdSuggestedMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumDeposit":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumWithdrawal":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"initialDemoBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"depositPresets":{"type":"array","items":{"type":"number"}},"depositMethods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"withdrawalMethods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}}},"required":["minimumStake","minimumUiStake","suggestedStake","stakeStep","minimumDeposit","minimumWithdrawal","depositPresets","depositMethods","withdrawalMethods"]},"balance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"lockedBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusWithdrawalReserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["id","type","jurisdiction","currency","balance","lockedBalance"]},"PaymentMethod":{"type":"string","enum":["MERCADO_PAGO","BANK_TRANSFER","PIX"]},"Accounts":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["DEMO","REAL"]},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"paymentAvailability":{"type":"object","properties":{"depositsAvailable":{"type":"boolean"},"withdrawalsAvailable":{"type":"boolean"}},"required":["depositsAvailable","withdrawalsAvailable"]},"operationsAllowed":{"type":"boolean"},"market":{"type":"object","properties":{"minimumStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumUiStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"suggestedStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"stakeStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMarginStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMinimumMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdSuggestedMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumDeposit":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumWithdrawal":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"initialDemoBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"depositPresets":{"type":"array","items":{"type":"number"}},"depositMethods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"withdrawalMethods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}}},"required":["minimumStake","minimumUiStake","suggestedStake","stakeStep","minimumDeposit","minimumWithdrawal","depositPresets","depositMethods","withdrawalMethods"]},"balance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"lockedBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusWithdrawalReserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["id","type","jurisdiction","currency","balance","lockedBalance"]},"minItems":1}},"required":["items"]},"Candle":{"type":"object","properties":{"instrumentId":{"type":"string","format":"uuid"},"interval":{"type":"string","enum":["1s","5s","10s","15s","30s","1m","5m","15m","30m","1h","4h","1d"]},"startAt":{"type":"string","format":"date-time"},"bid":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"ask":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["instrumentId","interval","startAt","open","high","low","close"]},"CandlePage":{"type":"object","properties":{"historyRevision":{"type":"string","pattern":"^\\d+$"},"items":{"type":"array","items":{"type":"object","properties":{"instrumentId":{"type":"string","format":"uuid"},"interval":{"type":"string","enum":["1s","5s","10s","15s","30s","1m","5m","15m","30m","1h","4h","1d"]},"startAt":{"type":"string","format":"date-time"},"bid":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"ask":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["instrumentId","interval","startAt","open","high","low","close"]}},"nextBefore":{"type":["string","null"],"format":"date-time"}},"required":["items","nextBefore"]},"MarketTick":{"type":"object","properties":{"historyOnly":{"type":"boolean"},"sequence":{"type":"string","pattern":"^-?\\d+$"},"instrumentId":{"type":"string","format":"uuid"},"referencePrice":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"bid":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"ask":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"providerTimestamp":{"type":"string","format":"date-time"},"isSynthetic":{"type":"boolean"},"timelineAt":{"type":"string","format":"date-time"},"sourceReceivedAt":{"type":"string","format":"date-time"},"carried":{"type":"boolean"},"kind":{"type":"string","enum":["quote","confirmation"]},"generation":{"type":"string"},"runFrom":{"type":"string","format":"date-time"}},"required":["sequence","instrumentId","referencePrice","providerTimestamp"]},"MarketTickPage":{"type":"object","properties":{"historyRevision":{"type":"string","pattern":"^\\d+$"},"items":{"type":"array","items":{"type":"object","properties":{"historyOnly":{"type":"boolean"},"sequence":{"type":"string","pattern":"^-?\\d+$"},"instrumentId":{"type":"string","format":"uuid"},"referencePrice":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"bid":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"ask":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"providerTimestamp":{"type":"string","format":"date-time"},"isSynthetic":{"type":"boolean"},"timelineAt":{"type":"string","format":"date-time"},"sourceReceivedAt":{"type":"string","format":"date-time"},"carried":{"type":"boolean"},"kind":{"type":"string","enum":["quote","confirmation"]},"generation":{"type":"string"},"runFrom":{"type":"string","format":"date-time"}},"required":["sequence","instrumentId","referencePrice","providerTimestamp"]}},"nextCursor":{"type":["string","null"]},"frontier":{"type":["object","null"],"properties":{"sequence":{"type":"string"},"generation":{"type":"string"},"timelineAt":{"type":"string","format":"date-time"},"runFrom":{"type":"string","format":"date-time"}},"required":["sequence","generation","timelineAt","runFrom"]}},"required":["items","nextCursor"]},"MarketScheduleResponse":{"type":"object","properties":{"historyRevisions":{"type":"object","additionalProperties":{"type":"string","pattern":"^\\d+$"}},"retention":{"type":"object","properties":{"ticksMs":{"type":"integer","exclusiveMinimum":0},"secondsMs":{"type":"integer","exclusiveMinimum":0},"minutesMs":{"type":"integer","exclusiveMinimum":0}},"required":["ticksMs","secondsMs","minutesMs"]},"evaluatedAt":{"type":"string","format":"date-time"},"refreshAt":{"type":["string","null"],"format":"date-time"},"items":{"type":"array","items":{"type":"object","properties":{"instrumentId":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["OPEN","CLOSED"]},"reason":{"type":["string","null"],"enum":["WEEKEND","PROVIDER",null]},"nextTransition":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["OPEN","CLOSED"]},"at":{"type":"string","format":"date-time"}},"required":["state","at"]}},"required":["instrumentId","state","reason","nextTransition"]}}},"required":["evaluatedAt","refreshAt","items"]},"Trade":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"instrumentId":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["CALL","PUT"]},"stake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"payoutBps":{"type":"integer","minimum":0,"maximum":10000},"openingPrice":{"type":["string","null"],"pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"openingProviderTimestamp":{"type":["string","null"],"format":"date-time"},"displayedAt":{"type":"string"},"openingTimelineAt":{"type":"string","format":"date-time"},"closingTimelineAt":{"type":"string","format":"date-time"},"acceptedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["PENDING","OPEN","WON","LOST","DRAW","VOID"]},"closingPrice":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"closingProviderTimestamp":{"type":"string","format":"date-time"},"settledAt":{"type":"string","format":"date-time"},"credit":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["id","accountId","instrumentId","direction","stake","payoutBps","openingPrice","openingProviderTimestamp","acceptedAt","expiresAt","status"]},"TradePage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"instrumentId":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["CALL","PUT"]},"stake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"payoutBps":{"type":"integer","minimum":0,"maximum":10000},"openingPrice":{"type":["string","null"],"pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"openingProviderTimestamp":{"type":["string","null"],"format":"date-time"},"displayedAt":{"type":"string"},"openingTimelineAt":{"type":"string","format":"date-time"},"closingTimelineAt":{"type":"string","format":"date-time"},"acceptedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["PENDING","OPEN","WON","LOST","DRAW","VOID"]},"closingPrice":{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"closingProviderTimestamp":{"type":"string","format":"date-time"},"settledAt":{"type":"string","format":"date-time"},"credit":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["id","accountId","instrumentId","direction","stake","payoutBps","openingPrice","openingProviderTimestamp","acceptedAt","expiresAt","status"]}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer","minimum":0}},"required":["items","nextCursor","total"]},"CreateTradeInput":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"instrumentId":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["CALL","PUT"]},"stake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"duration":{"type":"integer","minimum":30,"description":"Duration in seconds, at most retention.ticksMs / 1000 from the market schedule"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128},"displayedAt":{"type":"string","format":"date-time"}},"required":["accountId","instrumentId","direction","stake","duration","idempotencyKey","displayedAt"]},"PaymentOperation":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"id":{"type":"string","format":"uuid"},"providerOperationId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"paymentLinks":{"type":["object","null"],"properties":{"mercadoPago":{"type":"string","format":"uri"}},"required":["mercadoPago"]},"pixCode":{"type":["string","null"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"settledAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"withdrawalBonus":{"type":["object","null"],"properties":{"reserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"conditional":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"burned":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["reserved","conditional"]},"dni":{"type":["string","null"]},"cvu":{"type":["string","null"]},"alias":{"type":["string","null"]},"accountName":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"providerStatus":{"type":["string","null"]},"redirectUrl":{"type":["string","null"],"format":"uri"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["accountId","jurisdiction","currency","id","providerOperationId","kind","paymentMethod","paymentLinks","amount","settledAmount","status","providerStatus","redirectUrl","expiresAt","createdAt","updatedAt","completedAt"]},"PaymentHistoryEntry":{"anyOf":[{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"id":{"type":"string","format":"uuid"},"providerOperationId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"paymentLinks":{"type":["object","null"],"properties":{"mercadoPago":{"type":"string","format":"uri"}},"required":["mercadoPago"]},"pixCode":{"type":["string","null"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"settledAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"withdrawalBonus":{"type":["object","null"],"properties":{"reserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"conditional":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"burned":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["reserved","conditional"]},"dni":{"type":["string","null"]},"cvu":{"type":["string","null"]},"alias":{"type":["string","null"]},"accountName":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"providerStatus":{"type":["string","null"]},"redirectUrl":{"type":["string","null"],"format":"uri"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["accountId","jurisdiction","currency","id","providerOperationId","kind","paymentMethod","paymentLinks","amount","settledAmount","status","providerStatus","redirectUrl","expiresAt","createdAt","updatedAt","completedAt"]},{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["BONUS"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"status":{"type":"string","enum":["COMPLETED"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["accountId","jurisdiction","currency","id","kind","amount","status","createdAt","updatedAt"]}]},"PaymentOperationPage":{"type":"object","properties":{"pendingCount":{"type":"integer","minimum":0},"items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"id":{"type":"string","format":"uuid"},"providerOperationId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"paymentLinks":{"type":["object","null"],"properties":{"mercadoPago":{"type":"string","format":"uri"}},"required":["mercadoPago"]},"pixCode":{"type":["string","null"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"settledAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"withdrawalBonus":{"type":["object","null"],"properties":{"reserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"conditional":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"burned":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["reserved","conditional"]},"dni":{"type":["string","null"]},"cvu":{"type":["string","null"]},"alias":{"type":["string","null"]},"accountName":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"providerStatus":{"type":["string","null"]},"redirectUrl":{"type":["string","null"],"format":"uri"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["accountId","jurisdiction","currency","id","providerOperationId","kind","paymentMethod","paymentLinks","amount","settledAmount","status","providerStatus","redirectUrl","expiresAt","createdAt","updatedAt","completedAt"]},{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["BONUS"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"status":{"type":"string","enum":["COMPLETED"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["accountId","jurisdiction","currency","id","kind","amount","status","createdAt","updatedAt"]}]}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer","minimum":0}},"required":["pendingCount","items","nextCursor","total"]},"CreateDepositInput":{"type":"object","properties":{"acceptBonus":{"type":"boolean"},"promoCode":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"accountId":{"type":"string","format":"uuid"},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128},"dni":{"type":"string","minLength":8,"maxLength":8,"pattern":"^\\d+$"}},"required":["accountId","amount","idempotencyKey"]},"CreateWithdrawalInput":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128},"bonusQuote":{"type":"string","pattern":"^[a-f0-9]{64}$"},"cvu":{"type":"string","minLength":22,"maxLength":23,"pattern":"^\\d{22,23}$"}},"required":["accountId","amount","idempotencyKey","cvu"]},"AdminPartner":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"attributionWindowDays":{"type":"integer","minimum":1,"maximum":90},"clickCount":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","status","attributionWindowDays","clickCount","createdAt","updatedAt"]},"CreateAdminPartnerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"default":"ACTIVE"},"attributionWindowDays":{"type":"integer","minimum":1,"maximum":90,"default":30}},"required":["name"]},"UpdateAdminPartnerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"attributionWindowDays":{"type":"integer","minimum":1,"maximum":90}}},"PartnerMetricBucket":{"type":"string","enum":["hour","day","week","month"]},"PartnerMetricsSummary":{"type":"object","properties":{"trading":{"$ref":"#/components/schemas/TradingBreakdown"},"clicks":{"type":"integer","minimum":0},"registeredUsers":{"type":"integer","minimum":0},"depositorsCount":{"type":"integer","minimum":0},"depositCount":{"type":"integer","minimum":0},"totalDepositAmount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgDepositAmount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"tradeCount":{"type":"integer","minimum":0},"totalVolume":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgVolume":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"totalWin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"totalLoss":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgWin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgLoss":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"winRate":{"type":"string","pattern":"^(?:0(?:\\.\\d+)?|1(?:\\.0+)?)$"},"avgTradeAmount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["clicks","registeredUsers","depositorsCount","depositCount","totalDepositAmount","avgDepositAmount","tradeCount","totalVolume","avgVolume","totalWin","totalLoss","avgWin","avgLoss","winRate","avgTradeAmount"]},"TradingBreakdown":{"type":"object","properties":{"all":{"$ref":"#/components/schemas/TradingMetricValues"},"options":{"$ref":"#/components/schemas/TradingMetricValues"},"cfd":{"$ref":"#/components/schemas/TradingMetricValues"}},"required":["all","options","cfd"]},"TradingMetricValues":{"type":"object","properties":{"openedCount":{"type":"integer","minimum":0},"closedCount":{"type":"integer","minimum":0},"activeTraders":{"type":"integer","minimum":0},"activeDays":{"type":"integer","minimum":0},"demoActiveDays":{"type":"integer","minimum":0},"overallActiveDays":{"type":"integer","minimum":0},"demoOpenedCount":{"type":"integer","minimum":0},"clientCashPnl":{"type":"string"},"platformCashPnl":{"type":"string"},"cashWins":{"type":"string"},"cashLosses":{"type":"string"},"averageCashWin":{"type":["string","null"]},"averageCashLoss":{"type":["string","null"]},"cashFunded":{"type":"string"},"bonusFunded":{"type":"string"},"averageAmount":{"type":["string","null"]},"notional":{"type":"string"},"weightedLeverage":{"type":["string","null"]},"closedFees":{"type":"string"},"profitableCount":{"type":"integer","minimum":0},"losingCount":{"type":"integer","minimum":0},"flatCount":{"type":"integer","minimum":0},"wonCount":{"type":"integer","minimum":0},"lostCount":{"type":"integer","minimum":0},"drawCount":{"type":"integer","minimum":0},"winRate":{"type":["string","null"]},"cashMarginPercent":{"type":["string","null"]},"profitableCloseRate":{"type":["string","null"]},"liquidationCount":{"type":"integer","minimum":0},"liquidationRate":{"type":["string","null"]},"averageHoldingSeconds":{"type":["number","null"]},"shortfall":{"type":"string"}},"required":["openedCount","closedCount","activeTraders","activeDays","demoActiveDays","overallActiveDays","demoOpenedCount","clientCashPnl","platformCashPnl","cashWins","cashLosses","averageCashWin","averageCashLoss","cashFunded","bonusFunded","averageAmount","notional","weightedLeverage","closedFees","profitableCount","losingCount","flatCount","wonCount","lostCount","drawCount","winRate","cashMarginPercent","profitableCloseRate","liquidationCount","liquidationRate","averageHoldingSeconds","shortfall"]},"PartnerMetricsSeriesItem":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time"},"trading":{"$ref":"#/components/schemas/TradingBreakdown"},"clicks":{"type":"integer","minimum":0},"registeredUsers":{"type":"integer","minimum":0},"depositorsCount":{"type":"integer","minimum":0},"depositCount":{"type":"integer","minimum":0},"totalDepositAmount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgDepositAmount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"tradeCount":{"type":"integer","minimum":0},"totalVolume":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgVolume":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"totalWin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"totalLoss":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgWin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"avgLoss":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"winRate":{"type":"string","pattern":"^(?:0(?:\\.\\d+)?|1(?:\\.0+)?)$"},"avgTradeAmount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["bucket","clicks","registeredUsers","depositorsCount","depositCount","totalDepositAmount","avgDepositAmount","tradeCount","totalVolume","avgVolume","totalWin","totalLoss","avgWin","avgLoss","winRate","avgTradeAmount"]},"PartnerMetrics":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"availableJurisdictions":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"partner":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["id","name"]},"range":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"bucket":{"$ref":"#/components/schemas/PartnerMetricBucket"}},"required":["from","to","bucket"]},"current":{"$ref":"#/components/schemas/TradingCurrent"},"summary":{"$ref":"#/components/schemas/PartnerMetricsSummary"},"series":{"type":"array","items":{"$ref":"#/components/schemas/PartnerMetricsSeriesItem"}}},"required":["currency","jurisdiction","availableJurisdictions","partner","range","summary","series"]},"TradingCurrent":{"type":"object","properties":{"asOf":{"type":"string"},"all":{"type":"object","properties":{"openCount":{"type":"integer","minimum":0},"cashAllocated":{"type":"string"},"bonusAllocated":{"type":"string"},"lastTradeAt":{"type":["string","null"]},"lastDemoTradeAt":{"type":["string","null"]}},"required":["openCount","cashAllocated","bonusAllocated","lastTradeAt","lastDemoTradeAt"]},"options":{"type":"object","properties":{"openCount":{"type":"integer","minimum":0},"cashAllocated":{"type":"string"},"bonusAllocated":{"type":"string"},"lastTradeAt":{"type":["string","null"]},"lastDemoTradeAt":{"type":["string","null"]}},"required":["openCount","cashAllocated","bonusAllocated","lastTradeAt","lastDemoTradeAt"]},"cfd":{"type":"object","properties":{"openCount":{"type":"integer","minimum":0},"cashAllocated":{"type":"string"},"bonusAllocated":{"type":"string"},"lastTradeAt":{"type":["string","null"]},"lastDemoTradeAt":{"type":["string","null"]},"pendingLiquidations":{"type":"integer","minimum":0},"cashPositionValue":{"type":["string","null"]},"unrealizedCashPnl":{"type":["string","null"]},"valuationAt":{"type":["string","null"]},"quoteFresh":{"type":"boolean"},"missingQuotes":{"type":"integer","minimum":0}},"required":["openCount","cashAllocated","bonusAllocated","lastTradeAt","lastDemoTradeAt","pendingLiquidations","cashPositionValue","unrealizedCashPnl","valuationAt","quoteFresh","missingQuotes"]}},"required":["asOf","all","options","cfd"]},"CrmOrganizationSummary":{"allOf":[{"$ref":"#/components/schemas/CrmOrganization"},{"type":"object","properties":{"managers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"memberCount":{"type":"integer","minimum":0}},"required":["managers","memberCount"]}]},"CrmOrganization":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"jurisdiction":{"type":"string","enum":["AR","BR"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","jurisdiction","createdAt","updatedAt"]},"CrmUserOption":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","operator","manager"]},"organizationId":{"type":["string","null"],"format":"uuid"},"organizationIds":{"type":"array","items":{"type":"string","format":"uuid"}},"accountAvailable":{"type":"boolean"}},"required":["id","name","role","organizationId","organizationIds","accountAvailable"]},"CrmOperator":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isAdmin":{"type":"boolean"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/CrmMembership"}},"membershipId":{"type":["string","null"],"format":"uuid"},"organizationId":{"type":["string","null"],"format":"uuid"},"role":{"type":"string","enum":["admin","operator","manager"]},"jurisdiction":{"type":["string","null"],"enum":["AR","BR",null]},"sip":{"type":["string","null"]},"phoneEnabled":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"},"staffUpdatedAt":{"type":"string","format":"date-time"}},"required":["id","name","isAdmin","memberships","membershipId","organizationId","role","jurisdiction","sip","phoneEnabled","updatedAt","staffUpdatedAt"]},"CrmMembership":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"staffId":{"type":"string"},"organizationId":{"type":"string","format":"uuid"},"organization":{"$ref":"#/components/schemas/CrmOrganization"},"role":{"type":"string","enum":["operator","manager"]},"jurisdiction":{"type":"string","enum":["AR","BR"]},"sip":{"type":["string","null"]},"phoneEnabled":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","staffId","organizationId","organization","role","jurisdiction","sip","phoneEnabled","updatedAt"]},"CrmStatistics":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/CrmPerformance"},"organizations":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/CrmPerformance"},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"jurisdiction":{"type":"string","enum":["AR","BR"]}},"required":["id","name","jurisdiction"]}]}},"operators":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/CrmPerformance"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"organizationId":{"type":"string","format":"uuid"},"currentMember":{"type":"boolean"}},"required":["id","name","organizationId","currentMember"]}]}}},"required":["summary","organizations","operators"]},"CrmPerformance":{"type":"object","properties":{"attempts":{"type":"integer"},"successful":{"type":"integer"},"answerRate":{"type":["number","null"]},"duration":{"type":"number"},"contacts":{"type":"integer"},"interested":{"type":"integer"}},"required":["attempts","successful","answerRate","duration","contacts","interested"]},"CrmUnreadEmails":{"type":"object","properties":{"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"subject":{"type":"string"},"sender":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"resource":{"type":"string","enum":["clients","leads"]},"contactId":{"type":"string","format":"uuid"},"contactName":{"type":"string"}},"required":["id","subject","sender","createdAt","resource","contactId","contactName"]}}},"required":["total","items"]},"CrmDuplicateContact":{"type":"object","properties":{"kind":{"type":"string","enum":["lead","client"]},"id":{"type":"string","format":"uuid"}},"required":["kind","id"]},"CrmEmailDetail":{"allOf":[{"$ref":"#/components/schemas/CrmEmailSummary"},{"type":"object","properties":{"html":{"type":"string"},"text":{"type":"string"},"replyTo":{"type":"string"},"inReplyToEmailId":{"type":["string","null"],"format":"uuid"},"omittedAttachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string"},"size":{"type":"number"}},"required":["id","name","type","size"]}}},"required":["html","text","replyTo","inReplyToEmailId","omittedAttachments","attachments"]}]},"CrmEmailSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["inbound","outbound"]},"senderName":{"type":"string"},"recipient":{"type":"string"},"sender":{"type":"string"},"subject":{"type":"string"},"status":{"type":"string","enum":["sending","accepted","deferred","delivered","bounced","dropped","failed","unconfirmed","received"]},"operatorId":{"type":["string","null"]},"operatorName":{"type":["string","null"]},"callId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","direction","senderName","recipient","sender","subject","status","operatorId","operatorName","callId","createdAt","updatedAt"]},"CrmMemberships":{"type":"object","properties":{"userId":{"type":"string"},"isAdmin":{"type":"boolean"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/CrmMembership"}},"activeCallOrganizationId":{"type":["string","null"],"format":"uuid"}},"required":["userId","isAdmin","memberships","activeCallOrganizationId"]},"CrmMe":{"type":"object","properties":{"phoneProvider":{"type":"string","enum":["zadarma","twilio"]},"email":{"type":"object","properties":{"enabled":{"type":"boolean"},"inboundEnabled":{"type":"boolean"},"sender":{"type":["string","null"]},"attachments":{"type":"boolean"}},"required":["enabled","inboundEnabled","sender","attachments"]},"id":{"type":"string"},"membershipId":{"type":["string","null"],"format":"uuid"},"organizationId":{"type":["string","null"],"format":"uuid"},"role":{"type":"string","enum":["admin","operator","manager"]},"jurisdiction":{"type":["string","null"],"enum":["AR","BR",null]},"sip":{"type":["string","null"]},"phoneEnabled":{"type":"boolean"},"organization":{"allOf":[{"$ref":"#/components/schemas/CrmOrganization"},{"type":["object","null"]}]}},"required":["phoneProvider","id","organizationId","role","jurisdiction","sip","phoneEnabled","organization"]},"CrmLeadSummary":{"allOf":[{"$ref":"#/components/schemas/CrmLead"},{"type":"object","properties":{"operatorName":{"type":["string","null"]},"lastCallAt":{"type":["string","null"],"format":"date-time"},"lastStatus":{"type":["string","null"]},"attempts":{"type":"number"}},"required":["operatorName","lastCallAt","lastStatus","attempts"]}]},"CrmLead":{"type":"object","properties":{"email":{"type":["string","null"]},"phoneNumber":{"type":"string","minLength":1,"maxLength":40},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"source":{"type":["string","null"]},"id":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","enum":["AR","BR"]},"assignedTo":{"type":["string","null"]},"clientStatus":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]},"followUpAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"linkedUserId":{"type":["string","null"],"format":"uuid"},"linkedAt":{"type":["string","null"],"format":"date-time"}},"required":["email","phoneNumber","firstName","lastName","source","id","jurisdiction","assignedTo","clientStatus","followUpAt","createdBy","createdAt","updatedAt","linkedUserId","linkedAt"]},"CrmLeadDetail":{"type":"object","properties":{"email":{"type":["string","null"]},"phoneNumber":{"type":"string","minLength":1,"maxLength":40},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"source":{"type":["string","null"]},"id":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","enum":["AR","BR"]},"assignedTo":{"type":["string","null"]},"clientStatus":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]},"followUpAt":{"type":["string","null"],"format":"date-time"},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"linkedUserId":{"type":["string","null"],"format":"uuid"},"linkedAt":{"type":["string","null"],"format":"date-time"},"operatorName":{"type":["string","null"]},"lastCallAt":{"type":["string","null"],"format":"date-time"},"historyAllowed":{"type":"boolean"},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"leadName":{"type":["string","null"]},"actorId":{"type":["string","null"]},"actorName":{"type":["string","null"]},"kind":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object","additionalProperties":{}}},"required":["id","userId","actorId","actorName","kind","createdAt","data"]}},"calls":{"type":"array","items":{"$ref":"#/components/schemas/CrmCall"}}},"required":["email","phoneNumber","firstName","lastName","source","id","jurisdiction","assignedTo","clientStatus","followUpAt","createdBy","createdAt","updatedAt","linkedUserId","linkedAt","operatorName","lastCallAt","historyAllowed","activity","calls"]},"CrmCall":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"clientName":{"type":["string","null"]},"leadName":{"type":["string","null"]},"operatorId":{"type":["string","null"]},"operatorName":{"type":["string","null"]},"jurisdiction":{"type":["string","null"],"enum":["AR","BR",null]},"destination":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"status":{"type":"string"},"duration":{"type":"number"},"outcome":{"type":["string","null"]},"note":{"type":"string"},"recordings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string","enum":["pending","stored","expired"]}},"required":["id","state"]}}},"required":["id","userId","clientName","operatorId","operatorName","jurisdiction","destination","startedAt","endedAt","status","duration","outcome","note","recordings"]},"CrmLeadImportResult":{"type":"object","properties":{"importId":{"type":"string","format":"uuid"},"total":{"type":"number"},"ready":{"type":"number"},"added":{"type":"number"},"duplicates":{"type":"number"},"errors":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"phone":{"type":"string"},"reason":{"type":"string"},"status":{"type":"string","enum":["ready","added","duplicate","error"]},"id":{"type":"string","format":"uuid"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"},"error":{"type":"string"}},"required":["row","phone","status"]}}},"required":["total","ready","added","duplicates","errors","rows"]},"CrmClient":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"jurisdiction":{"type":"string","enum":["AR","BR"]},"registeredAt":{"type":"string","format":"date-time"},"ftd_at":{"type":["string","null"],"format":"date-time"},"assignedTo":{"type":["string","null"]},"operatorName":{"type":["string","null"]},"followUpAt":{"type":["string","null"],"format":"date-time"},"clientStatus":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]},"lastOutcome":{"type":["string","null"]},"lastStatus":{"type":["string","null"]},"lastCallAt":{"type":["string","null"],"format":"date-time"},"attempts":{"type":"number"},"depositsAvailable":{"type":"boolean"}},"required":["id","status","firstName","lastName","phoneNumber","email","jurisdiction","registeredAt","ftd_at","assignedTo","operatorName","followUpAt","clientStatus","lastOutcome","lastStatus","lastCallAt","attempts","depositsAvailable"]},"CrmClientDetail":{"allOf":[{"$ref":"#/components/schemas/CrmClient"},{"type":"object","properties":{"historyAllowed":{"type":"boolean"},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"leadName":{"type":["string","null"]},"actorId":{"type":["string","null"]},"actorName":{"type":["string","null"]},"kind":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object","additionalProperties":{}}},"required":["id","userId","actorId","actorName","kind","createdAt","data"]}},"calls":{"type":"array","items":{"$ref":"#/components/schemas/CrmCall"}}},"required":["historyAllowed","activity","calls"]}]},"CrmClientFinanceSummary":{"type":"object","properties":{"trading":{"$ref":"#/components/schemas/TradingBreakdown"},"current":{"$ref":"#/components/schemas/TradingCurrent"},"tradingActivity":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"trading":{"$ref":"#/components/schemas/TradingBreakdown"}},"required":["date","trading"]}},"currency":{"type":"string"},"timezone":{"type":"string","enum":["UTC","Etc/GMT+3"]},"from":{"type":["string","null"]},"to":{"type":"string"},"deposits":{"type":"string"},"depositCount":{"type":"integer","minimum":0},"averageDeposit":{"type":"string"},"withdrawals":{"type":"string"},"withdrawalCount":{"type":"integer","minimum":0},"result":{"type":"string"},"wonCount":{"type":"integer","minimum":0},"lostCount":{"type":"integer","minimum":0},"drawCount":{"type":"integer","minimum":0},"winRate":{"type":["string","null"]},"tradeCount":{"type":"integer","minimum":0},"cashStake":{"type":"string"},"bonusStake":{"type":"string"},"averageStake":{"type":"string"},"activity":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"demo":{"type":"integer","minimum":0},"real":{"type":"integer","minimum":0}},"required":["date","demo","real"]}},"paymentActivity":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"deposits":{"type":"string"},"withdrawals":{"type":"string"},"depositCount":{"type":"integer","minimum":0},"withdrawalCount":{"type":"integer","minimum":0}},"required":["date","deposits","withdrawals","depositCount","withdrawalCount"]}},"activeDays":{"type":"integer","minimum":0},"demoActiveDays":{"type":"integer","minimum":0},"overallActiveDays":{"type":"integer","minimum":0},"balance":{"type":"string"},"bonusBalance":{"type":"string"},"openCount":{"type":"integer","minimum":0},"openStake":{"type":"string"},"openBonusStake":{"type":"string"},"pendingWithdrawalCount":{"type":"integer","minimum":0},"pendingWithdrawals":{"type":"string"},"failedDepositCount":{"type":"integer","minimum":0},"lastDepositAt":{"type":["string","null"]},"lastTradeAt":{"type":["string","null"]},"lastDemoTradeAt":{"type":["string","null"]}},"required":["currency","timezone","from","to","deposits","depositCount","averageDeposit","withdrawals","withdrawalCount","result","wonCount","lostCount","drawCount","winRate","tradeCount","cashStake","bonusStake","averageStake","activity","paymentActivity","activeDays","demoActiveDays","overallActiveDays","balance","bonusBalance","openCount","openStake","openBonusStake","pendingWithdrawalCount","pendingWithdrawals","failedDepositCount","lastDepositAt","lastTradeAt","lastDemoTradeAt"]},"CrmClientPayments":{"type":"object","properties":{"currency":{"type":"string"},"total":{"type":"integer","minimum":0},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"amount":{"type":"string"},"settledAmount":{"type":["string","null"]},"bonusAmount":{"type":"string"},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]}},"required":["id","kind","status","amount","settledAmount","bonusAmount","createdAt","completedAt"]}}},"required":["currency","total","items"]},"CrmClientCfdPositions":{"type":"object","properties":{"currency":{"type":"string"},"total":{"type":"integer"},"preferences":{"type":"object","properties":{"frequentInstrument":{"type":["string","null"]},"frequentDirection":{"type":["string","null"],"enum":["LONG","SHORT",null]},"frequentLeverage":{"type":["number","null"]}},"required":["frequentInstrument","frequentDirection","frequentLeverage"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"instrumentId":{"type":"string","format":"uuid"},"symbol":{"type":"string"},"direction":{"type":"string","enum":["LONG","SHORT"]},"status":{"type":"string","enum":["OPEN","LIQUIDATION_PENDING","CLOSED"]},"margin":{"type":"string"},"cashMargin":{"type":"string"},"bonusMargin":{"type":"string"},"notional":{"type":"string"},"leverage":{"type":"number"},"openFee":{"type":"string"},"openingPrice":{"type":"string"},"closingPrice":{"type":["string","null"]},"liquidationPrice":{"type":["string","null"]},"openedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closeReason":{"type":["string","null"],"enum":["MANUAL","LIQUIDATION",null]},"cashPnl":{"type":["string","null"]},"cashPositionValue":{"type":["string","null"]},"valuationAt":{"type":["string","null"]},"quoteFresh":{"type":"boolean"}},"required":["id","instrumentId","symbol","direction","status","margin","cashMargin","bonusMargin","notional","leverage","openFee","openingPrice","closingPrice","liquidationPrice","openedAt","closedAt","closeReason","cashPnl","cashPositionValue","valuationAt","quoteFresh"]}}},"required":["currency","total","preferences","items"]},"CrmClientTrades":{"type":"object","properties":{"currency":{"type":"string"},"total":{"type":"integer","minimum":0},"preferences":{"type":"object","properties":{"frequentInstrument":{"type":["string","null"]},"frequentDurationSeconds":{"type":["number","null"]},"frequentDirection":{"type":["string","null"],"enum":["CALL","PUT",null]}},"required":["frequentInstrument","frequentDurationSeconds","frequentDirection"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"symbol":{"type":"string"},"direction":{"type":"string","enum":["CALL","PUT"]},"status":{"type":"string","enum":["PENDING","OPEN","WON","LOST","DRAW","VOID"]},"stake":{"type":"string"},"result":{"type":["string","null"]},"acceptedAt":{"type":"string"},"durationSeconds":{"type":"number"}},"required":["id","symbol","direction","status","stake","result","acceptedAt","durationSeconds"]}}},"required":["currency","total","preferences","items"]},"CrmPhoneSession":{"oneOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["zadarma"]},"key":{"type":"string"},"sip":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["provider","key","sip","expiresAt"]},{"type":"object","properties":{"provider":{"type":"string","enum":["twilio"]},"token":{"type":"string"},"identity":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["provider","token","identity","expiresAt"]}]},"CrmOperatorOption":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","operator","manager"]},"jurisdiction":{"type":["string","null"],"enum":["AR","BR",null]},"organizationId":{"type":["string","null"],"format":"uuid"}},"required":["id","name","role","jurisdiction","organizationId"]},"CrmHistory":{"type":"object","properties":{"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"leadName":{"type":["string","null"]},"actorId":{"type":["string","null"]},"actorName":{"type":["string","null"]},"kind":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object","additionalProperties":{}}},"required":["id","userId","actorId","actorName","kind","createdAt","data"]}},"calls":{"type":"array","items":{"$ref":"#/components/schemas/CrmCall"}},"emails":{"type":"array","items":{"$ref":"#/components/schemas/CrmEmailSummary"}},"order":{"type":"array","items":{"type":"string"}},"nextCursor":{"type":["string","null"]}},"required":["activity","calls","emails","order","nextCursor"]},"CfdTerms":{"type":["object","null"],"properties":{"enabled":{"type":"boolean"},"leverage":{"type":"integer","minimum":1},"leverageStep":{"type":"integer","minimum":1,"maximum":100,"default":1},"openFeeBps":{"type":"integer","minimum":0,"maximum":10000},"maintenanceBps":{"type":"integer","minimum":1,"maximum":9999,"default":2000},"stressBps":{"type":"integer","minimum":1,"maximum":9999}},"required":["enabled","leverage","openFeeBps","stressBps"],"additionalProperties":false},"CfdQuote":{"type":["object","null"],"properties":{"instrumentId":{"type":"string","format":"uuid"},"generation":{"type":"string"},"sequence":{"type":"string"},"bid":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"ask":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"timelineAt":{"type":"string","format":"date-time"},"providerAt":{"type":"string","format":"date-time"},"receivedAt":{"type":"string","format":"date-time"},"provider":{"type":"string","enum":["REPLAY","TIINGO","MASSIVE"]}},"required":["instrumentId","generation","sequence","bid","ask","providerAt","receivedAt","provider"]},"CfdPosition":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"},"instrumentId":{"type":"string","format":"uuid"},"bookId":{"type":"string","enum":["AR:DEMO","AR:REAL","BR:DEMO","BR:REAL"]},"direction":{"type":"string","enum":["LONG","SHORT"]},"status":{"type":"string","enum":["OPEN","LIQUIDATION_PENDING","CLOSED"]},"margin":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"notional":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"openingPrice":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"liquidationPrice":{"type":["string","null"],"pattern":"^-?\\d+(?:\\.\\d+)?$"},"openFee":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"termsVersion":{"type":"integer"},"terms":{"$ref":"#/components/schemas/CfdTerms"},"openingQuote":{"$ref":"#/components/schemas/CfdQuote"},"closingQuote":{"$ref":"#/components/schemas/CfdQuote"},"openedAt":{"type":"string","format":"date-time"},"closedAt":{"type":["string","null"],"format":"date-time"},"closingPrice":{"type":["string","null"],"pattern":"^-?\\d+(?:\\.\\d+)?$"},"closeReason":{"type":["string","null"],"enum":["MANUAL","LIQUIDATION",null]},"liquidationTriggeredAt":{"type":["string","null"],"format":"date-time"},"result":{"$ref":"#/components/schemas/CfdValuation"},"valuation":{"$ref":"#/components/schemas/CfdValuation"},"valuationPrice":{"type":["string","null"],"pattern":"^-?\\d+(?:\\.\\d+)?$"},"valuationAt":{"type":["string","null"],"format":"date-time"},"quoteFresh":{"type":"boolean"}},"required":["id","accountId","instrumentId","bookId","direction","status","margin","notional","openingPrice","openFee","termsVersion","terms","openingQuote","closingQuote","openedAt","closedAt","closingPrice","closeReason","liquidationTriggeredAt","result","valuation","valuationPrice","valuationAt","quoteFresh"]},"CfdValuation":{"type":["object","null"],"properties":{"grossPnl":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"equity":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"credit":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"shortfall":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"clientPnl":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"brokerPnl":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?$"},"liquidate":{"type":"boolean"}},"required":["grossPnl","equity","credit","shortfall","clientPnl","brokerPnl","liquidate"]},"WithdrawalQuote":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"quote":{"type":"string"},"reserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"conditional":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["accountId","jurisdiction","currency","amount","quote","reserved","conditional"]},"WithdrawalQuoteInput":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"}},"required":["accountId","amount"]},"MarketHistoryJob":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"actor":{"type":"string"},"status":{"type":"string","enum":["QUEUED","PREPARING","READY","APPLYING","COMPLETED","PARTIAL","FAILED","CANCELLED"]},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"previewVersion":{"type":"string","format":"uuid"},"cancelRequested":{"type":"boolean"},"error":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"instrumentId":{"type":"string","format":"uuid"},"symbol":{"type":"string"},"status":{"type":"string"},"checked":{"type":"number"},"gaps":{"type":"number"},"prepared":{"type":"number"},"applied":{"type":"number"},"skipped":{"type":"number"},"reason":{"type":["string","null"]}},"required":["instrumentId","symbol","status","checked","gaps","prepared","applied","skipped","reason"]}},"applyEnabled":{"type":"boolean"},"retention":{"type":"object","properties":{"ticksMs":{"type":"number"},"secondsMs":{"type":"number"},"minutesMs":{"type":"number"}},"required":["ticksMs","secondsMs","minutesMs"]}},"required":["id","actor","status","from","to","createdAt","updatedAt","previewVersion","cancelRequested","error","results","applyEnabled","retention"]},"MarketCalibrationRun":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["QUEUED","RUNNING","STOPPING","COMPLETED","CANCELLED","FAILED"]},"algorithmVersion":{"type":"number"},"actor":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"heartbeatAt":{"type":["string","null"],"format":"date-time"},"reason":{"type":["string","null"]},"durationMs":{"type":"number"},"maxAgeMs":{"type":["number","null"]}},"required":["id","status","algorithmVersion","actor","createdAt","startedAt","endedAt","heartbeatAt","reason","durationMs","maxAgeMs"]},"MarketCalibrationDetail":{"allOf":[{"$ref":"#/components/schemas/MarketCalibrationRun"},{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"instrumentId":{"type":"string","format":"uuid"},"snapshot":{"$ref":"#/components/schemas/MarketCalibrationSnapshot"},"metrics":{"$ref":"#/components/schemas/MarketCalibrationMetrics"},"updatedAt":{"type":["string","null"],"format":"date-time"},"appliedAt":{"type":["string","null"],"format":"date-time"},"appliedBy":{"type":["string","null"]},"restoredAt":{"type":["string","null"],"format":"date-time"}},"required":["instrumentId","snapshot","metrics","updatedAt","appliedAt","appliedBy","restoredAt"]}}},"required":["results"]}]},"MarketCalibrationSnapshot":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"symbol":{"type":"string"},"category":{"type":"string","enum":["Forex","Metals","Crypto"]},"providerSymbol":{"type":"string"},"sourceGrid":{"type":["string","null"]},"jumpFilterMode":{"type":"string","enum":["MIDPOINT","BID_ASK"]},"pipSize":{"type":"string"},"precision":{"type":"number"},"spreadFloor":{"type":["string","null"]},"jumpThreshold":{"type":["string","null"]},"spreadLimit":{"type":["string","null"]},"smoothingMedianWeightBps":{"type":"number"},"updatedAt":{"type":"string","format":"date-time"},"sourceId":{"type":"number"}},"required":["id","symbol","category","providerSymbol","pipSize","precision","spreadFloor","jumpThreshold","updatedAt","sourceId"]},"MarketCalibrationMetrics":{"type":["object","null"],"properties":{"v2":{"$ref":"#/components/schemas/MarketCalibrationV2"},"v3":{"$ref":"#/components/schemas/MarketCalibrationV3"},"symbol":{"type":"string"},"sourceId":{"type":"number"},"trainingQuotes":{"type":"number"},"validationQuotes":{"type":"number"},"outcomes":{"type":"object","additionalProperties":{"type":"number"}},"publishedQuotes":{"type":"number"},"sourceAgeP95Ms":{"type":["string","null"]},"acceptedGapP95Ms":{"type":["string","null"]},"acceptedGapMaxMs":{"type":["string","null"]},"trailingSilenceMs":{"type":["number","null"]},"spreadFloor":{"type":["string","null"]},"jumpThreshold":{"type":["string","null"]}},"required":["symbol","sourceId","trainingQuotes","validationQuotes","outcomes","publishedQuotes","sourceAgeP95Ms","acceptedGapP95Ms","acceptedGapMaxMs","trailingSilenceMs","spreadFloor","jumpThreshold"]},"MarketCalibrationV2":{"type":"object","properties":{"priceStep":{"type":"object","properties":{"method":{"type":"string","enum":["SIDE_CHANGE_P05"]},"estimate":{"type":["string","null"]},"minimumChanges":{"type":"number"},"bidChanges":{"type":"number"},"askChanges":{"type":"number"}},"required":["method","estimate","minimumChanges","bidChanges","askChanges"]},"input":{"type":"object","properties":{"observations":{"type":"number"},"trainingAdjacentMoves":{"type":"number"},"quoteGapP95Ms":{"type":["string","null"]},"quoteGapMaxMs":{"type":["string","null"]},"priceChangeGapP95Ms":{"type":["string","null"]},"priceChangeGapMaxMs":{"type":["string","null"]}},"required":["observations","trainingAdjacentMoves","quoteGapP95Ms","quoteGapMaxMs","priceChangeGapP95Ms","priceChangeGapMaxMs"]},"status":{"type":"string","enum":["RECOMMENDED","KEEP_CURRENT","INSUFFICIENT_DATA","REJECTED"]},"phase":{"type":"string","enum":["TRAINING","TUNING","HOLDOUT"]},"policy":{"type":"object","properties":{"version":{"type":"number","enum":[2]},"slotMs":{"type":"number"},"blockMs":{"type":"number"},"minimumSlots":{"type":"array","items":{"type":"number"}},"minimumActiveMinutes":{"type":"array","items":{"type":"number"}},"minimumConfirmedMoves":{"type":"number"},"minimumNoiseImprovement":{"type":"number"},"additionalDelayMs":{"type":"number","enum":[0]},"eventWindowMs":{"type":"number"}},"required":["version","slotMs","blockMs","minimumSlots","minimumActiveMinutes","minimumConfirmedMoves","minimumNoiseImprovement","additionalDelayMs","eventWindowMs"]},"settings":{"type":["object","null"],"properties":{"spreadLimit":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"jumpThreshold":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"smoothingMedianWeightBps":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[5000]},{"type":"number","enum":[7500]}]}},"required":["spreadLimit","jumpThreshold","smoothingMedianWeightBps"]},"robust":{"type":["object","null"],"properties":{"spread":{"type":"object","properties":{"median":{"type":"string"},"mad":{"type":"string"},"scale":{"type":"string"}},"required":["median","mad","scale"]},"movement":{"type":"object","properties":{"median":{"type":"string"},"mad":{"type":"string"},"scale":{"type":"string"}},"required":["median","mad","scale"]},"resolution":{"type":"string"},"movementScale":{"type":"string"}},"required":["spread","movement","resolution","movementScale"]},"samples":{"type":"array","items":{"type":"object","properties":{"slots":{"type":"number"},"activeMinutes":{"type":"number"}},"required":["slots","activeMinutes"]}},"reasons":{"type":"array","items":{"type":"string"}},"tuning":{"type":["object","null"],"properties":{"baseline":{"$ref":"#/components/schemas/MarketCalibrationScores"},"candidate":{"$ref":"#/components/schemas/MarketCalibrationScores"}},"required":["baseline","candidate"]},"baseline":{"allOf":[{"$ref":"#/components/schemas/MarketCalibrationScores"},{"type":["object","null"]}]},"candidate":{"allOf":[{"$ref":"#/components/schemas/MarketCalibrationScores"},{"type":["object","null"]}]},"blocks":{"type":"array","items":{"type":"object","properties":{"block":{"type":"number"},"baseline":{"$ref":"#/components/schemas/MarketCalibrationScores"},"candidate":{"$ref":"#/components/schemas/MarketCalibrationScores"}},"required":["block","baseline","candidate"]}},"traces":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["movement","excursion"]},"points":{"type":"array","items":{"type":"object","properties":{"at":{"type":"number"},"raw":{"type":["string","null"]},"baseline":{"type":["string","null"]},"candidate":{"type":["string","null"]}},"required":["at","raw","baseline","candidate"]}}},"required":["kind","points"]}},"metricPriceUnit":{"type":"string"},"metricResolution":{"type":"number"}},"required":["input","status","phase","policy","settings","robust","samples","reasons","tuning","baseline","candidate","blocks","traces","metricPriceUnit","metricResolution"]},"MarketCalibrationScores":{"type":"object","properties":{"slots":{"type":"number"},"staleSlots":{"type":"number"},"sourceAgeP95Ms":{"type":["number","null"]},"acceptedAgeP95Ms":{"type":["number","null"]},"maxGapMs":{"type":"number"},"confirmedMoves":{"type":"number"},"missedMoves":{"type":"number"},"responseP95Ms":{"type":["number","null"]},"slowerMoves":{"type":"number"},"worsePeaks":{"type":"number"},"excursions":{"type":"number"},"peakAmplitude":{"type":["number","null"]},"peakDurationMs":{"type":"number"},"noise":{"type":["number","null"]},"quietSlots":{"type":"number"},"trackingP95":{"type":["number","null"]},"bias":{"type":["number","null"]}},"required":["slots","staleSlots","sourceAgeP95Ms","acceptedAgeP95Ms","maxGapMs","confirmedMoves","missedMoves","responseP95Ms","slowerMoves","worsePeaks","excursions","peakAmplitude","peakDurationMs","noise","quietSlots","trackingP95","bias"]},"MarketCalibrationV3":{"type":"object","properties":{"priceStep":{"type":"object","properties":{"method":{"type":"string","enum":["SIDE_CHANGE_P05"]},"estimate":{"type":["string","null"]},"minimumChanges":{"type":"number"},"bidChanges":{"type":"number"},"askChanges":{"type":"number"}},"required":["method","estimate","minimumChanges","bidChanges","askChanges"]},"input":{"type":"object","properties":{"observations":{"type":"number"},"trainingAdjacentMoves":{"type":"number"},"quoteGapP95Ms":{"type":["string","null"]},"quoteGapMaxMs":{"type":["string","null"]},"priceChangeGapP95Ms":{"type":["string","null"]},"priceChangeGapMaxMs":{"type":["string","null"]}},"required":["observations","trainingAdjacentMoves","quoteGapP95Ms","quoteGapMaxMs","priceChangeGapP95Ms","priceChangeGapMaxMs"]},"status":{"type":"string","enum":["RECOMMENDED","PARTIAL_IMPROVEMENT","KEEP_CURRENT","NO_VALID_CANDIDATE","INSUFFICIENT_DATA"]},"phase":{"type":"string","enum":["TRAINING","TUNING","HOLDOUT"]},"policy":{"type":"object","properties":{"version":{"type":"number","enum":[3]},"slotMs":{"type":"number"},"blockMs":{"type":"number"},"minimumSlots":{"type":"array","items":{"type":"number"}},"minimumActiveMinutes":{"type":"array","items":{"type":"number"}},"minimumConfirmedMoves":{"type":"number"},"minimumNoiseImprovement":{"type":"number"},"additionalDelayMs":{"type":"number","enum":[1000]},"eventWindowMs":{"type":"number"},"maximumResponseP95Ms":{"type":"number"},"maximumAcceptedAgeP95Ms":{"type":"number"},"minimumQuietSlots":{"type":"number"},"maximumCandidates":{"type":"number"}},"required":["version","slotMs","blockMs","minimumSlots","minimumActiveMinutes","minimumConfirmedMoves","minimumNoiseImprovement","additionalDelayMs","eventWindowMs","maximumResponseP95Ms","maximumAcceptedAgeP95Ms","minimumQuietSlots","maximumCandidates"]},"settings":{"type":["object","null"],"properties":{"spreadLimit":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"jumpThreshold":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"smoothingMedianWeightBps":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[5000]},{"type":"number","enum":[7500]}]},"jumpFilterMode":{"type":"string","enum":["MIDPOINT","BID_ASK"]},"pipSize":{"type":"string","pattern":"^(?:10{0,17}|0\\.0{0,17}1)$"},"precision":{"type":"integer","minimum":0,"maximum":18}},"required":["spreadLimit","jumpThreshold","smoothingMedianWeightBps","jumpFilterMode","pipSize","precision"]},"robust":{"type":["object","null"],"properties":{"spread":{"type":"object","properties":{"median":{"type":"string"},"mad":{"type":"string"},"scale":{"type":"string"}},"required":["median","mad","scale"]},"movement":{"type":"object","properties":{"median":{"type":"string"},"mad":{"type":"string"},"scale":{"type":"string"}},"required":["median","mad","scale"]},"resolution":{"type":"string"},"movementScale":{"type":"string"}},"required":["spread","movement","resolution","movementScale"]},"samples":{"type":"array","items":{"type":"object","properties":{"slots":{"type":"number"},"activeMinutes":{"type":"number"}},"required":["slots","activeMinutes"]}},"reasons":{"type":"array","items":{"type":"string"}},"tuning":{"type":["object","null"],"properties":{"baseline":{"$ref":"#/components/schemas/MarketCalibrationScores"},"candidate":{"$ref":"#/components/schemas/MarketCalibrationScores"}},"required":["baseline","candidate"]},"baseline":{"allOf":[{"$ref":"#/components/schemas/MarketCalibrationScores"},{"type":["object","null"]}]},"candidate":{"allOf":[{"$ref":"#/components/schemas/MarketCalibrationScores"},{"type":["object","null"]}]},"blocks":{"type":"array","items":{"type":"object","properties":{"block":{"type":"number"},"baseline":{"$ref":"#/components/schemas/MarketCalibrationScores"},"candidate":{"$ref":"#/components/schemas/MarketCalibrationScores"},"channels":{"type":"object","properties":{"baseline":{"type":"object","properties":{"bid":{"$ref":"#/components/schemas/MarketCalibrationScores"},"ask":{"$ref":"#/components/schemas/MarketCalibrationScores"},"spread":{"$ref":"#/components/schemas/MarketCalibrationScores"}},"required":["bid","ask","spread"]},"candidate":{"type":"object","properties":{"bid":{"$ref":"#/components/schemas/MarketCalibrationScores"},"ask":{"$ref":"#/components/schemas/MarketCalibrationScores"},"spread":{"$ref":"#/components/schemas/MarketCalibrationScores"}},"required":["bid","ask","spread"]}},"required":["baseline","candidate"]}},"required":["block","baseline","candidate","channels"]}},"traces":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["movement","excursion"]},"points":{"type":"array","items":{"type":"object","properties":{"at":{"type":"number"},"raw":{"type":["string","null"]},"baseline":{"type":["string","null"]},"candidate":{"type":["string","null"]}},"required":["at","raw","baseline","candidate"]}}},"required":["kind","points"]}},"metricPriceUnit":{"type":"string"},"metricResolution":{"type":"number"},"grid":{"type":"object","properties":{"grid":{"type":["string","null"]},"observedGrid":{"type":["string","null"]},"metadataGrid":{"type":["string","null"]},"provenance":{"type":"string","enum":["COINBASE_QUOTE_INCREMENT","OBSERVED_BLOCK_GRID","UNVERIFIED"]},"confidence":{"type":"string","enum":["METADATA_VALIDATED","EMPIRICAL","INSUFFICIENT"]},"pipSize":{"type":["string","null"]},"precision":{"type":["number","null"]},"observations":{"type":"number"},"stableBlocks":{"type":"number"},"mismatches":{"type":"number"},"limitation":{"type":"string"}},"required":["grid","observedGrid","metadataGrid","provenance","confidence","pipSize","precision","observations","stableBlocks","mismatches","limitation"]},"limitations":{"type":"array","items":{"type":"string"}},"channels":{"type":["object","null"],"properties":{"baseline":{"type":"object","properties":{"bid":{"$ref":"#/components/schemas/MarketCalibrationScores"},"ask":{"$ref":"#/components/schemas/MarketCalibrationScores"},"spread":{"$ref":"#/components/schemas/MarketCalibrationScores"}},"required":["bid","ask","spread"]},"candidate":{"type":"object","properties":{"bid":{"$ref":"#/components/schemas/MarketCalibrationScores"},"ask":{"$ref":"#/components/schemas/MarketCalibrationScores"},"spread":{"$ref":"#/components/schemas/MarketCalibrationScores"}},"required":["bid","ask","spread"]}},"required":["baseline","candidate"]},"confirmations":{"type":["object","null"],"properties":{"suspected":{"type":"number"},"confirmed":{"type":"number"},"returned":{"type":"number"},"expired":{"type":"number"},"maximumDelayMs":{"type":"number"}},"required":["suspected","confirmed","returned","expired","maximumDelayMs"]}},"required":["input","status","phase","policy","settings","robust","samples","reasons","tuning","baseline","candidate","blocks","traces","metricPriceUnit","metricResolution","grid","limitations","channels","confirmations"]}},"parameters":{}},"paths":{"/api/v1/admin/crm/organizations":{"get":{"operationId":"listCrmOrganizations","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrmOrganizationSummary"}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"post":{"operationId":"createCrmOrganization","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"jurisdiction":{"type":"string","enum":["AR","BR"]},"managerIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":100},"operatorIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100}},"required":["name","jurisdiction","managerIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOrganization"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/organizations/{id}":{"patch":{"operationId":"updateCrmOrganization","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"updatedAt":{"type":"string","format":"date-time"},"managerId":{"type":"string","minLength":1,"maxLength":200}},"required":["name","updatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOrganization"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"delete":{"operationId":"deleteCrmOrganization","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"updatedAt":{"type":"string","format":"date-time"}},"required":["updatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/users":{"get":{"operationId":"listCrmUsers","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"query","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrmUserOption"}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/organizations/{id}/operators":{"post":{"operationId":"addCrmOrganizationOperator","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":200}},"required":["userId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOperator"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/operators":{"get":{"operationId":"listCrmStaff","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"organizationId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrmOperator"}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/operators/refresh":{"post":{"operationId":"refreshCrmStaff","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrmOperator"}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/operators/{id}":{"patch":{"operationId":"updateCrmStaff","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneEnabled":{"type":"boolean"},"sip":{"type":["string","null"],"minLength":1,"maxLength":200},"role":{"type":"string","enum":["operator","manager"]},"organizationId":{"type":["string","null"],"format":"uuid"},"updatedAt":{"type":"string","format":"date-time"}},"required":["updatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOperator"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"delete":{"operationId":"deleteCrmStaff","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"updatedAt":{"type":"string","format":"date-time"}},"required":["updatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/operators/sips":{"get":{"operationId":"listCrmAvailableSips","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"staffId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/statistics":{"get":{"operationId":"getCrmStatistics","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"organizationId","in":"query"},{"schema":{"type":"string","enum":["AR","BR"]},"required":false,"name":"jurisdiction","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmStatistics"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/diagnostics":{"get":{"operationId":"getCrmDiagnostics","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["zadarma","twilio"]},"sync":{"type":["object","null"],"properties":{"id":{"type":"string"},"value":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","value","updatedAt"]},"unmatched":{"type":"number"},"unconfirmed":{"type":"number"},"recordings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"attempts":{"type":"number"},"lastError":{"type":["string","null"]},"nextAttemptAt":{"type":"string","format":"date-time"}},"required":["id","state","attempts","lastError","nextAttemptAt"]}}},"required":["provider","sync","unmatched","unconfirmed","recordings"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/twilio/numbers":{"get":{"operationId":"listCrmTwilioNumbers","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"sid":{"type":"string"},"phoneNumber":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"friendlyName":{"type":"string"},"source":{"type":"string","enum":["rented","verified"]}},"required":["sid","phoneNumber","friendlyName","source"]}}},"required":["configured","items"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/zadarma/inventory":{"get":{"operationId":"getCrmZadarmaInventory","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"numbers":{"type":"array","items":{"type":"object","properties":{"phoneNumber":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"name":{"type":"string"},"country":{"type":"string"},"status":{"type":"string"}},"required":["phoneNumber","name","country","status"]}},"extensions":{"type":"array","items":{"type":"object","properties":{"sip":{"type":"string","pattern":"^\\d+-\\d{3}$"},"name":{"type":"string"},"callerId":{"type":["string","null"]}},"required":["sip","name","callerId"]}}},"required":["configured","numbers","extensions"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/zadarma/caller-id":{"patch":{"operationId":"updateCrmZadarmaCallerId","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sip":{"type":"string","pattern":"^\\d+-\\d{3}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"previousCallerId":{"type":["string","null"]}},"required":["sip","callerId","previousCallerId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"sip":{"type":"string","pattern":"^\\d+-\\d{3}$"},"name":{"type":"string"},"callerId":{"type":["string","null"]}},"required":["sip","name","callerId"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/twilio/settings":{"get":{"operationId":"getCrmTwilioSettings","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"type":"object","properties":{"AR":{"type":["string","null"],"pattern":"^\\+[1-9]\\d{6,14}$"},"BR":{"type":["string","null"],"pattern":"^\\+[1-9]\\d{6,14}$"}},"required":["AR","BR"],"additionalProperties":false}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"patch":{"operationId":"updateCrmTwilioSettings","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"type":"object","properties":{"AR":{"type":["string","null"],"pattern":"^\\+[1-9]\\d{6,14}$"},"BR":{"type":["string","null"],"pattern":"^\\+[1-9]\\d{6,14}$"}},"required":["AR","BR"],"additionalProperties":false}},"required":["version","value"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"type":"object","properties":{"AR":{"type":["string","null"],"pattern":"^\\+[1-9]\\d{6,14}$"},"BR":{"type":["string","null"],"pattern":"^\\+[1-9]\\d{6,14}$"}},"required":["AR","BR"],"additionalProperties":false}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/crm/organizations/{organizationId}/members":{"get":{"operationId":"listCrmMembers","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"organizationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrmOperator"}}}}}}},"post":{"operationId":"addCrmMember","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"organizationId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneEnabled":{"type":"boolean"},"sip":{"type":["string","null"],"minLength":1,"maxLength":200},"role":{"type":"string","enum":["operator","manager"]},"staffId":{"type":"string","minLength":1,"maxLength":200}},"required":["role","staffId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOperator"}}}}}}},"/api/v1/admin/crm/organizations/{organizationId}/members/{staffId}":{"patch":{"operationId":"updateCrmMember","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"organizationId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"staffId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneEnabled":{"type":"boolean"},"sip":{"type":["string","null"],"minLength":1,"maxLength":200},"role":{"type":"string","enum":["operator","manager"]},"updatedAt":{"type":"string","format":"date-time"}},"required":["role","updatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOperator"}}}}}},"delete":{"operationId":"removeCrmMember","tags":["admin-crm"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"organizationId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"staffId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"updatedAt":{"type":"string","format":"date-time"}},"required":["updatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}}}}},"/api/v1/admin/incoming-leads":{"get":{"operationId":"listAdminIncomingLeads","tags":["admin-incoming-leads"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":25,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"beforeId","in":"query"}],"responses":{"200":{"description":"Received requests, newest first. Records retained for 30 days.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"receivedAt":{"type":"string","format":"date-time"},"ip":{"type":["string","null"]},"body":{"type":"string","description":"JSON text; preserves numeric precision"}},"required":["id","receivedAt","ip","body"]}},"nextCursor":{"type":["object","null"],"properties":{"receivedAt":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"}},"required":["receivedAt","id"]}},"required":["items","nextCursor"]}}}}}}},"/api/v1/admin/incoming-leads/config":{"get":{"operationId":"getAdminIncomingLeadsConfig","tags":["admin-incoming-leads"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Incoming lead settings","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"workerIntervalMs":{"type":"integer","minimum":1000,"maximum":3600000},"workerBatchSize":{"type":"integer","minimum":1,"maximum":1000},"maxBodyMb":{"type":"integer","minimum":1,"maximum":50},"postIpPerMinute":{"type":"integer","minimum":1,"maximum":10000},"postGlobalPerMinute":{"type":"integer","minimum":1,"maximum":10000}},"required":["workerIntervalMs","workerBatchSize","maxBodyMb","postIpPerMinute","postGlobalPerMinute"],"additionalProperties":false}},"required":["version","value"]}}}},"400":{"description":"Invalid settings"},"401":{"description":"Authentication required"},"403":{"description":"Access denied"},"409":{"description":"Settings changed; reload before saving"}}},"put":{"operationId":"updateAdminIncomingLeadsConfig","tags":["admin-incoming-leads"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"workerIntervalMs":{"type":"integer","minimum":1000,"maximum":3600000},"workerBatchSize":{"type":"integer","minimum":1,"maximum":1000},"maxBodyMb":{"type":"integer","minimum":1,"maximum":50},"postIpPerMinute":{"type":"integer","minimum":1,"maximum":10000},"postGlobalPerMinute":{"type":"integer","minimum":1,"maximum":10000}},"required":["workerIntervalMs","workerBatchSize","maxBodyMb","postIpPerMinute","postGlobalPerMinute"],"additionalProperties":false}},"required":["version","value"]}}}},"responses":{"200":{"description":"Incoming lead settings","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"workerIntervalMs":{"type":"integer","minimum":1000,"maximum":3600000},"workerBatchSize":{"type":"integer","minimum":1,"maximum":1000},"maxBodyMb":{"type":"integer","minimum":1,"maximum":50},"postIpPerMinute":{"type":"integer","minimum":1,"maximum":10000},"postGlobalPerMinute":{"type":"integer","minimum":1,"maximum":10000}},"required":["workerIntervalMs","workerBatchSize","maxBodyMb","postIpPerMinute","postGlobalPerMinute"],"additionalProperties":false}},"required":["version","value"]}}}},"400":{"description":"Invalid settings"},"401":{"description":"Authentication required"},"403":{"description":"Access denied"},"409":{"description":"Settings changed; reload before saving"}}}},"/ext/lead/list":{"get":{"tags":["External leads"],"security":[{"externalLeadKey":[]},{}],"summary":"List external lead statuses by receipt date","description":"All /ext/lead endpoints require x-api-key only when INCOMING_LEADS_API_KEY is configured; otherwise access is unauthenticated. CORS preflight OPTIONS does not require a key. IDs come from POST /ext/lead. Records retained for 30 days. Status is completed after the first completed deposit, invalid on validation failure, otherwise pending regardless of CRM status. UTC range is [start,end), at most 31 days. Without dates: current UTC day. With one date: a 24-hour window ending/starting at that date.","parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"start","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"end","in":"query"}],"responses":{"200":{"description":"Lead status","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["pending","invalid","completed"]},"ftd_at":{"type":["string","null"],"format":"date-time"},"id":{"type":"string","format":"uuid"}},"required":["status","ftd_at","id"]}}}}},"400":{"description":"Invalid ID or date range"},"401":{"description":"Missing or invalid x-api-key"},"404":{"description":"Lead not found"},"429":{"description":"Read rate exceeded (60 requests per minute)"},"503":{"description":"Temporarily unavailable"}}}},"/ext/lead/{id}":{"get":{"tags":["External leads"],"security":[{"externalLeadKey":[]},{}],"summary":"Get external lead status and first deposit","description":"All /ext/lead endpoints require x-api-key only when INCOMING_LEADS_API_KEY is configured; otherwise access is unauthenticated. CORS preflight OPTIONS does not require a key. IDs come from POST /ext/lead. Records retained for 30 days. Status is completed after the first completed deposit, invalid on validation failure, otherwise pending regardless of CRM status. UTC range is [start,end), at most 31 days. Without dates: current UTC day. With one date: a 24-hour window ending/starting at that date.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Lead status","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","invalid","completed"]},"ftd_at":{"type":["string","null"],"format":"date-time"},"id":{"type":"string","format":"uuid"}},"required":["status","ftd_at","id"]}}}},"400":{"description":"Invalid ID or date range"},"401":{"description":"Missing or invalid x-api-key"},"404":{"description":"Lead not found"},"429":{"description":"Read rate exceeded (60 requests per minute)"},"503":{"description":"Temporarily unavailable"}}}},"/ext/lead":{"post":{"tags":["External leads"],"security":[{"externalLeadKey":[]},{}],"summary":"Store an external lead payload","description":"All /ext/lead endpoints require x-api-key only when INCOMING_LEADS_API_KEY is configured; otherwise access is unauthenticated. CORS preflight OPTIONS does not require a key. Uncompressed non-empty JSON array. Configurable POST limits; default: 5 MiB total. Extra object fields are allowed and retained; CRM validation only checks mapped fields. Absent IDs are generated. An invalid supplied id yields invalid for that element, with id and receivedAt null; other elements are processed. Each input produces a result in input order: created, duplicate (same UUID and equal JSON values excluding id), conflict (same UUID with different data), or invalid (invalid supplied id). JSON key order and whitespace are ignored. Existing data is never overwritten; the first occurrence of a new UUID wins. New records are saved atomically. receivedAt is the original creation time for existing records. Default fixed windows: 30 requests per IP and 60 globally per 60-second window starting with the first request. No separate burst allowance. Retention: 30 days. Success only after database commit. Retries without a valid UUID create new records. UUID deduplication lasts only while the record is retained.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"description":"Optional UUID record key. Generated if absent; invalid values return result invalid for this element only."}},"additionalProperties":true}}}}},"responses":{"200":{"description":"Result for every input element","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"result":{"type":"string","enum":["created","duplicate","conflict"]},"receivedAt":{"type":"string","format":"date-time"},"ftd_at":{"type":"null"},"status":{"type":"string","enum":["pending"]}},"required":["id","result","receivedAt","ftd_at","status"]},{"type":"object","properties":{"id":{"type":"null"},"result":{"type":"string","enum":["invalid"]},"receivedAt":{"type":"null"},"ftd_at":{"type":"null"},"status":{"type":"string","enum":["pending"]}},"required":["id","result","receivedAt","ftd_at","status"]}]},"minItems":1}}}},"400":{"description":"Invalid array, batch size or unsupported JSONB value"},"401":{"description":"Missing or invalid x-api-key when INCOMING_LEADS_API_KEY is configured"},"413":{"description":"Array exceeds configured body size"},"415":{"description":"Unsupported content type, charset or encoding"},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry"}}},"503":{"description":"Limiter, database or capacity unavailable","headers":{"Retry-After":{"schema":{"type":"integer"}}}}}}},"/api/v1/support/session":{"get":{"operationId":"supportSession","tags":["support"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]},"unreadCount":{"type":"number"},"attachmentsEnabled":{"type":"boolean"},"maxImageBytes":{"type":"integer","exclusiveMinimum":0},"maxDocumentBytes":{"type":"integer","exclusiveMinimum":0},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"ownerId":{"type":"string","format":"uuid"},"blocked":{"type":"boolean"}},"required":["active","unreadCount","attachmentsEnabled","ownerKind","ownerId","blocked"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/chats":{"get":{"operationId":"listSupportChats","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"pageSize","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]}},"total":{"type":"number"}},"required":["items","total"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}},"post":{"operationId":"createSupportChat","tags":["support"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"body":{"type":"string","maxLength":10000},"meta":{"type":"object","properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"}},"required":["type","payment_id"]},"file":{"type":"string","format":"binary"},"image":{"type":"string","format":"binary"}},"required":["requestId","body"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]},"message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"chatId":{"type":"string","format":"uuid"},"seq":{"type":"number"},"author":{"type":"string","enum":["USER","SUPPORT"]},"authorId":{"type":"string"},"body":{"type":"string"},"meta":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"},"payment":{"type":"object","properties":{"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"currency":{"type":"string"},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]}},"required":["kind","amount","currency","status"]}},"required":["type","payment_id","payment"]},"hasAttachment":{"type":"boolean"},"attachmentType":{"type":["string","null"]},"attachmentName":{"type":["string","null"]},"attachmentSize":{"type":["number","null"]},"createdAt":{"type":"string"}},"required":["id","chatId","seq","author","authorId","body","hasAttachment","attachmentType","attachmentName","attachmentSize","createdAt"]}},"required":["chat","message"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/chats/{id}":{"get":{"operationId":"getSupportChat","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"after","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":false,"name":"before","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"chatId":{"type":"string","format":"uuid"},"seq":{"type":"number"},"author":{"type":"string","enum":["USER","SUPPORT"]},"authorId":{"type":"string"},"body":{"type":"string"},"meta":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"},"payment":{"type":"object","properties":{"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"currency":{"type":"string"},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]}},"required":["kind","amount","currency","status"]}},"required":["type","payment_id","payment"]},"hasAttachment":{"type":"boolean"},"attachmentType":{"type":["string","null"]},"attachmentName":{"type":["string","null"]},"attachmentSize":{"type":["number","null"]},"createdAt":{"type":"string"}},"required":["id","chatId","seq","author","authorId","body","hasAttachment","attachmentType","attachmentName","attachmentSize","createdAt"]}},"hasMore":{"type":"boolean"},"blocked":{"type":"boolean"}},"required":["chat","messages","hasMore","blocked"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/chats/{id}/messages":{"post":{"operationId":"sendSupportMessage","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"body":{"type":"string","maxLength":10000},"meta":{"type":"object","properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"}},"required":["type","payment_id"]},"file":{"type":"string","format":"binary"},"image":{"type":"string","format":"binary"}},"required":["requestId","body"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]},"message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"chatId":{"type":"string","format":"uuid"},"seq":{"type":"number"},"author":{"type":"string","enum":["USER","SUPPORT"]},"authorId":{"type":"string"},"body":{"type":"string"},"meta":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"},"payment":{"type":"object","properties":{"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"currency":{"type":"string"},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]}},"required":["kind","amount","currency","status"]}},"required":["type","payment_id","payment"]},"hasAttachment":{"type":"boolean"},"attachmentType":{"type":["string","null"]},"attachmentName":{"type":["string","null"]},"attachmentSize":{"type":["number","null"]},"createdAt":{"type":"string"}},"required":["id","chatId","seq","author","authorId","body","hasAttachment","attachmentType","attachmentName","attachmentSize","createdAt"]}},"required":["chat","message"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/chats/{id}/read":{"post":{"operationId":"readSupportChat","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer","minimum":0}},"required":["seq"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/chats/{id}/messages/{messageId}/attachment":{"get":{"operationId":"supportAttachment","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"messageId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresIn":{"type":"number"}},"required":["url","expiresIn"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/chats/{chatId}/payments/{id}":{"get":{"operationId":"getSupportPayment","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"chatId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"customerName":{"type":["string","null"]},"tradingAccountId":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"settledAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"currency":{"type":"string"},"jurisdiction":{"type":"string"},"paymentMethod":{"type":"string"},"providerOperationId":{"type":["string","null"]},"providerStatus":{"type":["string","null"]},"dni":{"type":["string","null"]},"cvu":{"type":["string","null"]},"alias":{"type":["string","null"]},"accountName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]}},"required":["id","userId","customerName","tradingAccountId","kind","status","amount","settledAmount","currency","jurisdiction","paymentMethod","providerOperationId","providerStatus","dni","cvu","alias","accountName","createdAt","updatedAt","completedAt","expiresAt"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/operators":{"get":{"operationId":"listSupportOperators","tags":["support"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/session":{"get":{"operationId":"supportStaffSession","tags":["support"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["support","admin"]},"attachmentsEnabled":{"type":"boolean"},"maxImageBytes":{"type":"integer","exclusiveMinimum":0},"maxDocumentBytes":{"type":"integer","exclusiveMinimum":0}},"required":["id","role","attachmentsEnabled"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/chats":{"get":{"operationId":"listSupportQueue","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["new","mine","all","closed"],"default":"new"},"required":false,"name":"view","in":"query"},{"schema":{"type":"string","maxLength":120,"default":""},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["assignedTo","waitingSince","ownerKind","updatedAt"],"default":"updatedAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sortDirection","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"conversation","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"customer","in":"query"},{"schema":{"type":"string","enum":["ACTIVE","BLOCKED"]},"required":false,"name":"customerStatus","in":"query"},{"schema":{"type":"string","enum":["PAYMENT","GENERAL"]},"required":false,"name":"topic","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"message","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"operator","in":"query"},{"schema":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["GUEST","ACCOUNT"]},"required":false,"name":"ownerKind","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"waitingFrom","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"updatedFrom","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"updatedTo","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]},"customerName":{"type":["string","null"]},"operatorName":{"type":["string","null"]},"closedByName":{"type":["string","null"]},"blocked":{"type":"boolean"},"topic":{"type":"string","enum":["PAYMENT","GENERAL"]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason","customerName","operatorName","closedByName","blocked","topic"]}},"total":{"type":"number"}},"required":["items","total"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/chats/{id}":{"get":{"operationId":"getStaffSupportChat","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"after","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":false,"name":"before","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]},"customerName":{"type":["string","null"]},"operatorName":{"type":["string","null"]},"closedByName":{"type":["string","null"]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason","customerName","operatorName","closedByName"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"chatId":{"type":"string","format":"uuid"},"seq":{"type":"number"},"author":{"type":"string","enum":["USER","SUPPORT"]},"authorId":{"type":"string"},"body":{"type":"string"},"meta":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"},"payment":{"type":"object","properties":{"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"currency":{"type":"string"},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]}},"required":["kind","amount","currency","status"]}},"required":["type","payment_id","payment"]},"hasAttachment":{"type":"boolean"},"attachmentType":{"type":["string","null"]},"attachmentName":{"type":["string","null"]},"attachmentSize":{"type":["number","null"]},"createdAt":{"type":"string"},"authorName":{"type":["string","null"]}},"required":["id","chatId","seq","author","authorId","body","hasAttachment","attachmentType","attachmentName","attachmentSize","createdAt","authorName"]}},"hasMore":{"type":"boolean"},"blocked":{"type":"boolean"}},"required":["chat","messages","hasMore","blocked"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}},"patch":{"operationId":"changeSupportChat","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["take","release","close"]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","enum":["reassign"]},"assignedTo":{"type":"string","maxLength":200,"pattern":"^user_[a-zA-Z0-9]+$"}},"required":["action","assignedTo"]}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/chats/{id}/block":{"patch":{"operationId":"setSupportBlock","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"blocked":{"type":"boolean"}},"required":["blocked"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"blocked":{"type":"boolean"}},"required":["blocked"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/chats/{id}/messages":{"post":{"operationId":"replySupportChat","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"body":{"type":"string","maxLength":10000},"meta":{"type":"object","properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"}},"required":["type","payment_id"]},"file":{"type":"string","format":"binary"},"image":{"type":"string","format":"binary"}},"required":["requestId","body"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"ownerKind":{"type":"string","enum":["GUEST","ACCOUNT"]},"label":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","CLOSED"]},"assignedTo":{"type":["string","null"]},"lastMessageSeq":{"type":"number"},"lastSupportSeq":{"type":"number"},"readSeq":{"type":"number"},"preview":{"type":"string"},"lastAuthor":{"type":["string","null"]},"waitingSince":{"type":["string","null"]},"revision":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"closedAt":{"type":["string","null"]},"closedBy":{"type":["string","null"]},"closedReason":{"type":["string","null"],"enum":["OPERATOR","GUEST_CLAIM","OWNER_DELETED",null]}},"required":["id","ownerId","ownerKind","label","status","assignedTo","lastMessageSeq","lastSupportSeq","readSeq","preview","lastAuthor","waitingSince","revision","createdAt","updatedAt","closedAt","closedBy","closedReason"]},"message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"chatId":{"type":"string","format":"uuid"},"seq":{"type":"number"},"author":{"type":"string","enum":["USER","SUPPORT"]},"authorId":{"type":"string"},"body":{"type":"string"},"meta":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["payment"]},"payment_id":{"type":"string","format":"uuid"},"payment":{"type":"object","properties":{"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"currency":{"type":"string"},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]}},"required":["kind","amount","currency","status"]}},"required":["type","payment_id","payment"]},"hasAttachment":{"type":"boolean"},"attachmentType":{"type":["string","null"]},"attachmentName":{"type":["string","null"]},"attachmentSize":{"type":["number","null"]},"createdAt":{"type":"string"}},"required":["id","chatId","seq","author","authorId","body","hasAttachment","attachmentType","attachmentName","attachmentSize","createdAt"]}},"required":["chat","message"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/support/admin/chats/{id}/messages/{messageId}/attachment":{"get":{"operationId":"staffSupportAttachment","tags":["support"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"messageId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresIn":{"type":"number"}},"required":["url","expiresIn"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}}}}}},"/api/v1/crm/emails/unread":{"get":{"tags":["CRM"],"operationId":"crmUnreadEmails","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmUnreadEmails"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/emails/{id}/read":{"post":{"tags":["CRM"],"operationId":"crmReadEmail","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/emails/{id}":{"get":{"tags":["CRM"],"operationId":"crmEmailDetail","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmEmailDetail"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/email-attachments/{id}":{"get":{"tags":["CRM"],"operationId":"crmEmailAttachment","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}/emails":{"post":{"tags":["CRM"],"operationId":"crmSendClientEmail","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"JSON: requestId UUID, expectedEmail, subject, html, optional callId and inReplyToEmailId. Same requestId never resends."},"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5}},"required":["message"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmEmailSummary"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/{id}/emails":{"post":{"tags":["CRM"],"operationId":"crmSendLeadEmail","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"JSON: requestId UUID, expectedEmail, subject, html, optional callId and inReplyToEmailId. Same requestId never resends."},"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":5}},"required":["message"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmEmailSummary"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/memberships":{"get":{"tags":["CRM"],"operationId":"crmMemberships","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmMemberships"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/me":{"get":{"tags":["CRM"],"operationId":"crmMe","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmMe"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads":{"get":{"tags":["CRM"],"operationId":"crmLeads","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":120,"default":""},"required":false,"name":"search","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]},"required":false,"name":"clientStatus","in":"query"},{"schema":{"type":"string","enum":["all","mine","free"],"default":"all"},"required":false,"name":"assignment","in":"query"},{"schema":{"type":"string","enum":["AR","BR"]},"required":false,"name":"jurisdiction","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"operator","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"due","in":"query"},{"schema":{"type":"string","enum":["preparing","calling","answered","completed","busy","no_answer","cancelled","failed","unconfirmed"]},"required":false,"name":"lastStatus","in":"query"},{"schema":{"type":"string","enum":["no","yes","all"],"default":"no"},"required":false,"name":"linked","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"source","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"importId","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CrmLeadSummary"}},"total":{"type":"number"}},"required":["items","total"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}},"post":{"tags":["CRM"],"operationId":"crmCreateLead","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":["string","null"]},"phoneNumber":{"type":"string","minLength":1,"maxLength":40},"firstName":{"type":["string","null"],"maxLength":120},"lastName":{"type":["string","null"],"maxLength":120},"source":{"type":["string","null"],"maxLength":120},"jurisdiction":{"type":"string","enum":["AR","BR"]},"assignedTo":{"type":["string","null"],"minLength":1,"maxLength":200},"note":{"type":"string","maxLength":4000,"default":""}},"required":["phoneNumber","jurisdiction"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLead"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/{id}":{"get":{"tags":["CRM"],"operationId":"crmLead","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLeadDetail"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}},"patch":{"tags":["CRM"],"operationId":"crmUpdateLead","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":["string","null"]},"phoneNumber":{"type":"string","minLength":1,"maxLength":40},"firstName":{"type":["string","null"],"maxLength":120},"lastName":{"type":["string","null"],"maxLength":120},"source":{"type":["string","null"],"maxLength":120}},"required":["phoneNumber"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLead"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/{id}/actions":{"post":{"tags":["CRM"],"operationId":"crmLeadAction","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["email"]},"email":{"type":["string","null"]}},"required":["action","email"]},{"type":"object","properties":{"action":{"type":"string","enum":["client_status"]},"clientStatus":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]}},"required":["action","clientStatus"]},{"type":"object","properties":{"action":{"type":"string","enum":["claim","release"]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","enum":["assign"]},"operatorId":{"type":["string","null"],"minLength":1,"maxLength":200}},"required":["action","operatorId"]},{"type":"object","properties":{"action":{"type":"string","enum":["note"]},"note":{"type":"string","minLength":1,"maxLength":4000}},"required":["action","note"]},{"type":"object","properties":{"action":{"type":"string","enum":["follow_up"]},"followUpAt":{"type":["string","null"],"format":"date-time"}},"required":["action","followUpAt"]}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLead"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/{id}/link":{"post":{"tags":["CRM"],"operationId":"crmLinkLead","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","format":"uuid"}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLead"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/{id}/calls":{"post":{"tags":["CRM"],"operationId":"crmPrepareLeadCall","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["zadarma","twilio"]}},"required":["requestId","provider"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"destination":{"type":"string"},"status":{"type":"string"},"provider":{"type":"string","enum":["zadarma","twilio"]}},"required":["id","destination","status","provider"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/import/preview":{"post":{"tags":["CRM"],"operationId":"crmPreviewLeadImport","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"jurisdiction":{"type":"string","enum":["AR","BR"]},"assignedTo":{"type":["string","null"],"minLength":1,"maxLength":200},"file":{"type":"string","format":"binary"}},"required":["jurisdiction","file"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLeadImportResult"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/import":{"post":{"tags":["CRM"],"operationId":"crmImportLeads","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"jurisdiction":{"type":"string","enum":["AR","BR"]},"assignedTo":{"type":["string","null"],"minLength":1,"maxLength":200},"file":{"type":"string","format":"binary"}},"required":["jurisdiction","file"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLeadImportResult"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients":{"get":{"tags":["CRM"],"operationId":"crmClients","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":120,"default":""},"required":false,"name":"search","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]},"required":false,"name":"clientStatus","in":"query"},{"schema":{"type":"string","enum":["preparing","calling","answered","completed","busy","no_answer","cancelled","failed","unconfirmed"]},"required":false,"name":"lastStatus","in":"query"},{"schema":{"type":"string","enum":["all","mine","free"],"default":"all"},"required":false,"name":"assignment","in":"query"},{"schema":{"type":"string","enum":["all","yes","no"],"default":"all"},"required":false,"name":"deposit","in":"query"},{"schema":{"type":"string","enum":["AR","BR"]},"required":false,"name":"jurisdiction","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"operator","in":"query"},{"schema":{"type":"string","enum":["interested","callback","not_interested","needs_help","wrong_contact","do_not_call"]},"required":false,"name":"outcome","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"due","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CrmClient"}},"total":{"type":"number"}},"required":["items","total"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}":{"get":{"tags":["CRM"],"operationId":"crmClient","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientDetail"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}/summary":{"get":{"tags":["CRM"],"operationId":"crmClientSummary","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientFinanceSummary"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}/payments":{"get":{"tags":["CRM"],"operationId":"crmClientPayments","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["pending","failed"]},"required":false,"name":"attention","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientPayments"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}/cfd-positions":{"get":{"tags":["CRM"],"operationId":"crmClientCfdPositions","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["current","opened","closed"],"default":"closed"},"required":false,"name":"view","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientCfdPositions"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}/trades":{"get":{"tags":["CRM"],"operationId":"crmClientTrades","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["REAL"],"default":"REAL"},"required":false,"name":"account","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientTrades"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}/actions":{"post":{"tags":["CRM"],"operationId":"crmClientAction","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["email"]},"email":{"type":["string","null"]}},"required":["action","email"]},{"type":"object","properties":{"action":{"type":"string","enum":["client_status"]},"clientStatus":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]}},"required":["action","clientStatus"]},{"type":"object","properties":{"action":{"type":"string","enum":["claim","release"]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","enum":["assign"]},"operatorId":{"type":["string","null"],"minLength":1,"maxLength":200}},"required":["action","operatorId"]},{"type":"object","properties":{"action":{"type":"string","enum":["note"]},"note":{"type":"string","minLength":1,"maxLength":4000}},"required":["action","note"]},{"type":"object","properties":{"action":{"type":"string","enum":["follow_up"]},"followUpAt":{"type":["string","null"],"format":"date-time"}},"required":["action","followUpAt"]}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClient"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/clients/{id}/calls":{"post":{"tags":["CRM"],"operationId":"crmPrepareCall","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["zadarma","twilio"]}},"required":["requestId","provider"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"destination":{"type":"string"},"status":{"type":"string"},"provider":{"type":"string","enum":["zadarma","twilio"]}},"required":["id","destination","status","provider"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/calls/{id}/fail-preparation":{"post":{"tags":["CRM"],"operationId":"crmFailCallPreparation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"boolean"}},"required":["updated"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/calls":{"get":{"tags":["CRM"],"operationId":"crmCalls","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":120,"default":""},"required":false,"name":"search","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["new","in_progress","interested","not_interested","no_answer","wrong_number","voice_mail"]},"required":false,"name":"clientStatus","in":"query"},{"schema":{"type":"string","enum":["preparing","calling","answered","completed","busy","no_answer","cancelled","failed","unconfirmed"]},"required":false,"name":"lastStatus","in":"query"},{"schema":{"type":"string","enum":["all","mine","free"],"default":"all"},"required":false,"name":"assignment","in":"query"},{"schema":{"type":"string","enum":["all","yes","no"],"default":"all"},"required":false,"name":"deposit","in":"query"},{"schema":{"type":"string","enum":["AR","BR"]},"required":false,"name":"jurisdiction","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"operator","in":"query"},{"schema":{"type":"string","enum":["interested","callback","not_interested","needs_help","wrong_contact","do_not_call"]},"required":false,"name":"outcome","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"due","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["preparing","calling","answered","completed","busy","no_answer","cancelled","failed","unconfirmed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2147483647},"required":false,"name":"minDuration","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"clientId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"leadId","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CrmCall"}},"total":{"type":"number"}},"required":["items","total"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/recordings/{id}":{"get":{"tags":["CRM"],"operationId":"crmRecording","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/phone/session":{"post":{"tags":["CRM"],"operationId":"crmPhoneSession","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPhoneSession"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/operator-options":{"get":{"tags":["CRM"],"operationId":"crmOperatorOptions","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CrmOperatorOption"}}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/team/statistics":{"get":{"tags":["CRM"],"operationId":"crmTeamStatistics","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmStatistics"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/zadarma/webhook":{"post":{"tags":["CRM"],"operationId":"crmZadarmaWebhook","description":"Zadarma form webhook; event-specific HMAC Signature required.","responses":{"200":{"description":"Persisted"},"403":{"description":"Invalid signature"}}}},"/api/v1/crm/twilio/voice":{"post":{"tags":["CRM"],"operationId":"crmTwilioVoice","security":[],"description":"Twilio signed form callback. Uses the configured public URL and validates AccountSid.","parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Twilio-Signature","in":"header"}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"responses":{"200":{"description":"TwiML response","content":{"text/xml":{"schema":{"type":"string"}}}},"403":{"description":"Invalid signature or call authorization"},"503":{"description":"Provider inactive or account verification unavailable"}}}},"/api/v1/crm/twilio/status":{"post":{"tags":["CRM"],"operationId":"crmTwilioStatus","security":[],"description":"Twilio signed form callback. Uses the configured public URL and validates AccountSid.","parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Twilio-Signature","in":"header"}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"responses":{"204":{"description":"Persisted"},"403":{"description":"Invalid signature or call authorization"},"503":{"description":"Provider inactive or account verification unavailable"}}}},"/api/v1/crm/twilio/dial-ended":{"post":{"tags":["CRM"],"operationId":"crmTwilioDialEnded","security":[],"description":"Twilio signed form callback. Uses the configured public URL and validates AccountSid.","parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Twilio-Signature","in":"header"}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"responses":{"200":{"description":"TwiML response","content":{"text/xml":{"schema":{"type":"string"}}}},"403":{"description":"Invalid signature or call authorization"},"503":{"description":"Provider inactive or account verification unavailable"}}}},"/api/v1/crm/twilio/recording":{"post":{"tags":["CRM"],"operationId":"crmTwilioRecording","security":[],"description":"Twilio signed form callback. Uses the configured public URL and validates AccountSid.","parameters":[{"schema":{"type":"string"},"required":true,"name":"X-Twilio-Signature","in":"header"}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","additionalProperties":{"type":"string"}}}}},"responses":{"204":{"description":"Persisted"},"403":{"description":"Invalid signature or call authorization"},"503":{"description":"Provider inactive or account verification unavailable"}}}},"/api/v1/crm/email/sendgrid/webhook":{"post":{"tags":["CRM"],"operationId":"crmSendGridWebhook","security":[],"description":"Signed SendGrid event webhook. ECDSA signature covers timestamp and raw JSON bytes.","responses":{"204":{"description":"Persisted"},"403":{"description":"Invalid signature"}}}},"/api/v1/crm/clients/{id}/history":{"get":{"tags":["CRM"],"operationId":"crmClientHistory","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":512},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmHistory"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/api/v1/crm/leads/{id}/history":{"get":{"tags":["CRM"],"operationId":"crmLeadHistory","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":512},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Active organization; required for employees with multiple memberships. Admins retain global access."},"required":false,"description":"Active organization; required for employees with multiple memberships. Admins retain global access.","name":"X-CRM-Organization-Id","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmHistory"}}}},"401":{"description":"CRM session required"},"403":{"description":"Role, region or CRM access denied"},"404":{"description":"Not accessible"},"409":{"description":"Duplicate contact, assignment or call state conflict","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"statusCode":{"type":"number"},"message":{"type":"string"},"duplicate":{"$ref":"#/components/schemas/CrmDuplicateContact"}},"required":["code","statusCode","message"]}}}}}}},"/health":{"get":{"responses":{"200":{"description":"Healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}}}}},"/api/v1/guest-session":{"post":{"operationId":"createGuestSession","tags":["api"],"security":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"jurisdiction":{"type":"string","enum":["AR","BR"],"default":"AR"}}}}}},"responses":{"204":{"description":"Guest session ready; cookie is set on first visit"},"403":{"description":"Origin not allowed"}}}},"/api/v1/webhooks/unipay":{"post":{"operationId":"handleUnipayWebhook","tags":["api"],"security":[],"description":"HMAC-SHA256 over exact bytes is required when configured. Otherwise the payment is independently verified with UniPay before any balance change.","parameters":[{"schema":{"type":"string"},"required":false,"name":"X-Signature","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"UNIPAY payin or payout callback, including operationId and userId metadata."}}}},"responses":{"204":{"description":"Callback applied or already processed"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/profile/phone":{"get":{"operationId":"getPhoneBinding","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Local phone binding","content":{"application/json":{"schema":{"type":"object","properties":{"phoneNumber":{"type":["string","null"]},"jurisdiction":{"type":"string","enum":["AR","BR"]}},"required":["phoneNumber","jurisdiction"]}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"put":{"operationId":"changePhone","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneId":{"type":"string","minLength":1,"maxLength":128},"expectedPhoneNumber":{"type":["string","null"],"maxLength":32}},"required":["phoneId","expectedPhoneNumber"]}}}},"responses":{"204":{"description":"Phone binding updated"},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/partner-attributions":{"post":{"operationId":"createPartnerAttribution","tags":["api"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerAttributionInput"}}}},"responses":{"200":{"description":"Partner attribution token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerAttribution"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/registrations":{"post":{"operationId":"completeRegistration","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationInput"}}}},"responses":{"204":{"description":"Registration complete"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/cfd/instruments":{"get":{"operationId":"listCfdInstruments","tags":["cfd"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"symbol":{"type":"string"},"category":{"type":"string","enum":["Forex","Metals","Crypto"]},"termsVersion":{"type":"integer"},"terms":{"$ref":"#/components/schemas/CfdTerms"},"enabled":{"type":"boolean"},"quoteFresh":{"type":"boolean"}},"required":["id","symbol","category","termsVersion","terms","enabled","quoteFresh"]}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/cfd/quotes/{instrumentId}":{"get":{"operationId":"getCfdQuote","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"instrumentId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"$ref":"#/components/schemas/CfdQuote"},"fresh":{"type":"boolean"}},"required":["quote","fresh"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/cfd/positions":{"post":{"operationId":"openCfdPosition","tags":["cfd"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"instrumentId":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["LONG","SHORT"]},"margin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"leverage":{"type":"integer","minimum":1},"displayedAt":{"type":"string","format":"date-time"},"quoteGeneration":{"type":"string","pattern":"^\\d+$"},"quoteSequence":{"type":"string","pattern":"^\\d+$"},"termsVersion":{"type":"integer","exclusiveMinimum":0},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128}},"required":["accountId","instrumentId","direction","margin","termsVersion","idempotencyKey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CfdPosition"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"get":{"operationId":"listCfdPositions","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"accountId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"instrumentId","in":"query"},{"schema":{"type":"string","enum":["OPEN","LIQUIDATION_PENDING","CLOSED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["profit","loss","flat","liquidated","open"]},"required":false,"name":"result","in":"query"},{"schema":{"type":"string","enum":["LONG","SHORT"]},"required":false,"name":"direction","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CfdPosition"}},"total":{"type":"integer","minimum":0},"nextCursor":{"type":["string","null"],"format":"uuid"}},"required":["items","total","nextCursor"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/cfd/positions/{id}":{"get":{"operationId":"getCfdPosition","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CfdPosition"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/cfd/positions/{id}/close":{"post":{"operationId":"closeCfdPosition","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotencyKey":{"type":"string","minLength":1,"maxLength":128}},"required":["idempotencyKey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CfdPosition"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/cfd/accounts/{accountId}":{"get":{"operationId":"getCfdAccount","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"trading":{"type":"object","properties":{"enabled":{"type":"boolean"},"minMargin":{"type":["string","null"]},"maxMargin":{"type":["string","null"]}},"required":["enabled","minMargin","maxMargin"]},"currency":{"type":"string"},"freeBalance":{"type":"string"},"allocated":{"type":"string"},"positionValue":{"type":["string","null"]},"valuationAt":{"type":["string","null"],"format":"date-time"},"quoteFresh":{"type":"boolean"},"openCount":{"type":"integer"}},"required":["accountId","trading","currency","freeBalance","allocated","positionValue","valuationAt","quoteFresh","openCount"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/cfd/instruments":{"get":{"operationId":"listAdminCfdInstruments","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"archived","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"symbol":{"type":"string"},"category":{"type":"string","enum":["Forex","Metals","Crypto"]},"termsVersion":{"type":"integer"},"terms":{"$ref":"#/components/schemas/CfdTerms"},"enabled":{"type":"boolean"},"quoteFresh":{"type":"boolean"}},"required":["id","symbol","category","termsVersion","terms","enabled","quoteFresh"]}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/cfd/instruments/{id}":{"put":{"operationId":"updateAdminCfdTerms","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"$ref":"#/components/schemas/CfdTerms"}},"required":["version","value"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"$ref":"#/components/schemas/CfdTerms"}},"required":["version","value"],"additionalProperties":false}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/cfd/risk":{"get":{"operationId":"getAdminCfdRisk","tags":["cfd"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"heartbeatAt":{"type":["string","null"],"format":"date-time"},"pendingObservations":{"type":"integer"},"pendingLiquidations":{"type":"integer"},"books":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["AR:DEMO","AR:REAL","BR:DEMO","BR:REAL"]},"realizedPnl":{"type":"string"},"periodStartedAt":{"type":"string","format":"date-time"},"risk":{"type":"object","properties":{"gross":{"type":"string"},"stressLoss":{"type":"string"},"usedRisk":{"type":"string"},"instruments":{"type":"object","additionalProperties":{"type":"object","properties":{"gross":{"type":"string"},"net":{"type":"string"},"stressLoss":{"type":"string"}},"required":["gross","net","stressLoss"]}},"missing":{"type":"array","items":{"type":"string"}},"staleInstruments":{"type":"array","items":{"type":"string"}},"openCount":{"type":"integer"}},"required":["gross","stressLoss","usedRisk","instruments","missing","staleInstruments","openCount"]},"totals":{"type":"object","properties":{"allocated":{"type":"string"},"brokerPnl":{"type":"string"},"shortfall":{"type":"string"},"closedFees":{"type":"string"}},"required":["allocated","brokerPnl","shortfall","closedFees"]}},"required":["id","realizedPnl","periodStartedAt","risk","totals"]}}},"required":["heartbeatAt","pendingObservations","pendingLiquidations","books"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/cfd/positions":{"get":{"operationId":"listAdminCfdPositions","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"accountId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"instrumentId","in":"query"},{"schema":{"type":"string","enum":["OPEN","LIQUIDATION_PENDING","CLOSED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["profit","loss","flat","liquidated","open"]},"required":false,"name":"result","in":"query"},{"schema":{"type":"string","enum":["LONG","SHORT"]},"required":false,"name":"direction","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CfdPosition"}},"total":{"type":"integer","minimum":0},"nextCursor":{"type":["string","null"],"format":"uuid"}},"required":["items","total","nextCursor"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/cfd/positions/{id}":{"get":{"operationId":"getAdminCfdPosition","tags":["cfd"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CfdPosition"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/instruments":{"get":{"operationId":"listInstruments","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"parameters":[{"schema":{"type":"string","enum":["options","cfd"],"default":"options"},"required":false,"name":"product","in":"query"}],"responses":{"200":{"description":"Instruments for the selected product","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Instrument"}}}}},"400":{"description":"Invalid product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/accounts":{"get":{"operationId":"listAccounts","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"responses":{"200":{"description":"Trading accounts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Accounts"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/accounts/demo/reset":{"post":{"operationId":"resetDemoBalance","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"}},"required":["accountId"]}}}},"responses":{"200":{"description":"Reset demo trading account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/market/candles":{"get":{"operationId":"listCandles","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"instrumentId","in":"query"},{"schema":{"type":"string","enum":["1s","5s","10s","15s","30s","1m","5m","15m","30m","1h","4h","1d"]},"required":true,"name":"interval","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":5000,"default":5000},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Closed candles","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CandlePage"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/market/ticks":{"get":{"operationId":"listMarketTicks","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"instrumentId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":5000,"default":5000},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Raw market ticks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketTickPage"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/market/schedule":{"get":{"operationId":"getMarketSchedule","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"responses":{"200":{"description":"Current market sessions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketScheduleResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/trades":{"post":{"operationId":"createTrade","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTradeInput"}}}},"responses":{"200":{"description":"Opened or replayed trade","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trade"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"listTrades","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["PENDING","OPEN","WON","LOST","DRAW","VOID"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["profit","loss","flat","open"]},"required":false,"name":"result","in":"query"},{"schema":{"type":"string","enum":["CALL","PUT"]},"required":false,"name":"direction","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"instrumentId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Trades","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradePage"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/trades/{id}":{"get":{"operationId":"getTrade","tags":["api"],"security":[{"bearerAuth":[]},{"bearerAuth":[],"guestCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Trade","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trade"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/payments/deposits":{"post":{"operationId":"createDeposit","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDepositInput"}}}},"responses":{"200":{"description":"Created or replayed payment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentOperation"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/payments/withdrawals":{"post":{"operationId":"createWithdrawal","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWithdrawalInput"}}}},"responses":{"200":{"description":"Created or replayed payment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentOperation"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/payments":{"get":{"operationId":"listPaymentOperations","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"},{"schema":{"type":"string","enum":["DEPOSIT","WITHDRAWAL","BONUS"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Recent owned payment operations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentOperationPage"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/payments/{id}":{"get":{"operationId":"getPayment","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Owned payment operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentOperation"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/payments/withdrawals/quote":{"post":{"operationId":"quoteWithdrawal","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalQuoteInput"}}}},"responses":{"200":{"description":"Bonus reserve to confirm before withdrawal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalQuote"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/bonuses":{"get":{"operationId":"getBonuses","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Bonus result","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"balance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"withdrawalReserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"referralCode":{"type":"string"},"referrals":{"type":"number"},"rewardedReferrals":{"type":"number"},"welcome":{"type":"boolean"},"firstDeposit":{"type":"boolean"},"pendingDeposit":{"type":["object","null"],"properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"id":{"type":"string","format":"uuid"},"providerOperationId":{"type":["string","null"],"format":"uuid"},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"paymentLinks":{"type":["object","null"],"properties":{"mercadoPago":{"type":"string","format":"uri"}},"required":["mercadoPago"]},"pixCode":{"type":["string","null"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"settledAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"bonusAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"withdrawalBonus":{"type":["object","null"],"properties":{"reserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"conditional":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"burned":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["reserved","conditional"]},"dni":{"type":["string","null"]},"cvu":{"type":["string","null"]},"alias":{"type":["string","null"]},"accountName":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"providerStatus":{"type":["string","null"]},"redirectUrl":{"type":["string","null"],"format":"uri"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["accountId","jurisdiction","currency","id","providerOperationId","kind","paymentMethod","paymentLinks","amount","settledAmount","status","providerStatus","redirectUrl","expiresAt","createdAt","updatedAt","completedAt"]},"config":{"type":"object","properties":{"BONUS_EXPIRATION_DAYS":{"type":"number"},"BONUS_MAX_PER_DEPOSIT":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_MAX_BALANCE":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_WELCOME_PERCENT":{"type":"number"},"BONUS_REFERRAL_REWARD":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_REFERRAL_MIN_DEPOSIT":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_DEPOSIT_TIERS":{"type":"array","items":{"type":"object","properties":{"minimum":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"percent":{"type":"number"}},"required":["minimum","percent"]}}},"required":["BONUS_EXPIRATION_DAYS","BONUS_WELCOME_PERCENT","BONUS_REFERRAL_REWARD","BONUS_REFERRAL_MIN_DEPOSIT","BONUS_DEPOSIT_TIERS"]},"grants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"source":{"type":"string"},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"remaining":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"reserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"withdrawalReserved":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","source","amount","remaining","reserved","expiresAt","createdAt"]}}},"required":["accountId","jurisdiction","currency","balance","referralCode","referrals","rewardedReferrals","welcome","firstDeposit","config","grants"]}}}}}}},"/api/v1/bonuses/quote":{"post":{"operationId":"quoteBonus","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"promoCode":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["accountId","amount"]}}}},"responses":{"200":{"description":"Bonus result","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"jurisdiction":{"type":"string","pattern":"^[A-Z]{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"percent":{"type":"number"},"expirationDays":{"type":"number"},"welcome":{"type":"boolean"}},"required":["accountId","jurisdiction","currency","amount","percent","expirationDays","welcome"]}}}}}}},"/api/v1/bonuses/promo":{"post":{"operationId":"activateBonus","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["accountId","code"]}}}},"responses":{"200":{"description":"Bonus result","content":{"application/json":{"schema":{"type":"object","properties":{"activated":{"type":"boolean","enum":[true]}},"required":["activated"]}}}}}}},"/api/v1/bonuses/referral":{"post":{"operationId":"linkReferral","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"code":{"type":"string","maxLength":64,"pattern":"^REF-[a-fA-F0-9]{32}$"}},"required":["accountId","code"]}}}},"responses":{"200":{"description":"Bonus result","content":{"application/json":{"schema":{"type":"object","properties":{"linked":{"type":"boolean","enum":[true]}},"required":["linked"]}}}}}}},"/api/v1/admin/payments/settings/{jurisdiction}":{"get":{"operationId":"getPaymentSettings","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer"},"returnUrl":{"anyOf":[{"type":"string","enum":[""]},{"type":"string","format":"uri"}]},"depositsEnabled":{"type":"boolean"},"withdrawalsEnabled":{"type":"boolean"},"apiKeyConfigured":{"type":"boolean"},"hmacConfigured":{"type":"boolean"},"encryptionReady":{"type":"boolean"}},"required":["version","returnUrl","depositsEnabled","withdrawalsEnabled","apiKeyConfigured","hmacConfigured","encryptionReady"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"put":{"operationId":"updatePaymentSettings","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"returnUrl":{"anyOf":[{"type":"string","enum":[""]},{"type":"string","format":"uri"}]},"depositsEnabled":{"type":"boolean"},"withdrawalsEnabled":{"type":"boolean"},"apiKey":{"type":"string","maxLength":1024},"hmacSecret":{"type":"string","maxLength":1024},"clearApiKey":{"type":"boolean","default":false},"clearHmacSecret":{"type":"boolean","default":false}},"required":["version","returnUrl","depositsEnabled","withdrawalsEnabled"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer"},"returnUrl":{"anyOf":[{"type":"string","enum":[""]},{"type":"string","format":"uri"}]},"depositsEnabled":{"type":"boolean"},"withdrawalsEnabled":{"type":"boolean"},"apiKeyConfigured":{"type":"boolean"},"hmacConfigured":{"type":"boolean"},"encryptionReady":{"type":"boolean"}},"required":["version","returnUrl","depositsEnabled","withdrawalsEnabled","apiKeyConfigured","hmacConfigured","encryptionReady"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/settings/{jurisdiction}/check":{"post":{"operationId":"checkPaymentConnection","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"string"},"currency":{"type":"string"},"error":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["updatedAt"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/approve":{"post":{"operationId":"approveWithdrawal","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/reject":{"post":{"operationId":"rejectWithdrawal","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/check":{"post":{"operationId":"checkPaymentStatus","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"providerOperationId":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"verified":{"type":"boolean"}},"required":["verified"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/context":{"get":{"operationId":"getPaymentContext","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"id":{"type":"string"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"status":{"type":"string"},"registeredAt":{"type":"string"}},"required":["id","firstName","lastName","phoneNumber","status","registeredAt"]},"reviewedBy":{"type":["string","null"]},"reviewedAt":{"type":["string","null"]},"withdrawalBonus":{"type":["object","null"],"properties":{"reserved":{"type":"string"},"conditional":{"type":"string"}},"required":["reserved","conditional"]},"summary":{"$ref":"#/components/schemas/CrmClientFinanceSummary"}},"required":["customer","reviewedBy","reviewedAt","withdrawalBonus","summary"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/client-payments":{"get":{"operationId":"getPaymentClientPayments","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["pending","failed"]},"required":false,"name":"attention","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientPayments"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/client-cfd-positions":{"get":{"operationId":"getPaymentClientCfdPositions","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["current","opened","closed"],"default":"closed"},"required":false,"name":"view","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientCfdPositions"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/client-trades":{"get":{"operationId":"getPaymentClientTrades","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["30d","all"],"default":"30d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"]},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":1000000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["REAL"],"default":"REAL"},"required":false,"name":"account","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmClientTrades"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/{id}/events":{"get":{"operationId":"getPaymentEvents","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"operationId":{"type":["string","null"]},"kind":{"type":"string"},"result":{"type":"string"},"actor":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","operationId","kind","result","actor","createdAt"]}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments/monitor":{"get":{"operationId":"getPaymentMonitor","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"object","properties":{"balance":{"type":"string"},"currency":{"type":"string"},"error":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["updatedAt"]},"workerUpdatedAt":{"type":["string","null"]},"lastCallbackAt":{"type":["string","null"]},"reviewCount":{"type":"number"},"reviewAmount":{"type":"string"},"oldestReviewAt":{"type":["string","null"]},"issues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount":{"type":"string"},"submissionStatus":{"type":"string"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"lastCheckedAt":{"type":["string","null"]}},"required":["id","kind","amount","submissionStatus","error","createdAt","lastCheckedAt"]}}},"required":["balance","workerUpdatedAt","lastCallbackAt","reviewCount","reviewAmount","oldestReviewAt","issues"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/payments":{"get":{"operationId":"listAdminPayments","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"query"},{"schema":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","enum":["PENDING","PROCESSING","OVERDUE","COMPLETED","FAILED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["PENDING","APPROVED","REJECTED"]},"required":false,"name":"reviewStatus","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"paymentId","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string","pattern":"^\\d{1,10}(\\.\\d{1,2})?$"},"required":false,"name":"amount","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":100000,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["createdAt","amount","status","kind"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sortDirection","in":"query"}],"responses":{"200":{"description":"Real-account payments. Pending and overdue ignore dates. Failed uses completion date; other views use creation date.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"customerName":{"type":["string","null"]},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"overdue":{"type":"boolean"},"amount":{"type":"string"},"settledAmount":{"type":["string","null"]},"currency":{"type":"string"},"paymentMethod":{"type":"string"},"providerOperationId":{"type":["string","null"]},"providerStatus":{"type":["string","null"]},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]}},"required":["id","userId","customerName","kind","status","overdue","amount","settledAmount","currency","paymentMethod","providerOperationId","providerStatus","createdAt","completedAt","expiresAt"]}},"total":{"type":"number"}},"required":["items","total"]}}}}}}},"/api/v1/admin/payments/{id}":{"get":{"operationId":"getAdminPayment","tags":["admin-payments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Payment details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"customerName":{"type":["string","null"]},"tradingAccountId":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["DEPOSIT","WITHDRAWAL"]},"status":{"type":"string","enum":["PENDING","COMPLETED","FAILED"]},"reviewStatus":{"type":["string","null"],"enum":["PENDING","APPROVED","REJECTED",null]},"submissionStatus":{"type":"string","enum":["NOT_SENT","SUBMITTING","SUBMITTED","UNKNOWN"]},"rejectionReason":{"type":["string","null"]},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"settledAmount":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"currency":{"type":"string"},"jurisdiction":{"type":"string"},"paymentMethod":{"type":"string"},"providerOperationId":{"type":["string","null"]},"providerStatus":{"type":["string","null"]},"dni":{"type":["string","null"]},"cvu":{"type":["string","null"]},"alias":{"type":["string","null"]},"accountName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"overdue":{"type":"boolean"}},"required":["id","userId","customerName","tradingAccountId","kind","status","amount","settledAmount","currency","jurisdiction","paymentMethod","providerOperationId","providerStatus","dni","cvu","alias","accountName","createdAt","updatedAt","completedAt","expiresAt","overdue"]}}}}}}},"/api/v1/admin/metrics":{"get":{"operationId":"getAdminMetrics","tags":["admin-metrics"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"query"},{"schema":{"type":"string","enum":["UTC","Etc/GMT+3"],"default":"UTC"},"required":false,"name":"timezone","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Real-account metrics. Day buckets use the selected timezone; timestamps are UTC; to is exclusive. Obligations are current, independent of the period.","content":{"application/json":{"schema":{"type":"object","properties":{"jurisdiction":{"type":"string"},"currency":{"type":"string"},"timezone":{"type":"string","enum":["UTC","Etc/GMT+3"]},"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"summary":{"type":"object","properties":{"deposits":{"type":"string"},"depositCount":{"type":"integer","minimum":0},"depositors":{"type":"integer","minimum":0},"withdrawals":{"type":"string"},"withdrawalCount":{"type":"integer","minimum":0},"netFlow":{"type":"string"},"stake":{"type":"string"},"bonusStake":{"type":"string"},"tradeCount":{"type":"integer","minimum":0},"players":{"type":"integer","minimum":0},"settledStake":{"type":"string"},"settledCount":{"type":"integer","minimum":0},"wins":{"type":"string"},"losses":{"type":"string"},"result":{"type":"string"},"margin":{"type":["string","null"]},"winRate":{"type":["string","null"]},"failedDeposits":{"type":"integer","minimum":0},"trading":{"$ref":"#/components/schemas/TradingBreakdown"}},"required":["deposits","depositCount","depositors","withdrawals","withdrawalCount","netFlow","stake","bonusStake","tradeCount","players","settledStake","settledCount","wins","losses","result","margin","winRate","failedDeposits"]},"previous":{"type":"object","properties":{"deposits":{"type":"string"},"depositCount":{"type":"integer","minimum":0},"depositors":{"type":"integer","minimum":0},"withdrawals":{"type":"string"},"withdrawalCount":{"type":"integer","minimum":0},"netFlow":{"type":"string"},"stake":{"type":"string"},"bonusStake":{"type":"string"},"tradeCount":{"type":"integer","minimum":0},"players":{"type":"integer","minimum":0},"settledStake":{"type":"string"},"settledCount":{"type":"integer","minimum":0},"wins":{"type":"string"},"losses":{"type":"string"},"result":{"type":"string"},"margin":{"type":["string","null"]},"winRate":{"type":["string","null"]},"failedDeposits":{"type":"integer","minimum":0},"trading":{"$ref":"#/components/schemas/TradingBreakdown"}},"required":["deposits","depositCount","depositors","withdrawals","withdrawalCount","netFlow","stake","bonusStake","tradeCount","players","settledStake","settledCount","wins","losses","result","margin","winRate","failedDeposits"]},"series":{"type":"array","items":{"type":"object","properties":{"deposits":{"type":"string"},"depositCount":{"type":"integer","minimum":0},"depositors":{"type":"integer","minimum":0},"withdrawals":{"type":"string"},"withdrawalCount":{"type":"integer","minimum":0},"netFlow":{"type":"string"},"stake":{"type":"string"},"bonusStake":{"type":"string"},"tradeCount":{"type":"integer","minimum":0},"players":{"type":"integer","minimum":0},"settledStake":{"type":"string"},"settledCount":{"type":"integer","minimum":0},"wins":{"type":"string"},"losses":{"type":"string"},"result":{"type":"string"},"margin":{"type":["string","null"]},"winRate":{"type":["string","null"]},"failedDeposits":{"type":"integer","minimum":0},"trading":{"$ref":"#/components/schemas/TradingBreakdown"},"day":{"type":"string"}},"required":["deposits","depositCount","depositors","withdrawals","withdrawalCount","netFlow","stake","bonusStake","tradeCount","players","settledStake","settledCount","wins","losses","result","margin","winRate","failedDeposits","day"]}},"instruments":{"type":"array","items":{"type":"object","properties":{"deposits":{"type":"string"},"depositCount":{"type":"integer","minimum":0},"depositors":{"type":"integer","minimum":0},"withdrawals":{"type":"string"},"withdrawalCount":{"type":"integer","minimum":0},"netFlow":{"type":"string"},"stake":{"type":"string"},"bonusStake":{"type":"string"},"tradeCount":{"type":"integer","minimum":0},"players":{"type":"integer","minimum":0},"settledStake":{"type":"string"},"settledCount":{"type":"integer","minimum":0},"wins":{"type":"string"},"losses":{"type":"string"},"result":{"type":"string"},"margin":{"type":["string","null"]},"winRate":{"type":["string","null"]},"failedDeposits":{"type":"integer","minimum":0},"trading":{"$ref":"#/components/schemas/TradingBreakdown"},"id":{"type":"string"},"symbol":{"type":"string"},"cfdOpenCount":{"type":"integer","minimum":0},"cfdOpenCashMargin":{"type":"string"},"openStake":{"type":"string"},"openCount":{"type":"integer","minimum":0}},"required":["deposits","depositCount","depositors","withdrawals","withdrawalCount","netFlow","stake","bonusStake","tradeCount","players","settledStake","settledCount","wins","losses","result","margin","winRate","failedDeposits","id","symbol","openStake","openCount"]}},"current":{"$ref":"#/components/schemas/TradingCurrent"},"attention":{"type":"object","properties":{"pendingDeposits":{"type":"string"},"pendingDepositCount":{"type":"integer","minimum":0},"pendingWithdrawals":{"type":"string"},"pendingWithdrawalCount":{"type":"integer","minimum":0},"oldestWithdrawalAt":{"type":["string","null"]},"openStake":{"type":"string"},"openCount":{"type":"integer","minimum":0}},"required":["pendingDeposits","pendingDepositCount","pendingWithdrawals","pendingWithdrawalCount","oldestWithdrawalAt","openStake","openCount"]}},"required":["jurisdiction","currency","timezone","from","to","previousFrom","summary","previous","series","instruments","attention"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-history/chart":{"get":{"operationId":"getAdminMarketHistoryChart","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"instrumentId","in":"query"},{"schema":{"type":"string","enum":["1s","5s","10s","15s","30s","1m","5m","15m","30m","1h","4h","1d"]},"required":true,"name":"interval","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":5000,"default":5000},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"jobId","in":"query"}],"responses":{"200":{"description":"History repair","content":{"application/json":{"schema":{"type":"object","properties":{"before":{"type":"object","properties":{"historyRevision":{"type":"string","pattern":"^\\d+$"},"items":{"type":"array","items":{"type":"object","properties":{"instrumentId":{"type":"string","format":"uuid"},"interval":{"type":"string","enum":["1s","5s","10s","15s","30s","1m","5m","15m","30m","1h","4h","1d"]},"startAt":{"type":"string","format":"date-time"},"bid":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"ask":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["instrumentId","interval","startAt","open","high","low","close"]}},"nextBefore":{"type":["string","null"],"format":"date-time"}},"required":["items","nextBefore"]},"after":{"type":["object","null"],"properties":{"historyRevision":{"type":"string","pattern":"^\\d+$"},"items":{"type":"array","items":{"type":"object","properties":{"instrumentId":{"type":"string","format":"uuid"},"interval":{"type":"string","enum":["1s","5s","10s","15s","30s","1m","5m","15m","30m","1h","4h","1d"]},"startAt":{"type":"string","format":"date-time"},"bid":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"ask":{"type":["object","null"],"properties":{"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["open","high","low","close"]},"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}},"required":["instrumentId","interval","startAt","open","high","low","close"]}},"nextBefore":{"type":["string","null"],"format":"date-time"}},"required":["items","nextBefore"]},"revision":{"type":"string"},"retention":{"type":"object","properties":{"ticksMs":{"type":"number"},"secondsMs":{"type":"number"},"minutesMs":{"type":"number"}},"required":["ticksMs","secondsMs","minutesMs"]}},"required":["before","after","revision","retention"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-history/repairs":{"get":{"operationId":"listAdminMarketHistoryRepairs","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"History repair","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarketHistoryJob"}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"post":{"operationId":"startAdminMarketHistoryRepair","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"instrumentId":{"type":"string","format":"uuid"},"all":{"type":"boolean","default":false},"autoApply":{"type":"boolean"}},"required":["from","to"]}}}},"responses":{"200":{"description":"History repair","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketHistoryJob"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-history/repairs/{id}":{"get":{"operationId":"getAdminMarketHistoryRepair","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"History repair","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketHistoryJob"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-history/repairs/{id}/stop":{"post":{"operationId":"stopAdminMarketHistoryRepair","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"History repair","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketHistoryJob"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-history/repairs/{id}/apply":{"post":{"operationId":"applyAdminMarketHistoryRepair","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"previewVersion":{"type":"string","format":"uuid"},"instrumentIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100}},"required":["previewVersion","instrumentIds"]}}}},"responses":{"200":{"description":"History repair","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketHistoryJob"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/settings/storage":{"get":{"operationId":"getAdminStorageSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"type":"object","properties":{"supportDays":{"type":["integer","null"],"minimum":1,"maximum":36500},"crmDays":{"type":["integer","null"],"minimum":1,"maximum":36500}},"required":["supportDays","crmDays"],"additionalProperties":false}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"put":{"operationId":"updateAdminStorageSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"type":"object","properties":{"supportDays":{"type":"integer","minimum":1,"maximum":36500},"crmDays":{"type":"integer","minimum":1,"maximum":36500}},"required":["supportDays","crmDays"],"additionalProperties":false}},"required":["version","value"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"value":{"type":"object","properties":{"supportDays":{"type":["integer","null"],"minimum":1,"maximum":36500},"crmDays":{"type":["integer","null"],"minimum":1,"maximum":36500}},"required":["supportDays","crmDays"],"additionalProperties":false}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/settings/jurisdictions":{"get":{"operationId":"listAdminJurisdictions","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"jurisdiction":{"type":"string"},"currency":{"type":"string"},"enabled":{"type":"boolean"}},"required":["jurisdiction","currency","enabled"]}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/settings/trading":{"get":{"operationId":"getAdminTradingSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"otcEnabled":{"type":"boolean"}},"required":["otcEnabled"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"put":{"operationId":"updateAdminTradingSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"otcEnabled":{"type":"boolean"}},"required":["otcEnabled"]}},"required":["version","value"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"otcEnabled":{"type":"boolean"}},"required":["otcEnabled"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/settings/support":{"get":{"operationId":"getAdminSupportSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"SUPPORT_GUEST_ATTACHMENTS_ENABLED":{"type":"boolean","default":false},"SUPPORT_MAX_IMAGE_MB":{"type":"integer","minimum":1,"maximum":50,"default":5},"SUPPORT_MAX_DOCUMENT_MB":{"type":"integer","minimum":1,"maximum":50,"default":10},"SUPPORT_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_IP_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_IP_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000}},"required":["SUPPORT_MESSAGES_PER_MINUTE","SUPPORT_MESSAGES_PER_HOUR","SUPPORT_GUEST_MESSAGES_PER_MINUTE","SUPPORT_GUEST_MESSAGES_PER_HOUR","SUPPORT_GUEST_IP_MESSAGES_PER_MINUTE","SUPPORT_GUEST_IP_MESSAGES_PER_HOUR"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"put":{"operationId":"updateAdminSupportSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"SUPPORT_GUEST_ATTACHMENTS_ENABLED":{"type":"boolean","default":false},"SUPPORT_MAX_IMAGE_MB":{"type":"integer","minimum":1,"maximum":50,"default":5},"SUPPORT_MAX_DOCUMENT_MB":{"type":"integer","minimum":1,"maximum":50,"default":10},"SUPPORT_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_IP_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_IP_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000}},"required":["SUPPORT_MESSAGES_PER_MINUTE","SUPPORT_MESSAGES_PER_HOUR","SUPPORT_GUEST_MESSAGES_PER_MINUTE","SUPPORT_GUEST_MESSAGES_PER_HOUR","SUPPORT_GUEST_IP_MESSAGES_PER_MINUTE","SUPPORT_GUEST_IP_MESSAGES_PER_HOUR"]}},"required":["version","value"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"SUPPORT_GUEST_ATTACHMENTS_ENABLED":{"type":"boolean","default":false},"SUPPORT_MAX_IMAGE_MB":{"type":"integer","minimum":1,"maximum":50,"default":5},"SUPPORT_MAX_DOCUMENT_MB":{"type":"integer","minimum":1,"maximum":50,"default":10},"SUPPORT_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_IP_MESSAGES_PER_MINUTE":{"type":"integer","exclusiveMinimum":0,"maximum":1000000},"SUPPORT_GUEST_IP_MESSAGES_PER_HOUR":{"type":"integer","exclusiveMinimum":0,"maximum":1000000}},"required":["SUPPORT_MESSAGES_PER_MINUTE","SUPPORT_MESSAGES_PER_HOUR","SUPPORT_GUEST_MESSAGES_PER_MINUTE","SUPPORT_GUEST_MESSAGES_PER_HOUR","SUPPORT_GUEST_IP_MESSAGES_PER_MINUTE","SUPPORT_GUEST_IP_MESSAGES_PER_HOUR"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/settings/jurisdictions/{jurisdiction}/bonus":{"get":{"operationId":"getAdminBonusSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"BONUS_DEPOSIT_TIERS":{"type":"array","items":{"type":"object","properties":{"minimum":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"percent":{"type":"integer","minimum":0,"maximum":75}},"required":["minimum","percent"]},"maxItems":100},"BONUS_WELCOME_PERCENT":{"type":"integer","minimum":0,"maximum":1000},"BONUS_REFERRAL_REWARD":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_REFERRAL_MIN_DEPOSIT":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_MAX_PER_DEPOSIT":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_MAX_BALANCE":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_EXPIRATION_DAYS":{"type":"integer","minimum":0,"maximum":36500}},"required":["BONUS_DEPOSIT_TIERS","BONUS_WELCOME_PERCENT","BONUS_REFERRAL_REWARD","BONUS_REFERRAL_MIN_DEPOSIT","BONUS_MAX_PER_DEPOSIT","BONUS_MAX_BALANCE","BONUS_EXPIRATION_DAYS"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"put":{"operationId":"updateAdminBonusSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"BONUS_DEPOSIT_TIERS":{"type":"array","items":{"type":"object","properties":{"minimum":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"percent":{"type":"integer","minimum":0,"maximum":75}},"required":["minimum","percent"]},"maxItems":100},"BONUS_WELCOME_PERCENT":{"type":"integer","minimum":0,"maximum":1000},"BONUS_REFERRAL_REWARD":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_REFERRAL_MIN_DEPOSIT":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_MAX_PER_DEPOSIT":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_MAX_BALANCE":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_EXPIRATION_DAYS":{"type":"integer","minimum":0,"maximum":36500}},"required":["BONUS_DEPOSIT_TIERS","BONUS_WELCOME_PERCENT","BONUS_REFERRAL_REWARD","BONUS_REFERRAL_MIN_DEPOSIT","BONUS_MAX_PER_DEPOSIT","BONUS_MAX_BALANCE","BONUS_EXPIRATION_DAYS"]}},"required":["version","value"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"BONUS_DEPOSIT_TIERS":{"type":"array","items":{"type":"object","properties":{"minimum":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"percent":{"type":"integer","minimum":0,"maximum":75}},"required":["minimum","percent"]},"maxItems":100},"BONUS_WELCOME_PERCENT":{"type":"integer","minimum":0,"maximum":1000},"BONUS_REFERRAL_REWARD":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_REFERRAL_MIN_DEPOSIT":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_MAX_PER_DEPOSIT":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_MAX_BALANCE":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"BONUS_EXPIRATION_DAYS":{"type":"integer","minimum":0,"maximum":36500}},"required":["BONUS_DEPOSIT_TIERS","BONUS_WELCOME_PERCENT","BONUS_REFERRAL_REWARD","BONUS_REFERRAL_MIN_DEPOSIT","BONUS_MAX_PER_DEPOSIT","BONUS_MAX_BALANCE","BONUS_EXPIRATION_DAYS"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/settings/jurisdictions/{jurisdiction}/product":{"get":{"operationId":"getAdminProductSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"minimumStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"suggestedStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"stakeStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMarginStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMinimumMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdSuggestedMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumDeposit":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumWithdrawal":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"depositPresets":{"type":"array","items":{"type":"number","exclusiveMinimum":0,"maximum":9999999999.99},"minItems":1,"maxItems":30},"initialDemoBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["minimumStake","suggestedStake","stakeStep","minimumDeposit","minimumWithdrawal","depositPresets","initialDemoBalance"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"put":{"operationId":"updateAdminProductSettings","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["AR","BR"]},"required":true,"name":"jurisdiction","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"minimumStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"suggestedStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"stakeStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMarginStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMinimumMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdSuggestedMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumDeposit":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumWithdrawal":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"depositPresets":{"type":"array","items":{"type":"number","exclusiveMinimum":0,"maximum":9999999999.99},"minItems":1,"maxItems":30},"initialDemoBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["minimumStake","suggestedStake","stakeStep","minimumDeposit","minimumWithdrawal","depositPresets","initialDemoBalance"]}},"required":["version","value"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0},"value":{"type":"object","properties":{"minimumStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"suggestedStake":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"stakeStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMarginStep":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdMinimumMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"cfdSuggestedMargin":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumDeposit":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"minimumWithdrawal":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"},"depositPresets":{"type":"array","items":{"type":"number","exclusiveMinimum":0,"maximum":9999999999.99},"minItems":1,"maxItems":30},"initialDemoBalance":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d{1,2})?$"}},"required":["minimumStake","suggestedStake","stakeStep","minimumDeposit","minimumWithdrawal","depositPresets","initialDemoBalance"]}},"required":["version","value"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/instruments":{"get":{"operationId":"listAdminInstruments","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"archived","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeArchived","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"optionsPriority":{"type":"integer","minimum":0,"maximum":2147483647},"cfdPriority":{"type":"integer","minimum":0,"maximum":2147483647},"enabled":{"type":"boolean"},"payoutBps":{"type":"integer","minimum":0,"maximum":10000},"spreadFloor":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"spreadLimit":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"smoothingMedianWeightBps":{"type":"number"},"jumpFilterMode":{"type":"string","enum":["MIDPOINT","BID_ASK"]},"jumpThreshold":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"id":{"type":"string","format":"uuid"},"pipSize":{"type":"string","pattern":"^(?:10{0,17}|0\\.0{0,17}1)$"},"category":{"type":"string","enum":["Forex","Metals","Crypto"]},"symbol":{"type":"string"},"precision":{"type":"integer"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":["string","null"],"format":"date-time"}},"required":["enabled","payoutBps","spreadFloor","spreadLimit","smoothingMedianWeightBps","jumpFilterMode","id","pipSize","category","symbol","precision","updatedAt","archivedAt"]}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/instruments/{id}":{"patch":{"operationId":"updateAdminInstrument","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"updatedAt":{"type":"string","format":"date-time"},"optionsPriority":{"type":"integer","minimum":0,"maximum":2147483647},"cfdPriority":{"type":"integer","minimum":0,"maximum":2147483647},"enabled":{"type":"boolean"},"payoutBps":{"type":"integer","minimum":0,"maximum":10000},"spreadFloor":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"}},"required":["updatedAt","enabled","payoutBps"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"optionsPriority":{"type":"integer","minimum":0,"maximum":2147483647},"cfdPriority":{"type":"integer","minimum":0,"maximum":2147483647},"enabled":{"type":"boolean"},"payoutBps":{"type":"integer","minimum":0,"maximum":10000},"spreadFloor":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"spreadLimit":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"smoothingMedianWeightBps":{"type":"number"},"jumpFilterMode":{"type":"string","enum":["MIDPOINT","BID_ASK"]},"jumpThreshold":{"type":["string","null"],"pattern":"^(?=.*[1-9])(?:0|[1-9]\\d{0,17})(?:\\.\\d{1,18})?$"},"id":{"type":"string","format":"uuid"},"pipSize":{"type":"string","pattern":"^(?:10{0,17}|0\\.0{0,17}1)$"},"category":{"type":"string","enum":["Forex","Metals","Crypto"]},"symbol":{"type":"string"},"precision":{"type":"integer"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":["string","null"],"format":"date-time"}},"required":["enabled","payoutBps","spreadFloor","spreadLimit","smoothingMedianWeightBps","jumpFilterMode","id","pipSize","category","symbol","precision","updatedAt","archivedAt"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/instruments/{id}/archive":{"post":{"operationId":"archiveAdminInstrument","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"updatedAt":{"type":"string","format":"date-time"}},"required":["updatedAt"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"archivedIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["archivedIds"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-calibrations":{"get":{"operationId":"listAdminMarketCalibrations","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":["integer","null"],"minimum":0,"maximum":100000,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarketCalibrationRun"}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"post":{"operationId":"startAdminMarketCalibration","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instrumentIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100}},"required":["instrumentIds"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCalibrationDetail"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-calibrations/{id}":{"get":{"operationId":"getAdminMarketCalibration","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCalibrationDetail"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}},"delete":{"operationId":"deleteAdminMarketCalibration","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-calibrations/{id}/stop":{"post":{"operationId":"stopAdminMarketCalibration","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCalibrationDetail"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-calibrations/{id}/apply":{"post":{"operationId":"applyAdminMarketCalibration","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instrumentIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100},"acknowledgePartial":{"type":"boolean","default":false}},"required":["instrumentIds"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCalibrationDetail"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/market-calibrations/{id}/restore":{"post":{"operationId":"restoreAdminMarketCalibration","tags":["admin-settings"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instrumentIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100}},"required":["instrumentIds"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCalibrationDetail"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"409":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}},"503":{"description":"Request failed","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","code","message"]}}}}}}},"/api/v1/admin/partners/session":{"get":{"operationId":"getPartnerSession","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Partner scope from the verified Clerk token","content":{"application/json":{"schema":{"type":"object","properties":{"partnerId":{"type":["string","null"],"format":"uuid"}},"required":["partnerId"]}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/admin/partners":{"get":{"operationId":"listAdminPartners","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Partners ordered by name","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminPartner"}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createAdminPartner","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAdminPartnerInput"}}}},"responses":{"201":{"description":"Created partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPartner"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/admin/partners/{id}":{"patch":{"operationId":"updateAdminPartner","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAdminPartnerInput"}}}},"responses":{"200":{"description":"Updated partner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPartner"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"archiveAdminPartner","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Partner archived; attribution history retained"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/admin/partners/{id}/metrics":{"get":{"operationId":"getAdminPartnerMetrics","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^[A-Z]{2}$"},"required":true,"name":"jurisdiction","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Partner metrics for [from, to) with UTC buckets. Admins use the path ID; partners are scoped by their signed Clerk claim.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerMetrics"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}