openapi: 3.1.0 info: title: Dexwize Partner Service version: 1.0.0 description: > Channel model (E23): partner hierarchy NewTurn → distributor → reseller or MSP → customer tenant, onboarding lifecycle, entitlement pools, customer onboarding, offline license requests, deal registration, customer-granted delegations (tenancy rule 7), brand studio (co-brand and white-label), commission statements and XLAs. Authorization: NewTurn means a non-JIT platform-tenant operator session; a partner admin sees only its own partner and everything downstream. Anything not visible to the caller returns 404. servers: - url: https://api.dexwize.example security: - bearer: [] paths: /v1/partners: get: summary: Partners visible to the caller (NewTurn all; partner admin own subtree) operationId: listPartners parameters: - name: includeClosed in: query description: Also list closed partners (home tenant offboarded). Default false. schema: type: boolean default: false responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Partner' post: summary: Register a partner (NewTurn anywhere; distributor admin under itself) operationId: registerPartner requestBody: required: true content: application/json: schema: type: object required: - name - type - program - homeTenantId properties: parentPartnerId: type: - string - 'null' format: uuid name: type: string minLength: 1 maxLength: 200 type: $ref: '#/components/schemas/PartnerType' program: $ref: '#/components/schemas/PartnerProgram' homeTenantId: type: string format: uuid responses: '201': description: Registered content: application/json: schema: $ref: '#/components/schemas/Partner' '400': $ref: '#/components/responses/Rule' '403': description: Only NewTurn registers top-level partners '404': description: Parent not visible /v1/partners/summary: get: summary: "Every partner with its device pool and the configured margin bands (NewTurn only; vendor portal)" operationId: partnerSummary parameters: - name: includeClosed in: query description: Also list closed partners (home tenant offboarded). Default false. schema: type: boolean default: false responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PartnerSummaryResponse' '403': description: NewTurn only /v1/partners/{id}: get: operationId: getPartner parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '404': description: Not found or not visible /v1/partners/{id}/kyc/submit: post: summary: Partner submits KYC operationId: submitKyc parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '400': $ref: '#/components/responses/Rule' '404': description: Not found /v1/partners/{id}/kyc/approve: post: summary: NewTurn approves KYC operationId: approveKyc parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '403': description: NewTurn only '404': description: Not found /v1/partners/{id}/agreement: post: summary: Partner accepts the agreement (KYC must be approved) operationId: acceptAgreement parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: type: object required: - version properties: version: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '400': $ref: '#/components/responses/Rule' '404': description: Not found /v1/partners/{id}/activate: post: summary: NewTurn activates with commercial terms inside the configured margin bands operationId: activatePartner parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Terms' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '400': $ref: '#/components/responses/Rule' '403': description: NewTurn only '404': description: Not found /v1/partners/{id}/terms: put: operationId: updateTerms parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Terms' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '400': $ref: '#/components/responses/Rule' '403': description: NewTurn only /v1/partners/{id}/suspend: post: operationId: suspendPartner parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '403': description: NewTurn only /v1/partners/{id}/reinstate: post: operationId: reinstatePartner parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '403': description: NewTurn only /v1/partners/{id}/certified-headcount: put: operationId: reportCertifiedHeadcount description: > academy-service reports the partner's valid certified people per level (service token with certification_reporter). Counts only; changed counts are audited on the partner's home tenant. parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: type: object required: [associate, professional, expert] properties: associate: { type: integer, minimum: 0 } professional: { type: integer, minimum: 0 } expert: { type: integer, minimum: 0 } responses: '204': { description: Stored } '403': { description: Not the academy service identity } '404': { description: Unknown partner } /v1/partners/{id}/certificate-brand: get: operationId: getCertificateBrand description: > The effective brand academy-service puts on the partner's certificates and their verification page (service token with brand_reader). Co-brand partners keep the product brand with their name and logo alongside; white-label partners get their product name, logo, colours and verified domain only while they meet the white-label certification rule; anything else (inactive, no brand profile) gets the default brand. parameters: - $ref: '#/components/parameters/Id' responses: '200': description: The effective brand content: application/json: schema: type: object required: [mode, partnerName] properties: mode: { type: string, enum: [Default, CoBrand, WhiteLabel] } partnerName: { type: string } productName: { type: [string, 'null'] } coBrandName: { type: [string, 'null'] } logoAssetId: { type: [string, 'null'] } colors: { type: [object, 'null'], additionalProperties: { type: string } } verifiedDomain: { type: [string, 'null'] } '403': { description: Not a service identity with brand_reader } '404': { description: Unknown partner } /v1/internal/channel-attribution: get: operationId: getChannelAttributionInternal summary: Channel attribution for platform KPIs (operator-console only) description: > Platform-level service token with the service-only role revenue_kpi_reader (operator-console, ADR-0050). Every partner's type, program, parent and status, and the customer tenants each partner onboarded (the link only, no customer names). Not routed through the gateway. responses: '200': description: Partners and partner-onboarded customers content: application/json: schema: type: object required: [partners, customers] properties: partners: type: array items: type: object required: [id, name, type, program, parentPartnerId, status] properties: id: { type: string, format: uuid } name: { type: string } type: { type: string, enum: [Distributor, Reseller, Msp] } program: { type: string, enum: [CoBrand, WhiteLabel] } parentPartnerId: { type: [string, 'null'], format: uuid } status: { type: string } customers: type: array items: type: object required: [tenantId, partnerId, onboardedAt] properties: tenantId: { type: string, format: uuid } partnerId: { type: string, format: uuid } onboardedAt: { type: string, format: date-time } '403': { description: Not a platform-level service token with revenue_kpi_reader } /v1/partners/{id}/eligibility: get: operationId: getCertificationEligibility description: Which capabilities (for example white_label) the partner's certified staff unlock under the tier rules. parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Headcount, capabilities and the configured rules content: application/json: schema: type: object required: [partnerId, headcount, capabilities, rules] properties: partnerId: { type: string, format: uuid } headcount: type: object properties: associate: { type: integer } professional: { type: integer } expert: { type: integer } updatedAt: { type: string, format: date-time } capabilities: { type: object, additionalProperties: { type: boolean } } rules: type: array items: type: object properties: capability: { type: string } level: { type: string, enum: [Associate, Professional, Expert] } minimum: { type: integer } '404': { description: Not found or not visible } /v1/partners/{id}/certification: put: operationId: setCertification parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: type: object properties: level: enum: - None - Associate - Professional - Expert responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Partner' '403': description: NewTurn only /v1/partners/{id}/entitlements: get: summary: Pool and ledger operationId: getEntitlements parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: type: object properties: partnerId: type: string format: uuid allocated: type: integer drawn: type: integer available: type: integer ledger: type: array items: $ref: '#/components/schemas/EntitlementEntry' '404': description: Not visible /v1/partners/{id}/entitlements/allocate: post: summary: NewTurn allocates devices to a partner pool operationId: allocate parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Movement' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/EntitlementPool' '400': $ref: '#/components/responses/Rule' '403': description: NewTurn only /v1/partners/{id}/entitlements/sub-allocate: post: summary: A distributor passes devices to a direct downstream partner operationId: subAllocate parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: allOf: - $ref: '#/components/schemas/Movement' properties: toPartnerId: type: string format: uuid responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/EntitlementPool' '404': description: Not a direct child '409': description: insufficient_entitlement /v1/partners/{id}/entitlements/release: post: summary: "NewTurn returns drawn devices to a partner pool (customer left or licence expired; audited entitlement.released)" description: >- Writes an append-only Release ledger entry that lowers drawn by the quantity, so the devices become available again. Drawn never goes below zero: releasing more than was drawn is refused and changes nothing. The reference says why. operationId: release parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Movement' responses: '200': description: The pool after the release content: application/json: schema: $ref: '#/components/schemas/EntitlementPool' '400': $ref: '#/components/responses/Rule' '403': description: NewTurn only '404': description: Not visible '409': description: release_exceeds_drawn (more than the partner has drawn) /v1/partners/{id}/customers: get: summary: Customers of the partner subtree operationId: listCustomers parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerTenant' post: summary: Onboard a customer; draws from the pool, creates the tenant and its partner-sold subscription description: > First subscription-service checks the partner-sold subscription (plan, devices against the published catalogue's minimums, per-device plans only); a refusal is a 400 and a failed check a 503, and in both cases nothing is drawn or created. Then tenant-service creates the tenant with the caller's own token (a partner admin only under its own partner id; NewTurn with TenantCreate). Its refusal is returned after the draw is released (400 with its validation message, or 403). customer-hosted becomes an air-gapped tenant, the UAE regions shared SaaS. The customer row commits with a Pending subscription request, which partner-service sends at once with its own service token (ADR-0014 amendment 2026-11-21): plan = planId, quantity = devices, reseller = this partner, term = the catalogue's minimum from the first day of the onboarding month (UTC), monthly, not prepaid. The 201 shows the outcome in `subscription`; a Pending one is retried in the background until it is Active or Failed. operationId: onboardCustomer parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: type: object required: - name - region - planId - devices properties: name: type: string region: type: string planId: type: string minLength: 1 maxLength: 64 description: A per-device catalogue plan (essentials, professional, enterprise); quote-only plans are set up by NewTurn. devices: type: integer minimum: 1 responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/CustomerTenant' '400': description: > Business rule violation, tenant-service's validation message (key `tenant`), or subscription-service's refusal of the subscription (key `subscription`, for example "Minimum quantity is 100 devices.") '403': description: tenant-service refused the caller '409': description: insufficient_entitlement '503': description: subscription_check_unavailable (subscription-service could not check the subscription; nothing was drawn or created) /v1/partners/{id}/customers/{tenantId}/subscription: post: summary: Request (again) a customer's partner-sold subscription description: > For a customer onboarded before partner-service created subscriptions (planId required; the term starts in the onboarding month), after a refusal (Failed; planId may change the plan), or to retry a Pending one now (its plan cannot change). An Active subscription is returned unchanged and nothing is called. The quantity is the customer's devices. The owning partner's admin or NewTurn; any other caller, or a customer of another partner, gets 404. Audited as partner.customer_subscription_requested on the partner's chain. operationId: requestCustomerSubscription parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/TenantId' requestBody: required: false content: application/json: schema: type: object properties: planId: type: - string - 'null' maxLength: 64 responses: '200': description: The customer with its subscription after the attempt (Active, Pending with lastError and nextAttemptAt, or Failed) content: application/json: schema: $ref: '#/components/schemas/CustomerTenant' '400': description: No plan for a customer without a subscription, a plan change while Pending, or subscription-service's refusal '404': description: Not the caller's partner or not its customer '503': description: subscription_check_unavailable /v1/partners/{id}/license-requests: post: summary: Offline (air-gapped) license request against the pool; NewTurn signs, partners never do operationId: requestLicense parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: type: object required: - installationId - edition - devices properties: installationId: type: string maxLength: 128 edition: type: string devices: type: integer responses: '202': description: Accepted for signing '409': description: insufficient_entitlement /v1/partners/{id}/deals: get: operationId: listDeals parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/DealRegistration' post: summary: Register a deal for a customer domain (first valid registration wins until expiry) operationId: registerDeal parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: type: object required: - customerDomain - customerName properties: customerDomain: type: string customerName: type: string responses: '200': description: Already registered by this partner content: application/json: schema: $ref: '#/components/schemas/DealRegistration' '201': description: Registered content: application/json: schema: $ref: '#/components/schemas/DealRegistration' '409': description: domain_already_registered (the other partner is never disclosed) /v1/deals/override: post: summary: NewTurn reassigns a domain; audited with a mandatory reason operationId: overrideDeal requestBody: required: true content: application/json: schema: type: object required: - customerDomain - customerName - partnerId - reason properties: customerDomain: type: string customerName: type: string partnerId: type: string format: uuid reason: type: string maxLength: 500 responses: '200': description: OK content: application/json: schema: type: object properties: registration: $ref: '#/components/schemas/DealRegistration' replaced: type: array items: type: string format: uuid '403': description: NewTurn only /v1/delegations: get: summary: Customer admin sees own tenant's delegations; partner admin sees those granted to it operationId: listDelegations responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Delegation' '403': description: Neither post: summary: Customer tenant admin grants a partner time-bound access (1 hour to 90 days) operationId: grantDelegation requestBody: required: true content: application/json: schema: type: object required: - partnerId - scopes - expiresAt properties: partnerId: type: string format: uuid scopes: type: array minItems: 1 items: $ref: '#/components/schemas/DelegationScope' expiresAt: type: string format: date-time responses: '201': description: Granted content: application/json: schema: $ref: '#/components/schemas/Delegation' '400': description: Invalid window or scopes '403': description: Not the customer's tenant admin '404': description: Partner not found or inactive /v1/delegations/{id}: delete: operationId: revokeDelegation parameters: - $ref: '#/components/parameters/Id' responses: '204': description: Revoked '404': description: Not this tenant's delegation '409': description: already_revoked /v1/delegations/check: get: summary: Reusable delegation check (HttpDelegationChecker). 200 only when allowed; otherwise 404. operationId: checkDelegation parameters: - name: tenantId in: query required: true schema: type: string format: uuid - name: partnerId in: query required: true schema: type: string format: uuid - name: scope in: query required: true schema: $ref: '#/components/schemas/DelegationScope' responses: '200': description: Allowed content: application/json: schema: type: object properties: allowed: const: true expiresAt: type: string format: date-time '404': description: Not allowed /v1/partners/{id}/brand: get: operationId: getBrand parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/BrandProfile' '404': description: None put: summary: Save a brand profile (validated per program, WCAG AA contrast) operationId: putBrand parameters: - $ref: '#/components/parameters/Id' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Brand' responses: '200': description: Saved, with contrast report content: application/json: schema: type: object properties: profile: $ref: '#/components/schemas/BrandProfile' contrast: type: array items: $ref: '#/components/schemas/ContrastCheck' '400': description: Validation errors /v1/partners/{id}/brand/assets: get: summary: The partner's uploaded logos (the partner itself or NewTurn) operationId: listBrandAssets parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/BrandAsset' '404': { description: Unknown or not visible partner } post: summary: Upload a logo variant (the partner itself or NewTurn) description: >- The body is the raw image: a static PNG or WebP (no SVG and no animation) of at most 512 KiB. Light and Dark logos are 64-2048 pixels wide and 16-1024 tall, at least as wide as tall and at most ten times wider; an Icon is square, 192-1024 pixels. The image is decoded and re-encoded as a new PNG on the server, so no metadata or extra data from the upload is kept; the asset id is the hash of that PNG, so uploading the same image again returns the same asset. Reference it from the brand profile (logoAssetId, logoDarkAssetId, iconAssetId) to publish it. operationId: uploadBrandAsset parameters: - $ref: '#/components/parameters/Id' - name: variant in: query required: true schema: { $ref: '#/components/schemas/LogoVariant' } requestBody: required: true content: image/png: schema: { type: string, format: binary } image/webp: schema: { type: string, format: binary } responses: '201': description: Stored content: application/json: schema: $ref: '#/components/schemas/BrandAsset' '400': { description: Not an acceptable image (the reason is in the problem details) } '404': { description: Unknown or not visible partner } '413': { description: Larger than 512 KiB } '415': { description: Not image/png or image/webp } /v1/partners/{id}/brand/assets/{assetId}: get: summary: One of the partner's logos, published or not (the partner itself or NewTurn; for previews in the brand studio) operationId: getBrandAsset parameters: - $ref: '#/components/parameters/Id' - $ref: '#/components/parameters/AssetId' responses: '200': description: The PNG (Cache-Control private, max-age=31536000, immutable) content: image/png: schema: { type: string, format: binary } '404': { description: Unknown asset or partner } /v1/partners/{id}/domain/challenge: get: summary: DNS records a white-label partner must publish operationId: domainChallenge parameters: - $ref: '#/components/parameters/Id' responses: '200': description: OK content: application/json: schema: type: object properties: domain: type: string cname: type: object properties: name: type: string target: type: string txt: type: object properties: name: type: string value: type: string spf: type: string dkim: type: string '404': description: Not white-label or no domain /v1/partners/{id}/domain/verify: post: summary: Verify CNAME, ownership TXT, SPF, DKIM; request TLS when ownership is proven description: > Real DNS lookups without caching. Once ownership is proven, the custom domain is created in Azure Front Door with a managed certificate; while Front Door validates it, problems name the _dnsauth. TXT token to add. Repeat until certificate is Issued (the domain is then on the portal route). operationId: verifyDomain parameters: - $ref: '#/components/parameters/Id' responses: '200': description: Verification result content: application/json: schema: $ref: '#/components/schemas/DomainVerification' /v1/partners/{id}/commissions/{year}/{month}: get: summary: Monthly commission statement (payee or NewTurn only) operationId: commissionStatement parameters: - $ref: '#/components/parameters/Id' - name: year in: path required: true schema: type: integer - name: month in: path required: true schema: type: integer responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/CommissionStatement' '400': description: invalid_period '404': description: Not the payee /v1/commissions/{year}/{month}/payouts.csv: get: summary: Payout report for all partners (NewTurn only) operationId: payoutCsv parameters: - name: year in: path required: true schema: type: integer - name: month in: path required: true schema: type: integer responses: '200': description: CSV content: text/csv: schema: type: string '403': description: NewTurn only /v1/customers/{tenantId}/xlas: get: operationId: listXlas parameters: - $ref: '#/components/parameters/TenantId' responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/XlaTarget' '404': description: Not owned by caller branch post: operationId: addXla parameters: - $ref: '#/components/parameters/TenantId' requestBody: required: true content: application/json: schema: type: object required: - metric - comparison - target properties: metric: enum: - ExperienceScore - BootTimeP50Seconds - CrashesPer100DevicesPerWeek - HangsPer100DevicesPerWeek comparison: enum: - AtLeast - AtMost target: type: number responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/XlaTarget' '400': $ref: '#/components/responses/Rule' /v1/customers/{tenantId}/xlas/{xlaId}: delete: operationId: removeXla parameters: - $ref: '#/components/parameters/TenantId' - name: xlaId in: path required: true schema: type: string format: uuid responses: '204': description: Removed '404': description: Not found /v1/customers/{tenantId}/xla-report/{year}/{month}: get: operationId: xlaReport parameters: - $ref: '#/components/parameters/TenantId' - name: year in: path required: true schema: type: integer - name: month in: path required: true schema: type: integer responses: '200': description: Met, missed and no-data per target content: application/json: schema: type: object properties: tenantId: type: string format: uuid periodStart: type: string format: date periodEnd: type: string format: date met: type: integer missed: type: integer noData: type: integer results: type: array items: $ref: '#/components/schemas/XlaResult' /v1/branding/by-host: get: summary: Public brand for a verified white-label custom domain (anonymous; used by the SPA before sign-in) description: >- Only verified domains of active white-label partners resolve; unknown and unverified hosts are both 404. Cached for 60 seconds (Cache-Control public, max-age=60) and rate-limited to 60 requests per minute per client IP, in addition to gateway limits. operationId: brandByHost security: [] parameters: - name: host in: query required: true description: Host name; any port is ignored schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PublicBrand' '400': description: Missing or invalid host '404': description: No verified brand for this host '429': description: Rate limit exceeded /v1/branding/tenant: get: summary: The agent-surface brand of the caller's own tenant (TenantRead; ADR-0049) description: >- For enrollment-service (agent tray names in the device config) and employee-agent-service (Teams replies and app package), with tenant-scoped service tokens. The tenant comes from the token. A tenant without an active owning partner gets the default brand; a co-brand partner's tenant keeps the product and agent names and adds the partner name; a white-label partner's tenant gets the partner's product and agent names while the partner meets the white-label certification rule, and its verified custom domain as the website. operationId: tenantBrand responses: '200': description: OK content: application/json: schema: type: object required: [mode, productName, agentName] properties: mode: { type: string, enum: [Default, CoBrand, WhiteLabel] } productName: { type: string } agentName: { type: string } coBrandName: { type: [string, 'null'] } website: { type: [string, 'null'], format: uri } logoAssetId: type: [string, 'null'] description: The partner's light logo (co-brand and white-label); read it from GET /v1/branding/assets/{assetId} logoDarkAssetId: { type: [string, 'null'] } iconAssetId: { type: [string, 'null'] } '403': description: The caller lacks TenantRead /v1/branding/assets/{assetId}: get: summary: A published partner logo (anonymous; content-addressed and immutable) description: >- Serves a logo only after a saved brand profile has referenced it (verification pages, white-label sign-in pages, report and certificate rendering and the Teams package need it without a user token). Unpublished uploads are 404 here. The bytes never change for an id, so responses are cacheable for a year (Cache-Control public, max-age=31536000, immutable) with the id as the ETag. Rate-limited to 300 requests per minute per client IP. operationId: publicBrandAsset security: [] parameters: - $ref: '#/components/parameters/AssetId' responses: '200': description: The PNG content: image/png: schema: { type: string, format: binary } '304': { description: Not modified (If-None-Match matched) } '404': { description: Unknown or unpublished asset } '429': { description: Rate limit exceeded } /v1/partners/{id}/marketplace/listings: parameters: - $ref: '#/components/parameters/Id' get: summary: The partner's marketplace submissions in every state (the partner itself or NewTurn) operationId: listPartnerListings responses: '200': description: Listings content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/MarketplaceListing' } } '404': { description: Not visible } post: summary: Submit content in the library format for review (the partner's own admin; active partners only) operationId: submitListing requestBody: required: true content: application/json: schema: type: object required: [manifest, summary, monthlyPricePerInstall, currency] properties: manifest: { type: string, contentEncoding: base64 } summary: { type: string, maxLength: 2000 } monthlyPricePerInstall: { type: number, minimum: 0, maximum: 10000 } currency: { type: string, pattern: '^[A-Z]{3}$' } responses: '201': description: Submitted content: application/json: schema: { $ref: '#/components/schemas/MarketplaceListing' } '400': { $ref: '#/components/responses/Rule' } '404': { description: Not the caller's partner } '409': { description: This action id and version was already submitted } '422': { description: An automated check failed (checks_failed) } /v1/partners/{id}/marketplace/listings/{listingId}/withdraw: parameters: - $ref: '#/components/parameters/Id' - { name: listingId, in: path, required: true, schema: { type: string, format: uuid } } post: summary: Withdraw a submission or an approved listing (no new installs afterwards) operationId: withdrawListing responses: '200': description: Withdrawn content: application/json: schema: { $ref: '#/components/schemas/MarketplaceListing' } '404': { description: Not found } '409': { description: Invalid transition } /v1/partners/{id}/marketplace/revenue/{year}/{month}: parameters: - $ref: '#/components/parameters/Id' - { name: year, in: path, required: true, schema: { type: integer } } - { name: month, in: path, required: true, schema: { type: integer, minimum: 1, maximum: 12 } } get: summary: Revenue share per install for the month (the partner itself or NewTurn) operationId: getMarketplaceRevenue responses: '200': description: Statement content: application/json: schema: { $ref: '#/components/schemas/MarketplaceRevenueStatement' } '400': { description: Invalid period } '404': { description: Not visible } /v1/partner-content/review: get: summary: Review queue of submitted and in-review listings (NewTurn operators) operationId: listReviewQueue responses: '200': description: Queue, oldest first content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/MarketplaceListing' } } '403': { description: Not a platform operator } /v1/partner-content/review/{listingId}/{decision}: parameters: - { name: listingId, in: path, required: true, schema: { type: string, format: uuid } } - { name: decision, in: path, required: true, schema: { type: string, enum: [start, approve, reject] } } post: summary: "Start review, approve (content-service signs the reviewed bytes) or reject with a note (NewTurn operators)" operationId: reviewListing requestBody: content: application/json: schema: type: object properties: note: { type: string } scriptReviewed: { type: boolean, default: false } responses: '200': description: The listing after the transition content: application/json: schema: { $ref: '#/components/schemas/MarketplaceListing' } '400': { $ref: '#/components/responses/Rule' } '403': { description: Not a platform operator } '404': { description: Not found } '409': { description: Invalid transition } /v1/partner-content/listings: get: summary: Approved partner content customers can install (TenantRead) operationId: listCatalogue responses: '200': description: Catalogue content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/CatalogueEntry' } } /v1/partner-content/installs: get: summary: The tenant's installs including uninstalled ones (TenantRead) operationId: listInstalls responses: '200': description: Installs content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/MarketplaceInstall' } } post: summary: Install an approved listing for the caller's tenant (tenant admin) operationId: installListing requestBody: required: true content: application/json: schema: type: object required: [listingId] properties: listingId: { type: string, format: uuid } responses: '201': description: Installed content: application/json: schema: { $ref: '#/components/schemas/MarketplaceInstall' } '403': { description: Not a tenant admin } '404': { description: No approved listing with that id } '409': { description: Already installed } /v1/partner-content/installs/{installId}: parameters: - { name: installId, in: path, required: true, schema: { type: string, format: uuid } } delete: summary: Uninstall (tenant admin); the row is kept for revenue history operationId: uninstallListing responses: '204': { description: Uninstalled } '404': { description: Not an active install of this tenant } /v1/partner-content/installs/{installId}/signed: parameters: - { name: installId, in: path, required: true, schema: { type: string, format: uuid } } get: summary: The NewTurn-signed document of an active install operationId: getInstalledSigned responses: '200': description: Signed document content: application/json: schema: { $ref: '#/components/schemas/MarketplaceSignedDocument' } '404': { description: Not an active install of this tenant } /v1/trust/public: get: summary: Public Trust page (anonymous) with non-confidential documents, the status link and what is available under NDA operationId: getTrustPublic security: [] responses: '200': description: Public view content: application/json: schema: { $ref: '#/components/schemas/TrustPublicView' } /v1/trust/public/documents/{id}/content: get: summary: Content of a non-confidential document (anonymous) operationId: getTrustPublicContent security: [] parameters: - { name: id, in: path, required: true, schema: { type: string, format: uuid } } responses: '200': description: The file content: application/octet-stream: schema: { type: string, format: binary } '404': { description: Unknown or confidential document } /v1/trust/documents: get: summary: Latest version of every Trust Center document with whether the caller may download it operationId: listTrustDocuments responses: '200': description: Documents content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/TrustDocumentView' } } '403': { description: "Not a customer admin, auditor or partner admin acting for themselves" } /v1/trust/nda: get: summary: Current click-through NDA and whether the caller accepted this version operationId: getTrustNda responses: '200': description: NDA content: application/json: schema: { $ref: '#/components/schemas/NdaView' } '403': { description: Not allowed } /v1/trust/nda/accept: post: summary: Accept the NDA version shown (recorded with user, tenant, time and version) operationId: acceptTrustNda requestBody: required: true content: application/json: schema: type: object required: [version] properties: version: { type: string } responses: '200': description: Accepted content: application/json: schema: { $ref: '#/components/schemas/NdaView' } '400': { description: The NDA changed since it was shown } '403': { description: Not allowed } /v1/trust/access-requests: get: summary: Access requests of the caller tenant operationId: listTrustAccessRequests responses: '200': description: Requests content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/TrustAccessRequest' } } '403': { description: Not allowed } post: summary: Request access to confidential documents (needs the current NDA) operationId: requestTrustAccess requestBody: required: true content: application/json: schema: type: object required: [kinds, reason] properties: kinds: { type: array, minItems: 1, items: { $ref: '#/components/schemas/TrustDocumentKind' } } reason: { type: string, minLength: 10, maxLength: 500 } responses: '201': description: Pending request content: application/json: schema: { $ref: '#/components/schemas/TrustAccessRequest' } '400': { description: Invalid request or NDA not accepted } '403': { description: Not allowed } /v1/trust/documents/{id}/download: get: summary: Download a document; audited. PDFs carry the watermark on every page and Markdown as a leading quote; the text is also in X-Dexwize-Watermark operationId: downloadTrustDocument parameters: - { name: id, in: path, required: true, schema: { type: string, format: uuid } } responses: '200': description: The watermarked file (headers X-Dexwize-Watermark, X-Dexwize-Sha256 of the published file, X-Dexwize-Served-Sha256 of the bytes served) content: application/octet-stream: schema: { type: string, format: binary } '403': { description: NDA not accepted or no approved request for this document } '404': { description: Unknown document } /v1/trust/admin/documents: post: summary: Publish a new immutable document version (NewTurn operators) operationId: publishTrustDocument requestBody: required: true content: application/json: schema: type: object required: [kind, title, confidential, fileName, contentType, contentBase64] properties: kind: { $ref: '#/components/schemas/TrustDocumentKind' } title: { type: string, maxLength: 200 } confidential: { type: boolean } fileName: { type: string, maxLength: 120 } contentType: { type: string, enum: [application/pdf, text/csv, text/markdown, application/vnd.openxmlformats-officedocument.wordprocessingml.document] } contentBase64: { type: string } responses: '201': description: Published version content: application/json: schema: { $ref: '#/components/schemas/TrustDocumentView' } '400': { description: Invalid document } '403': { description: Not a platform operator } /v1/trust/admin/access-requests: get: summary: Access requests for review (NewTurn operators) operationId: listTrustReviewQueue parameters: - { name: status, in: query, schema: { $ref: '#/components/schemas/TrustAccessStatus' } } responses: '200': description: Requests, oldest first content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/TrustAccessRequest' } } '403': { description: Not a platform operator } /v1/trust/admin/access-requests/{id}/{decision}: parameters: - { name: id, in: path, required: true, schema: { type: string, format: uuid } } - { name: decision, in: path, required: true, schema: { type: string, enum: [approve, reject] } } post: summary: Approve (access for the configured validity) or reject a pending request (NewTurn operators) operationId: decideTrustAccess requestBody: content: application/json: schema: type: object properties: note: { type: string, maxLength: 500 } responses: '200': description: Decided request content: application/json: schema: { $ref: '#/components/schemas/TrustAccessRequest' } '403': { description: Not a platform operator } '404': { description: Unknown request } '409': { description: Already decided } /v1/trust/admin/downloads: get: summary: Download records with their watermark text (NewTurn operators) operationId: listTrustDownloads parameters: - { name: tenantId, in: query, schema: { type: string, format: uuid } } responses: '200': description: Downloads content: application/json: schema: { type: array, items: { $ref: '#/components/schemas/TrustDownload' } } '403': { description: Not a platform operator } components: securitySchemes: bearer: type: http scheme: bearer bearerFormat: JWT parameters: Id: name: id in: path required: true schema: type: string format: uuid AssetId: name: assetId in: path required: true schema: type: string pattern: '^[0-9a-f]{32}$' TenantId: name: tenantId in: path required: true schema: type: string format: uuid responses: Rule: description: Business rule violation (validation problem) schemas: TrustDocumentKind: type: string enum: [Soc2Report, IsoCertificate, PenTestSummary, DpiaTemplate, SubProcessorList, HardeningGuide, SecurityOverview] TrustAccessStatus: type: string enum: [Pending, Approved, Rejected] TrustDocumentView: type: object required: [id, kind, title, version, confidential, fileName, contentType, sizeBytes, sha256, publishedAt, canDownload] properties: id: { type: string, format: uuid } kind: { $ref: '#/components/schemas/TrustDocumentKind' } title: { type: string } version: { type: integer } confidential: { type: boolean } fileName: { type: string } contentType: { type: string } sizeBytes: { type: integer, format: int64 } sha256: { type: string } publishedAt: { type: string, format: date-time } canDownload: { type: boolean } TrustPublicView: type: object required: [documents, underNda] properties: documents: { type: array, items: { $ref: '#/components/schemas/TrustDocumentView' } } statusPageUrl: { type: [string, 'null'] } underNda: { type: array, items: { $ref: '#/components/schemas/TrustDocumentKind' } } NdaView: type: object required: [version, text, accepted] properties: version: { type: string } text: { type: string } accepted: { type: boolean } acceptedAt: { type: [string, 'null'], format: date-time } TrustAccessRequest: type: object required: [id, tenantId, subject, kinds, reason, ndaVersion, status, requestedAt] properties: id: { type: string, format: uuid } tenantId: { type: string, format: uuid } partnerId: { type: [string, 'null'], format: uuid } subject: { type: string } kinds: { type: array, items: { $ref: '#/components/schemas/TrustDocumentKind' } } reason: { type: string } ndaVersion: { type: string } status: { $ref: '#/components/schemas/TrustAccessStatus' } requestedAt: { type: string, format: date-time } decidedBy: { type: [string, 'null'] } decidedAt: { type: [string, 'null'], format: date-time } expiresAt: { type: [string, 'null'], format: date-time } decisionNote: { type: [string, 'null'] } TrustDownload: type: object required: [id, documentId, version, tenantId, subject, at, watermark, sha256] properties: id: { type: string, format: uuid } documentId: { type: string, format: uuid } version: { type: integer } tenantId: { type: string, format: uuid } subject: { type: string } at: { type: string, format: date-time } watermark: { type: string } sha256: { type: string } PartnerType: enum: - Distributor - Reseller - Msp PartnerProgram: enum: - CoBrand - WhiteLabel DelegationScope: enum: - ReadDevices - ReadFindings - ReadReports - ManageRecommendations - Support Partner: type: object properties: id: type: string format: uuid parentPartnerId: type: - string - 'null' format: uuid name: type: string type: enum: - Distributor - Reseller - Msp program: enum: - CoBrand - WhiteLabel status: enum: - Registered - KycPending - AgreementAccepted - Active - Suspended - Closed tier: type: string certification: enum: - None - Associate - Professional - Expert marginPercent: type: number distributorOverridePercent: type: number createdAt: type: string format: date-time vatRegistered: type: boolean kycApprovedAt: description: When NewTurn approved the KYC documents; null until then type: - string - 'null' format: date-time agreementVersion: description: Partner agreement version the partner accepted; null until then type: - string - 'null' updatedAt: type: string format: date-time required: - id - parentPartnerId - name - type - program - status - tier - certification - marginPercent - distributorOverridePercent - createdAt PercentBand: type: object required: - min - max properties: min: type: number max: type: number PartnerSummaryResponse: type: object required: - marginBands - partners properties: marginBands: description: "Allowed margins (Commercial:MarginBands): co-brand and white-label sellers, and the distributor override" type: object required: - coBrand - whiteLabel - distributorOverride properties: coBrand: $ref: '#/components/schemas/PercentBand' whiteLabel: $ref: '#/components/schemas/PercentBand' distributorOverride: $ref: '#/components/schemas/PercentBand' partners: type: array items: type: object required: - partner - pool properties: partner: $ref: '#/components/schemas/Partner' pool: $ref: '#/components/schemas/EntitlementPool' Terms: type: object required: - tier - marginPercent - distributorOverridePercent - vatRegistered properties: tier: type: string marginPercent: type: number description: Must sit inside the configured band for the partner program distributorOverridePercent: type: number description: Distributors only; zero otherwise vatRegistered: type: boolean Movement: type: object required: - quantity - reference properties: quantity: type: integer minimum: 1 maximum: 1000000 reference: type: string maxLength: 200 Brand: type: object required: - productName - colors - agentDisplayName properties: productName: type: string maxLength: 60 coBrandName: type: - string - 'null' logoAssetId: type: - string - 'null' pattern: ^[0-9a-f]{32}$ description: A Light logo uploaded by this partner (POST /v1/partners/{id}/brand/assets?variant=Light) logoDarkAssetId: type: - string - 'null' pattern: ^[0-9a-f]{32}$ description: A Dark logo uploaded by this partner, drawn on dark backgrounds iconAssetId: type: - string - 'null' pattern: ^[0-9a-f]{32}$ description: A square Icon uploaded by this partner (source of the Teams app icons under white-label) colors: type: object description: Fluent brand ramp keyed 10..160 additionalProperties: type: string pattern: ^#[0-9A-Fa-f]{6}$ emailSenderAddress: type: - string - 'null' customDomain: type: - string - 'null' reportTemplateOverrides: type: object additionalProperties: type: string maxLength: 4000 agentDisplayName: type: string maxLength: 60 EntitlementPool: type: object properties: partnerId: type: string format: uuid allocated: type: integer drawn: type: integer available: type: integer required: - partnerId - allocated - drawn EntitlementEntry: type: object properties: id: type: string format: uuid partnerId: type: string format: uuid kind: enum: - Allocate - SubAllocateOut - SubAllocateIn - Draw - Release quantity: type: integer reference: type: string actor: type: string at: type: string format: date-time required: - id - partnerId - kind - quantity - reference - actor - at CustomerTenant: type: object properties: tenantId: type: string format: uuid partnerId: type: string format: uuid name: type: string devices: type: integer createdAt: type: string format: date-time subscription: description: The partner-sold subscription; null for customers onboarded before partner-service created subscriptions. oneOf: - $ref: '#/components/schemas/CustomerSubscription' - type: 'null' required: - tenantId - partnerId - name - devices - createdAt CustomerSubscription: type: object description: > Where the customer's partner-sold subscription stands in partner-service (ADR-0014 amendment 2026-11-21). Pending requests are retried with exponential backoff (30 s doubling, at most hourly) until subscription-service creates the subscription (Active) or refuses it for good (Failed). properties: status: type: string enum: [Pending, Active, Failed] planId: type: string termStart: type: string format: date subscriptionId: type: - string - 'null' format: uuid description: subscription-service's subscription id once Active attempts: type: integer minimum: 0 lastError: type: - string - 'null' description: Why the last attempt did not create it (Pending) or why it was refused (Failed) nextAttemptAt: type: - string - 'null' format: date-time description: When a Pending request is next attempted updatedAt: type: string format: date-time required: - status - planId - termStart - attempts - updatedAt DealRegistration: type: object properties: id: type: string format: uuid partnerId: type: string format: uuid customerDomain: type: string customerName: type: string registeredAt: type: string format: date-time expiresAt: type: string format: date-time status: enum: - Active - Rejected - Expired - Overridden conflictsWith: type: - string - 'null' format: uuid default: null overrideReason: type: - string - 'null' default: null overriddenBy: type: - string - 'null' default: null required: - id - partnerId - customerDomain - customerName - registeredAt - expiresAt - status Delegation: type: object properties: id: type: string format: uuid tenantId: type: string format: uuid partnerId: type: string format: uuid scopes: type: array items: enum: - ReadDevices - ReadFindings - ReadReports - ManageRecommendations - Support grantedBy: type: string grantedAt: type: string format: date-time expiresAt: type: string format: date-time revokedAt: type: - string - 'null' format: date-time default: null revokedBy: type: - string - 'null' default: null required: - id - tenantId - partnerId - scopes - grantedBy - grantedAt - expiresAt BrandProfile: type: object properties: partnerId: type: string format: uuid productName: type: string coBrandName: type: - string - 'null' logoAssetId: type: - string - 'null' logoDarkAssetId: type: - string - 'null' iconAssetId: type: - string - 'null' colors: type: object additionalProperties: type: string emailSenderAddress: type: - string - 'null' customDomain: type: - string - 'null' reportTemplateOverrides: type: object additionalProperties: type: string agentDisplayName: type: string required: - partnerId - productName - coBrandName - logoAssetId - logoDarkAssetId - iconAssetId - colors - emailSenderAddress - customDomain - reportTemplateOverrides - agentDisplayName ContrastCheck: type: object properties: pair: type: string ratio: type: number passes: type: boolean required: - pair - ratio - passes DomainVerification: type: object properties: cnameOk: type: boolean ownershipTxtOk: type: boolean spfOk: type: boolean dkimOk: type: boolean certificate: enum: - Pending - Issued - Failed problems: type: array items: type: string portalReady: type: boolean emailReady: type: boolean required: - cnameOk - ownershipTxtOk - spfOk - dkimOk - certificate - problems CommissionStatement: type: object properties: partnerId: type: string format: uuid partnerName: type: string period: type: string format: date currency: type: string lines: type: array items: type: object properties: tenantId: type: string format: uuid sellingPartnerId: type: string format: uuid sku: type: string kind: enum: - Margin - DistributorOverride netAmount: type: number ratePercent: type: number commission: type: number required: - tenantId - sellingPartnerId - sku - kind - netAmount - ratePercent - commission subtotal: type: number vatRatePercent: type: number vat: type: number total: type: number required: - partnerId - partnerName - period - currency - lines - subtotal - vatRatePercent - vat - total XlaTarget: type: object properties: id: type: string format: uuid tenantId: type: string format: uuid partnerId: type: string format: uuid metric: enum: - ExperienceScore - BootTimeP50Seconds - CrashesPer100DevicesPerWeek - HangsPer100DevicesPerWeek comparison: enum: - AtLeast - AtMost target: type: number createdBy: type: string createdAt: type: string format: date-time required: - id - tenantId - partnerId - metric - comparison - target - createdBy - createdAt XlaResult: type: object properties: target: type: object properties: id: type: string format: uuid tenantId: type: string format: uuid partnerId: type: string format: uuid metric: enum: - ExperienceScore - BootTimeP50Seconds - CrashesPer100DevicesPerWeek - HangsPer100DevicesPerWeek comparison: enum: - AtLeast - AtMost target: type: number createdBy: type: string createdAt: type: string format: date-time required: - id - tenantId - partnerId - metric - comparison - target - createdBy - createdAt actual: type: - number - 'null' outcome: enum: - Met - Missed - NoData required: - target - actual - outcome PublicBrand: type: object properties: productName: type: string coBrandName: type: - string - 'null' logoAssetId: type: - string - 'null' logoDarkAssetId: type: - string - 'null' iconAssetId: type: - string - 'null' colors: type: object additionalProperties: type: string required: - productName - coBrandName - logoAssetId - logoDarkAssetId - iconAssetId - colors BrandAsset: type: object description: >- An uploaded partner logo. The id is the first 32 hex characters of the SHA-256 of the stored PNG, which partner-service re-encoded from the upload. Published means a saved brand profile has referenced it, so the public read serves it. required: [id, partnerId, variant, width, height, bytes, createdAt, published] properties: id: { type: string, pattern: '^[0-9a-f]{32}$' } partnerId: { type: string, format: uuid } variant: { $ref: '#/components/schemas/LogoVariant' } width: { type: integer } height: { type: integer } bytes: { type: integer } createdAt: { type: string, format: date-time } published: { type: boolean } LogoVariant: type: string enum: [Light, Dark, Icon] MarketplaceSignedDocument: type: object required: [key_id, signature, document] properties: key_id: { type: string } signature: { type: string, contentEncoding: base64 } document: { type: string, contentEncoding: base64 } MarketplaceCheckResult: type: object required: [name, passed, detail] properties: name: { type: string } passed: { type: boolean } detail: { type: string } MarketplaceListing: type: object required: [id, partnerId, actionId, version, title, summary, manifest, sha256, requiresScriptReview, checks, monthlyPricePerInstall, currency, status, submittedBy, submittedAt, history] properties: id: { type: string, format: uuid } partnerId: { type: string, format: uuid } actionId: { type: string } version: { type: integer } title: { type: object, properties: { en: { type: string }, ar: { type: string } } } summary: { type: string } manifest: { type: string, contentEncoding: base64 } sha256: { type: string } requiresScriptReview: { type: boolean } checks: { type: array, items: { $ref: '#/components/schemas/MarketplaceCheckResult' } } monthlyPricePerInstall: { type: number } currency: { type: string } status: { type: string, enum: [Submitted, InReview, Approved, Rejected, Withdrawn] } submittedBy: { type: string } submittedAt: { type: string, format: date-time } history: type: array items: type: object properties: from: { type: string } to: { type: string } by: { type: string } at: { type: string, format: date-time } note: { type: [string, 'null'] } signature: oneOf: - { $ref: '#/components/schemas/MarketplaceSignedDocument' } - { type: 'null' } CatalogueEntry: type: object required: [id, partnerId, actionId, version, title, summary, monthlyPricePerInstall, currency, containsScript, sha256] properties: id: { type: string, format: uuid } partnerId: { type: string, format: uuid } actionId: { type: string } version: { type: integer } title: { type: object, properties: { en: { type: string }, ar: { type: string } } } summary: { type: string } monthlyPricePerInstall: { type: number } currency: { type: string } containsScript: { type: boolean } sha256: { type: string } MarketplaceInstall: type: object required: [id, tenantId, listingId, partnerId, installedBy, installedAt, active] properties: id: { type: string, format: uuid } tenantId: { type: string, format: uuid } listingId: { type: string, format: uuid } partnerId: { type: string, format: uuid } installedBy: { type: string } installedAt: { type: string, format: date-time } uninstalledBy: { type: [string, 'null'] } uninstalledAt: { type: [string, 'null'], format: date-time } active: { type: boolean } MarketplaceRevenueStatement: type: object required: [partnerId, period, sharePercent, lines, partnerShareByCurrency] properties: partnerId: { type: string, format: uuid } period: { type: string, format: date } sharePercent: { type: number } lines: type: array items: type: object properties: listingId: { type: string, format: uuid } actionId: { type: string } tenantId: { type: string, format: uuid } installId: { type: string, format: uuid } currency: { type: string } gross: { type: number } sharePercent: { type: number } partnerShare: { type: number } partnerShareByCurrency: { type: object, additionalProperties: { type: number } }