{"openapi":"3.1.0","info":{"title":"eBlacklist API","description":"\nCheck a cash-on-delivery buyer **before you ship**.\n\nSend the buyer's phone, name and address — and optionally the product they ordered — and\nget back a trust score from 0 (very likely to refuse the parcel) to 5 (very reliable),\na confidence level, and the reasons behind it.\n\nThe score only stays accurate if you report what happened afterwards, so every check\ncomes with a follow-up. See the developer guide for the full loop.\n\n**Privacy:** a response never reveals another seller's identity, nor any other phone,\nname or address linked to the same buyer. You get aggregate counts and reason codes.\n","license":{"name":"Proprietary"},"version":"0.1.0"},"paths":{"/health":{"get":{"tags":["health"],"summary":"Liveness","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/health/deep":{"get":{"tags":["health"],"summary":"Readiness","operationId":"health_deep_health_deep_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepHealth"}}}}}}},"/auth/beta-requests":{"post":{"tags":["auth"],"summary":"Join Beta","operationId":"join_beta_auth_beta_requests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BetaApplication"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/otp/request":{"post":{"tags":["auth"],"summary":"Send a sign-in code","description":"Emails a 6-digit code to the address given. Existing sellers and approved beta applicants can receive a sign-in code.\n\nThe response is identical whether or not an account exists — it never reveals which. Codes last 10 minutes and can be sent 3 times per address per 15 minutes.","operationId":"request_code_auth_otp_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpRequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/otp/verify":{"post":{"tags":["auth"],"summary":"Verify a sign-in code","description":"Exchanges a code for a session cookie. The account is created here on a first verification — `is_new` is then true and `onboarding_complete` false, so send the user to onboarding.\n\nA wrong, expired, used or over-attempted code all return the same 401.","operationId":"verify_code_auth_otp_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpVerify"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"tags":["auth"],"summary":"Sign out of this device","description":"Revokes the session this request authenticated with and clears the cookie. Other devices stay signed in — use `DELETE /app/sessions` for those.","operationId":"logout_auth_logout_post","responses":{"204":{"description":"Successful Response"}}}},"/app/me":{"get":{"tags":["account"],"summary":"The signed-in user and their account","operationId":"me_app_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}}}}},"/app/settings":{"patch":{"tags":["account"],"summary":"Update account settings","description":"Only the fields you send are changed.","operationId":"update_settings_app_settings_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/onboarding":{"post":{"tags":["account"],"summary":"Finish onboarding","description":"Called once after a first sign-in, with the business name, default country and language. An account is considered onboarded as soon as it has a business name.","operationId":"complete_onboarding_app_onboarding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/tokens":{"get":{"tags":["account"],"summary":"List API tokens","description":"Newest first, revoked ones included. The token itself is never returned here — it is only ever shown once, when it is created.","operationId":"list_tokens_app_tokens_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TokenOut"},"type":"array","title":"Response List Tokens App Tokens Get"}}}}}},"post":{"tags":["account"],"summary":"Create an API token","description":"Returns the full token **once**. It is stored only as a keyed hash, so it cannot be shown again — copy it now.","operationId":"create_token_app_tokens_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/tokens/{token_id}":{"delete":{"tags":["account"],"summary":"Revoke an API token","description":"Takes effect immediately. A revoked token can never be reactivated.","operationId":"revoke_token_app_tokens__token_id__delete","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/sessions":{"get":{"tags":["account"],"summary":"List signed-in devices","description":"`current: true` marks the device making this request.","operationId":"list_sessions_app_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ActiveSession"},"type":"array","title":"Response List Sessions App Sessions Get"}}}}}},"delete":{"tags":["account"],"summary":"Sign out of all other devices","description":"Keeps the device making the request signed in.","operationId":"revoke_other_sessions_app_sessions_delete","responses":{"204":{"description":"Successful Response"}}}},"/app/sessions/{revoke_id}":{"delete":{"tags":["account"],"summary":"Sign out one device","operationId":"revoke_one_session_app_sessions__revoke_id__delete","parameters":[{"name":"revoke_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Revoke Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/push/subscriptions":{"get":{"tags":["account"],"summary":"Devices registered for push","description":"Every browser this account has registered, so a seller can see where their notifications are going and remove a device they no longer use.\n\nEndpoints are returned masked: the full value is a capability — anyone holding it can push to that browser — and the seller only needs to tell their devices apart.","operationId":"list_push_subscriptions_app_push_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PushSubscriptionOut"},"type":"array","title":"Response List Push Subscriptions App Push Subscriptions Get"}}}}}}},"/app/push/subscribe":{"post":{"tags":["account"],"summary":"Register this device for push","description":"Send the browser's `PushSubscription`. Re-subscribing the same endpoint updates the existing registration rather than adding a second one.","operationId":"subscribe_push_app_push_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/push/unsubscribe":{"post":{"tags":["account"],"summary":"Remove this device","description":"Idempotent: unsubscribing an endpoint that is already gone succeeds.","operationId":"unsubscribe_push_app_push_unsubscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/push/test":{"post":{"tags":["account"],"summary":"Send a test notification","description":"Pushes to every device registered for this account. Devices the push service reports as gone are removed.","operationId":"test_push_app_push_test_post","responses":{"204":{"description":"Successful Response"}}}},"/app/stats":{"get":{"tags":["account"],"summary":"Dashboard figures","description":"Counts for the current calendar month (UTC), plus a 30-day series. Your own checks and outcomes only.","operationId":"stats_app_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsOut"}}}}}}},"/v1/checks":{"post":{"tags":["checks"],"summary":"Check a buyer before shipping","description":"Score a cash-on-delivery buyer from their phone, name and address.\n\nThe same buyer and product checked twice inside 24 hours returns the first check\nrather than a second one, so rechecking after a failed delivery attempt is free.","operationId":"create_check_v1_checks_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A fresh UUID per logical request. Replaying a key with the same body returns the original check — same id, same score, same reasons, with `followup_status` and `outcome` as they stand now. A different body under a key already used is a 409. Note that a repeat check on the same buyer and product inside the duplicate window returns the first check whatever key you send, and does not bind the key to it.","title":"Idempotency-Key"},"description":"A fresh UUID per logical request. Replaying a key with the same body returns the original check — same id, same score, same reasons, with `followup_status` and `outcome` as they stand now. A different body under a key already used is a 409. Note that a repeat check on the same buyer and product inside the duplicate window returns the first check whatever key you send, and does not bind the key to it."},{"name":"Accept-Language","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`fr`, `ar` or `en`. Defaults to your account language.","title":"Accept-Language"},"description":"`fr`, `ar` or `en`. Defaults to your account language."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckCreate"}}}},"responses":{"200":{"description":"The score, the reasons behind it, and when we will follow up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["checks"],"summary":"List your checks","description":"Your own check history. Never anyone else's, whatever the filters say.","operationId":"list_checks_v1_checks_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only checks created at or after this.","title":"From"},"description":"Only checks created at or after this."},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only checks created at or before this.","title":"To"},"description":"Only checks created at or before this."},{"name":"score","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5,"minimum":0},{"type":"null"}],"description":"Only checks with this score.","title":"Score"},"description":"Only checks with this score."},{"name":"followup_status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CheckFollowupStatus"},{"type":"null"}],"description":"Where the follow-up has got to.","title":"Followup Status"},"description":"Where the follow-up has got to."},{"name":"product_sku","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"description":"Only checks for this SKU.","title":"Product Sku"},"description":"Only checks for this SKU."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"A page of your own checks, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/checks/{check_id}":{"get":{"tags":["checks"],"summary":"Read one check","description":"One check, with the score and reasons it returned at the time.\n\nA check belonging to another seller is indistinguishable from one that does not\nexist. The score is exactly what was returned then; only the wording of the reasons\nfollows the language asked for now.","operationId":"get_check_v1_checks__check_id__get","parameters":[{"name":"check_id","in":"path","required":true,"schema":{"type":"string","description":"The `check_id` from the check response.","examples":["chk_01JCYQ8M3K7X2PQ"],"title":"Check Id"},"description":"The `check_id` from the check response."},{"name":"Accept-Language","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`fr`, `ar` or `en`. Defaults to your account language.","title":"Accept-Language"},"description":"`fr`, `ar` or `en`. Defaults to your account language."}],"responses":{"200":{"description":"The check exactly as it was answered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/checks/{check_id}/outcome":{"post":{"tags":["checks"],"summary":"Report what happened","description":"Tell us whether the parcel was accepted. This is what the score is made of.\n\nAllowed for 14 days after the check; a later answer supersedes the earlier one, so\ncorrecting an implied delivery with a refusal is always safe.","operationId":"report_outcome_v1_checks__check_id__outcome_post","parameters":[{"name":"check_id","in":"path","required":true,"schema":{"type":"string","description":"The `check_id` from the check response.","examples":["chk_01JCYQ8M3K7X2PQ"],"title":"Check Id"},"description":"The `check_id` from the check response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeCreate"}}}},"responses":{"200":{"description":"The outcome as recorded, and whether it replaced an earlier answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/outcomes/bulk":{"post":{"tags":["checks"],"summary":"Report many outcomes at once","description":"Up to 500 outcomes in one call, each succeeding or failing independently.\n\nThe right endpoint for a nightly sync from an order system: one unknown id does\nnot reject the rest of the batch.","operationId":"report_outcomes_bulk_v1_outcomes_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkOutcomeCreate"}}},"required":true},"responses":{"200":{"description":"One result per submitted item, in the order they were sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkOutcomeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/followups/pending":{"get":{"tags":["checks"],"summary":"Checks still waiting on an answer","description":"Every check you have not answered yet, with the implied-delivery deadline.\n\nAfter that deadline, silence is recorded as a delivery at reduced weight — poll\nthis daily, or let the push notification come to you.","operationId":"pending_followups_v1_followups_pending_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Oldest first: the top of the list is the closest to its deadline.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/products":{"get":{"tags":["products"],"summary":"List your catalog","description":"Your own products only. `q` matches the SKU or the title.","operationId":"list_products_v1_products_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"description":"Search SKU or title","title":"Q"},"description":"Search SKU or title"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["products"],"summary":"Add a product","description":"The SKU is yours and only has to be unique within your own catalog.\n\nThe product is usable immediately. Matching it to the shared canonical product that powers shop-around detection happens in the background, because it needs an embedding and a model call.","operationId":"create_product_v1_products_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/products/{product_id}":{"patch":{"tags":["products"],"summary":"Edit a product","operationId":"update_product_v1_products__product_id__patch","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["products"],"summary":"Remove a product","description":"Soft delete. A check made months ago still references the product, and that history has to stay readable.","operationId":"delete_product_v1_products__product_id__delete","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Product Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/products/import":{"post":{"tags":["products"],"summary":"Import a CSV","description":"Columns: `sku`, `title`, `description`, `image_url`. A known SKU is updated rather than rejected.\n\nEvery row is reported individually: a bad row does not abandon the good ones, which matters when somebody uploads six hundred products and three have a missing title.","operationId":"import_products_v1_products_import_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_products_v1_products_import_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImportOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/f/{token}":{"post":{"tags":["follow-ups"],"summary":"Report an outcome from a push action or a one-tap link","description":"Record the outcome the link names. Single use: a replay returns 401.","operationId":"redeem_f__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","minLength":16,"maxLength":512,"description":"A one-tap link.","title":"Token"},"description":"A one-tap link."},{"name":"via","in":"query","required":false,"schema":{"enum":["push","email"],"type":"string","default":"push","title":"Via"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeOut"}}}},"401":{"description":"The link is invalid, expired, or already used."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"List your webhook endpoints","description":"Your own endpoints only. Secrets are never included.","operationId":"list_webhooks_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}}}},"post":{"tags":["webhooks"],"summary":"Register a webhook endpoint","description":"Returns a `secret` you will not see again. Use it to verify the `X-EBlacklist-Signature` header on every delivery — an unverified webhook endpoint is a public API that anyone can POST a fake delivery to.\n\nThe URL must be https and on a public hostname. We refuse private and link-local addresses both now and again at send time.","operationId":"create_webhook_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}":{"get":{"tags":["webhooks"],"summary":"Read one webhook endpoint","operationId":"get_webhook_v1_webhooks__endpoint_id__get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["webhooks"],"summary":"Edit a webhook endpoint","description":"Send only the fields you are changing. The secret is never rotated by an edit — changing the URL keeps the same signing key, so a receiver that moved host does not also have to re-key.\n\n`enabled: false` drops everything currently queued for this endpoint. `enabled: true` clears the failure counter and starts it clean.","operationId":"update_webhook_v1_webhooks__endpoint_id__patch","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhooks"],"summary":"Delete a webhook endpoint","description":"Immediate and permanent. The endpoint's queued deliveries and its delivery history go with it — unlike a product, a webhook endpoint has no history any later record points at, so there is nothing to keep readable.\n\nTo stop deliveries without losing the registration, `PATCH` it with `enabled: false` instead.","operationId":"delete_webhook_v1_webhooks__endpoint_id__delete","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{endpoint_id}/test":{"post":{"tags":["webhooks"],"summary":"Send a test event","description":"Delivers one synthetic `followup.due` to this endpoint, right now, and tells you what came back. The check id is all zeroes (`chk_000…`) so your handler can recognise it; everything else — the signature, the headers, the body shape — is exactly what a real delivery looks like.\n\nOne attempt, no retries. A failure here does **not** count towards the failure budget that disables an endpoint: this is a diagnostic, not a delivery.","operationId":"test_webhook_v1_webhooks__endpoint_id__test_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActiveSession":{"properties":{"id":{"type":"string","title":"Id"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"current":{"type":"boolean","title":"Current","default":false}},"additionalProperties":false,"type":"object","required":["id","created_at","expires_at"],"title":"ActiveSession"},"BetaApplication":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"sales_url":{"type":"string","minLength":1,"format":"uri","title":"Sales Url"},"phone":{"type":"string","maxLength":32,"minLength":5,"title":"Phone"},"language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["email","sales_url","phone"],"title":"BetaApplication"},"Body_import_products_v1_products_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV with a header row"}},"type":"object","required":["file"],"title":"Body_import_products_v1_products_import_post"},"BulkOutcomeCreate":{"properties":{"outcomes":{"items":{"$ref":"#/components/schemas/BulkOutcomeItem"},"type":"array","maxItems":500,"minItems":1,"title":"Outcomes"}},"additionalProperties":false,"type":"object","required":["outcomes"],"title":"BulkOutcomeCreate"},"BulkOutcomeItem":{"properties":{"check_id":{"type":"string","title":"Check Id"},"outcome":{"type":"string","enum":["delivered","refused","returned","not_shipped"],"title":"Outcome"},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At"}},"additionalProperties":false,"type":"object","required":["check_id","outcome"],"title":"BulkOutcomeItem"},"BulkOutcomeOut":{"properties":{"results":{"items":{"$ref":"#/components/schemas/BulkOutcomeResult"},"type":"array","title":"Results"},"succeeded":{"type":"integer","title":"Succeeded"},"failed":{"type":"integer","title":"Failed"}},"additionalProperties":false,"type":"object","required":["results","succeeded","failed"],"title":"BulkOutcomeOut"},"BulkOutcomeResult":{"properties":{"check_id":{"type":"string","title":"Check Id"},"ok":{"type":"boolean","title":"Ok"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"An RFC 9457 `type` suffix when `ok` is false."}},"additionalProperties":false,"type":"object","required":["check_id","ok"],"title":"BulkOutcomeResult"},"BuyerIn":{"properties":{"phone":{"type":"string","maxLength":32,"minLength":5,"title":"Phone","description":"National or E.164 format. Parsed against `country`.","examples":["0612345678","+212612345678"]},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name","description":"As the buyer gave it. Arabic or Latin script both fine.","examples":["Mohamed El Amrani","محمد العمراني"]},"address":{"type":"string","maxLength":500,"minLength":1,"title":"Address","description":"Free text, as typed. Do not normalise it yourself — we do that better with the full picture.","examples":["Hay Salam, Rue 5, N 12, Sale"]}},"additionalProperties":false,"type":"object","required":["phone","name","address"],"title":"BuyerIn"},"CheckCreate":{"properties":{"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2,"pattern":"^[A-Za-z]{2}$"},{"type":"null"}],"title":"Country","description":"ISO 3166-1 alpha-2. Defaults to your account country.","examples":["MA"]},"buyer":{"$ref":"#/components/schemas/BuyerIn"},"product":{"anyOf":[{"$ref":"#/components/schemas/ProductIn"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["buyer"],"title":"CheckCreate"},"CheckFollowupStatus":{"type":"string","enum":["scheduled","notified","answered","implied","closed"],"title":"CheckFollowupStatus"},"CheckOut":{"properties":{"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Name"},"buyer_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Phone"},"submitted_input":{"anyOf":[{"$ref":"#/components/schemas/CheckCreate"},{"type":"null"}]},"submitted_input_reconstructed":{"type":"boolean","title":"Submitted Input Reconstructed","default":false},"address_unreadable":{"type":"boolean","title":"Address Unreadable","default":false},"score_cap":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score Cap","description":"Maximum trust band imposed by refusal history."},"check_id":{"type":"string","title":"Check Id","examples":["chk_01JCYQ8M3K7X2PQ4R5T6V7W8Y9"]},"trust_score":{"type":"integer","maximum":5.0,"minimum":0.0,"title":"Trust Score","description":"0 = very likely to refuse the parcel, 5 = very reliable."},"risk_probability":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Risk Probability","description":"The underlying probability the score is banded from."},"confidence":{"$ref":"#/components/schemas/ConfidenceLevel","description":"How much real evidence sits behind the score. A 2 with `low` confidence is mostly the local base rate; a 2 with `high` confidence is a warning."},"evidence_count":{"type":"number","minimum":0.0,"title":"Evidence Count","description":"Time-decayed evidence held, over and above the prior."},"reasons":{"items":{"$ref":"#/components/schemas/Reason"},"type":"array","title":"Reasons","description":"Up to three, ranked by contribution."},"product_signal":{"anyOf":[{"$ref":"#/components/schemas/ProductSignal"},{"type":"null"}],"description":"Present when you sent a product."},"resolution_status":{"$ref":"#/components/schemas/ResolutionStatus","default":"complete"},"superseded_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Superseded Score","description":"What this check answered BEFORE the background matching finished, when it had run out of its identity budget. Present only on a check that was `partial` and has since been completed, and only when the band actually moved — so a non-null value means the number you were first shown was not the final one.","examples":[3]},"followup_status":{"$ref":"#/components/schemas/CheckFollowupStatus","default":"scheduled"},"followup_scheduled_for":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Followup Scheduled For"},"outcome":{"anyOf":[{"$ref":"#/components/schemas/OutcomeType"},{"type":"null"}],"description":"The outcome you reported, once you have reported one."},"score_version":{"type":"string","title":"Score Version","examples":["bayes-v1.0"]},"reused":{"type":"boolean","title":"Reused","description":"True when this is a check you already had rather than a new one. A second check on the same buyer, phone and product inside `followups.duplicate_check_window_hours` reuses the first (§8), so no second follow-up is scheduled and `created_at` is the ORIGINAL check's. Without this field the reuse is invisible: the response is a 200 with a `check_id` and an `outcome` that look like they belong to the request just made.","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["check_id","trust_score","risk_probability","confidence","evidence_count","score_version","created_at"],"title":"CheckOut"},"CheckPage":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pass as `cursor` to fetch the next page. Absent when there are no more."},"has_more":{"type":"boolean","title":"Has More","default":false},"items":{"items":{"$ref":"#/components/schemas/CheckSummary"},"type":"array","title":"Items"}},"additionalProperties":false,"type":"object","title":"CheckPage"},"CheckSummary":{"properties":{"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Name"},"buyer_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Phone"},"check_id":{"type":"string","title":"Check Id"},"trust_score":{"type":"integer","title":"Trust Score"},"confidence":{"$ref":"#/components/schemas/ConfidenceLevel"},"buyer_name_masked":{"type":"string","title":"Buyer Name Masked","description":"Masked for display, e.g. `M••••••• E• A•••••`.","examples":["M••••••• E• A•••••"]},"buyer_phone_masked":{"type":"string","title":"Buyer Phone Masked","examples":["+212•••••5678"]},"product_sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Sku"},"followup_status":{"$ref":"#/components/schemas/CheckFollowupStatus"},"outcome":{"anyOf":[{"$ref":"#/components/schemas/OutcomeType"},{"type":"null"}]},"followup_due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Followup Due At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["check_id","trust_score","confidence","buyer_name_masked","buyer_phone_masked","followup_status","created_at"],"title":"CheckSummary"},"ConfidenceLevel":{"type":"string","enum":["low","medium","high"],"title":"ConfidenceLevel"},"DailyPoint":{"properties":{"date":{"type":"string","title":"Date","description":"ISO date, e.g. 2026-11-14."},"checks":{"type":"integer","title":"Checks","default":0},"delivered":{"type":"integer","title":"Delivered","default":0},"refused":{"type":"integer","title":"Refused","default":0},"returned":{"type":"integer","title":"Returned","default":0}},"additionalProperties":false,"type":"object","required":["date"],"title":"DailyPoint"},"DeepHealth":{"properties":{"status":{"type":"string","enum":["ok","degraded"],"title":"Status"},"dependencies":{"items":{"$ref":"#/components/schemas/DependencyHealth"},"type":"array","title":"Dependencies"}},"type":"object","required":["status","dependencies"],"title":"DeepHealth"},"DependencyHealth":{"properties":{"name":{"type":"string","title":"Name"},"ok":{"type":"boolean","title":"Ok"},"latency_ms":{"type":"number","title":"Latency Ms"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["name","ok","latency_ms"],"title":"DependencyHealth"},"FollowupPage":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pass as `cursor` to fetch the next page. Absent when there are no more."},"has_more":{"type":"boolean","title":"Has More","default":false},"items":{"items":{"$ref":"#/components/schemas/PendingFollowup"},"type":"array","title":"Items"}},"additionalProperties":false,"type":"object","title":"FollowupPage"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Health":{"properties":{"status":{"type":"string","const":"ok","title":"Status","default":"ok"},"app":{"type":"string","title":"App"},"env":{"type":"string","title":"Env"},"revision":{"type":"string","title":"Revision"},"score_version":{"type":"string","title":"Score Version"}},"type":"object","required":["app","env","revision","score_version"],"title":"Health"},"Language":{"type":"string","enum":["fr","ar","en"],"title":"Language"},"MeOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"seller_id":{"type":"string","title":"Seller Id"},"email_masked":{"type":"string","title":"Email Masked"},"is_admin":{"type":"boolean","title":"Is Admin"},"business_name":{"type":"string","title":"Business Name"},"country_default":{"type":"string","title":"Country Default"},"language":{"$ref":"#/components/schemas/Language"},"onboarding_complete":{"type":"boolean","title":"Onboarding Complete"},"push_enabled":{"type":"boolean","title":"Push Enabled"},"email_digest_enabled":{"type":"boolean","title":"Email Digest Enabled"},"digest_hour":{"type":"integer","title":"Digest Hour"}},"additionalProperties":false,"type":"object","required":["user_id","seller_id","email_masked","is_admin","business_name","country_default","language","onboarding_complete","push_enabled","email_digest_enabled","digest_hour"],"title":"MeOut"},"OnboardingIn":{"properties":{"business_name":{"type":"string","maxLength":200,"minLength":1,"title":"Business Name"},"country_default":{"type":"string","maxLength":2,"minLength":2,"pattern":"^[A-Za-z]{2}$","title":"Country Default","default":"MA"},"language":{"$ref":"#/components/schemas/Language","default":"fr"}},"additionalProperties":false,"type":"object","required":["business_name"],"title":"OnboardingIn"},"OtpRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["email"],"title":"OtpRequest"},"OtpRequestOut":{"properties":{"sent":{"type":"boolean","const":true,"title":"Sent","default":true},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"},"resend_available_in_seconds":{"type":"integer","title":"Resend Available In Seconds"}},"additionalProperties":false,"type":"object","required":["expires_in_seconds","resend_available_in_seconds"],"title":"OtpRequestOut","description":"Deliberately identical whether or not the email exists.\n\nTelling a caller \"no such account\" turns the login form into an account-existence\noracle, which is how user lists get harvested."},"OtpVerify":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^\\d{6}$","title":"Code"}},"additionalProperties":false,"type":"object","required":["email","code"],"title":"OtpVerify"},"OutcomeCreate":{"properties":{"outcome":{"type":"string","enum":["delivered","refused","returned","not_shipped"],"title":"Outcome","description":"`returned` means the buyer accepted the parcel and then sent it back. `not_shipped` means you decided not to ship — it never counts against the buyer."},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At","description":"When it happened, if not now."}},"additionalProperties":false,"type":"object","required":["outcome"],"title":"OutcomeCreate"},"OutcomeOut":{"properties":{"check_id":{"type":"string","title":"Check Id"},"outcome":{"$ref":"#/components/schemas/OutcomeType"},"recorded_at":{"type":"string","format":"date-time","title":"Recorded At"},"supersedes_previous":{"type":"boolean","title":"Supersedes Previous","default":false}},"additionalProperties":false,"type":"object","required":["check_id","outcome","recorded_at"],"title":"OutcomeOut"},"OutcomeType":{"type":"string","enum":["delivered","refused","returned","not_shipped","implied_delivered"],"title":"OutcomeType"},"PendingFollowup":{"properties":{"buyer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Name"},"buyer_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyer Phone"},"check_id":{"type":"string","title":"Check Id"},"buyer_name_masked":{"type":"string","title":"Buyer Name Masked"},"buyer_phone_masked":{"type":"string","title":"Buyer Phone Masked"},"product_sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Sku"},"trust_score":{"type":"integer","title":"Trust Score"},"checked_at":{"type":"string","format":"date-time","title":"Checked At"},"implied_delivery_at":{"type":"string","format":"date-time","title":"Implied Delivery At","description":"After this, silence is recorded as an implied delivery at reduced weight."}},"additionalProperties":false,"type":"object","required":["check_id","buyer_name_masked","buyer_phone_masked","trust_score","checked_at","implied_delivery_at"],"title":"PendingFollowup"},"ProductCreate":{"properties":{"sku":{"type":"string","maxLength":120,"minLength":1,"title":"Sku"},"title":{"type":"string","maxLength":300,"minLength":1,"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"image_url":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Image Url"}},"additionalProperties":false,"type":"object","required":["sku","title"],"title":"ProductCreate"},"ProductImportOut":{"properties":{"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"},"failed":{"type":"integer","title":"Failed"},"rows":{"items":{"$ref":"#/components/schemas/ProductImportRow"},"type":"array","title":"Rows"}},"additionalProperties":false,"type":"object","required":["created","updated","failed"],"title":"ProductImportOut"},"ProductImportRow":{"properties":{"row":{"type":"integer","title":"Row"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"ok":{"type":"boolean","title":"Ok"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"additionalProperties":false,"type":"object","required":["row","ok"],"title":"ProductImportRow"},"ProductIn":{"properties":{"sku":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Sku","description":"Your SKU. An unknown SKU without a `title` returns 422.","examples":["EARBUDS-01"]},"title":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Title","description":"Creates the product in your catalog when the SKU is new."}},"additionalProperties":false,"type":"object","title":"ProductIn"},"ProductOut":{"properties":{"id":{"type":"string","title":"Id"},"sku":{"type":"string","title":"Sku"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"has_image":{"type":"boolean","title":"Has Image","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"additionalProperties":false,"type":"object","required":["id","sku","title","created_at","updated_at"],"title":"ProductOut"},"ProductPage":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pass as `cursor` to fetch the next page. Absent when there are no more."},"has_more":{"type":"boolean","title":"Has More","default":false},"items":{"items":{"$ref":"#/components/schemas/ProductOut"},"type":"array","title":"Items"}},"additionalProperties":false,"type":"object","title":"ProductPage"},"ProductSignal":{"properties":{"concurrent_same_product":{"type":"integer","title":"Concurrent Same Product","default":0},"concurrent_same_type":{"type":"integer","title":"Concurrent Same Type","default":0},"product_refusal_level":{"type":"string","enum":["low","normal","high","unknown"],"title":"Product Refusal Level","default":"unknown"}},"additionalProperties":false,"type":"object","title":"ProductSignal","description":"How many *other* sellers currently have an open order for this item.\n\nThe single most actionable number in the response: a buyer with the same item on\norder from four sellers will accept one parcel."},"ProductUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":300,"minLength":1},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"image_url":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Image Url"}},"additionalProperties":false,"type":"object","title":"ProductUpdate"},"PushSubscriptionIn":{"properties":{"endpoint":{"type":"string","maxLength":1000,"minLength":1,"title":"Endpoint"},"p256dh":{"type":"string","maxLength":400,"minLength":1,"title":"P256Dh"},"auth":{"type":"string","maxLength":200,"minLength":1,"title":"Auth"}},"additionalProperties":false,"type":"object","required":["endpoint","p256dh","auth"],"title":"PushSubscriptionIn"},"PushSubscriptionOut":{"properties":{"id":{"type":"string","title":"Id"},"endpoint_masked":{"type":"string","title":"Endpoint Masked"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"}},"additionalProperties":false,"type":"object","required":["id","endpoint_masked","created_at"],"title":"PushSubscriptionOut"},"Reason":{"properties":{"code":{"type":"string","title":"Code","examples":["REFUSALS_MULTI_SELLER"]},"message":{"type":"string","title":"Message","examples":["2 refusals reported by 2 different sellers"]}},"additionalProperties":false,"type":"object","required":["code","message"],"title":"Reason","description":"A stable code plus a sentence for display. Branch on `code`, show `message`."},"ResolutionStatus":{"type":"string","enum":["complete","partial"],"title":"ResolutionStatus","description":"``partial`` means the resolution budget ran out and a worker is still deciding."},"ScoreBucket":{"properties":{"score":{"type":"integer","maximum":5.0,"minimum":0.0,"title":"Score"},"count":{"type":"integer","title":"Count"}},"additionalProperties":false,"type":"object","required":["score","count"],"title":"ScoreBucket"},"SessionOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"seller_id":{"type":"string","title":"Seller Id"},"is_new":{"type":"boolean","title":"Is New","description":"True on first verification: send the user to onboarding."},"onboarding_complete":{"type":"boolean","title":"Onboarding Complete"}},"additionalProperties":false,"type":"object","required":["user_id","seller_id","is_new","onboarding_complete"],"title":"SessionOut"},"SettingsUpdate":{"properties":{"business_name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Business Name"},"country_default":{"anyOf":[{"type":"string","maxLength":2,"minLength":2,"pattern":"^[A-Za-z]{2}$"},{"type":"null"}],"title":"Country Default"},"language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]},"push_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Push Enabled"},"email_digest_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email Digest Enabled"},"digest_hour":{"anyOf":[{"type":"integer","maximum":23.0,"minimum":0.0},{"type":"null"}],"title":"Digest Hour"}},"additionalProperties":false,"type":"object","title":"SettingsUpdate"},"StatsOut":{"properties":{"checks_this_month":{"type":"integer","title":"Checks This Month"},"pending_followups":{"type":"integer","title":"Pending Followups"},"risky_share":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Risky Share","description":"Fraction of this month's checks that scored 0-2."},"reported_refusal_rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Reported Refusal Rate"},"score_distribution":{"items":{"$ref":"#/components/schemas/ScoreBucket"},"type":"array","title":"Score Distribution"},"daily":{"items":{"$ref":"#/components/schemas/DailyPoint"},"type":"array","title":"Daily"}},"additionalProperties":false,"type":"object","required":["checks_this_month","pending_followups","risky_share","reported_refusal_rate"],"title":"StatsOut"},"TokenCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name","examples":["YouCan plugin"]},"scopes":{"items":{"$ref":"#/components/schemas/TokenScope"},"type":"array","minItems":1,"title":"Scopes"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"additionalProperties":false,"type":"object","required":["name","scopes"],"title":"TokenCreate"},"TokenCreated":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix","description":"The visible first characters, for identifying a token."},"scopes":{"items":{"$ref":"#/components/schemas/TokenScope"},"type":"array","title":"Scopes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"token":{"type":"string","title":"Token","description":"The full token. Shown once and never again — store it now.","examples":["cts_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]}},"additionalProperties":false,"type":"object","required":["id","name","prefix","scopes","created_at","token"],"title":"TokenCreated"},"TokenOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix","description":"The visible first characters, for identifying a token."},"scopes":{"items":{"$ref":"#/components/schemas/TokenScope"},"type":"array","title":"Scopes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"additionalProperties":false,"type":"object","required":["id","name","prefix","scopes","created_at"],"title":"TokenOut"},"TokenScope":{"type":"string","enum":["checks:write","outcomes:write","products:write","webhooks:write","read"],"title":"TokenScope","description":"Stored as a VARCHAR array on ``api_tokens.scopes``, validated in the app layer."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookDisabledReason":{"type":"string","enum":["too_many_failures","endpoint_gone","unsafe_target","by_seller"],"title":"WebhookDisabledReason","description":"Why an endpoint stopped receiving. Shown to the seller verbatim."},"WebhookEndpointCreate":{"properties":{"label":{"type":"string","maxLength":120,"minLength":1,"title":"Label","description":"A name you will recognise in this list later.","examples":["YouCan store"]},"url":{"type":"string","maxLength":500,"minLength":1,"title":"Url","description":"An https:// URL on a public hostname. We POST the event body to it.","examples":["https://shop.example.com/eblacklist/webhook"]},"events":{"items":{"$ref":"#/components/schemas/WebhookEventType"},"type":"array","minItems":1,"title":"Events","description":"Which events to send. Subscribe only to what you handle.","examples":[["followup.due","outcome.recorded"]]}},"additionalProperties":false,"type":"object","required":["label","url","events"],"title":"WebhookEndpointCreate"},"WebhookEndpointCreated":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"enabled":{"type":"boolean","title":"Enabled"},"disabled_reason":{"anyOf":[{"$ref":"#/components/schemas/WebhookDisabledReason"},{"type":"null"}],"description":"Why we switched it off, when we did."},"failure_count":{"type":"integer","title":"Failure Count","description":"Consecutive failed attempts. Any 2xx resets it."},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"secret":{"type":"string","title":"Secret","description":"Sign-and-verify key for this endpoint. **Shown once, here, and never again.** Store it now; if you lose it, delete the endpoint and register it again.","examples":["whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]}},"additionalProperties":false,"type":"object","required":["id","label","url","events","enabled","failure_count","created_at","updated_at","secret"],"title":"WebhookEndpointCreated"},"WebhookEndpointList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WebhookEndpointOut"},"type":"array","title":"Items"},"api_version":{"type":"string","title":"Api Version","description":"The payload version your endpoints currently receive.","examples":["2026-11-15"]}},"additionalProperties":false,"type":"object","required":["api_version"],"title":"WebhookEndpointList"},"WebhookEndpointOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"enabled":{"type":"boolean","title":"Enabled"},"disabled_reason":{"anyOf":[{"$ref":"#/components/schemas/WebhookDisabledReason"},{"type":"null"}],"description":"Why we switched it off, when we did."},"failure_count":{"type":"integer","title":"Failure Count","description":"Consecutive failed attempts. Any 2xx resets it."},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"additionalProperties":false,"type":"object","required":["id","label","url","events","enabled","failure_count","created_at","updated_at"],"title":"WebhookEndpointOut"},"WebhookEndpointUpdate":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Label"},"url":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"$ref":"#/components/schemas/WebhookEventType"},"type":"array","minItems":1},{"type":"null"}],"title":"Events"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Switching an endpoint off drops whatever was queued for it. A plugin that comes back after a day does not want a day of stale 'should I ship?' events."}},"additionalProperties":false,"type":"object","title":"WebhookEndpointUpdate"},"WebhookEventType":{"type":"string","enum":["followup.due","outcome.recorded","score.changed"],"title":"WebhookEventType","description":"What a plugin can subscribe to.\n\nDeliberately small. Each one is a thing a store integration has to *act* on:\nput a hold on, release a hold, or ask a human. \"A check was created\" is not here —\nthe plugin made that call itself and already has the answer."},"WebhookTestResult":{"properties":{"delivered":{"type":"boolean","title":"Delivered"},"response_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Code","description":"The HTTP status your server answered with."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"A short machine-readable reason, e.g. `timeout`, `http_503`, `unsafe_target`."},"latency_ms":{"type":"integer","title":"Latency Ms"}},"additionalProperties":false,"type":"object","required":["delivered","response_code","latency_ms"],"title":"WebhookTestResult","description":"What came back from one synthetic delivery, as a diagnostic."}}}}