{"openapi":"3.1.0","info":{"title":"SSS Platform","version":"0.1.0"},"paths":{"/api/v1/markets/browse-tree":{"get":{"tags":["api_markets"],"summary":"Get Markets Browse Tree","description":"Browse tree + CI enrichment for the canvas (compact keys, None omitted).","operationId":"get_markets_browse_tree","parameters":[{"name":"marketplace","in":"query","required":false,"schema":{"type":"string","default":"DE","title":"Marketplace"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/markets/state":{"get":{"tags":["api_markets"],"summary":"Get Markets State","description":"Current saved version of a perspective (markets + sparse assignments).","operationId":"get_markets_state","parameters":[{"name":"perspective","in":"query","required":false,"schema":{"type":"string","default":"sss-global","title":"Perspective"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api_markets"],"summary":"Save Markets State","description":"Save the next version; 409 when the perspective moved on since the client loaded it.","operationId":"save_markets_state","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveStateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/markets/top-asins":{"get":{"tags":["api_markets"],"summary":"Get Markets Top Asins","description":"Sneak peek for one node: newest CI top-ASIN lists (top grossing / new & successful).","operationId":"get_markets_top_asins","parameters":[{"name":"node","in":"query","required":true,"schema":{"type":"integer","title":"Node"}},{"name":"marketplace","in":"query","required":false,"schema":{"type":"string","default":"DE","title":"Marketplace"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/markets/nodes/{browse_node_id}/data-summary":{"get":{"tags":["api_markets"],"summary":"Get Markets Node Data Summary","description":"The node's CI data per table plus its targets - what the destructive button routes on.\n\nRead-only, so ``view``: seeing how much history a node holds is not a\nmutation. Declared before the parameterised POST sibling per the route-order\nconvention; the two do not actually collide (different methods), but the\nliteral-before-parameterised order is the rule that keeps them from ever\ndoing so.","operationId":"get_markets_node_data_summary","parameters":[{"name":"browse_node_id","in":"path","required":true,"schema":{"type":"integer","title":"Browse Node Id"}},{"name":"marketplace","in":"query","required":false,"schema":{"type":"string","default":"DE","title":"Marketplace"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/markets/nodes/{browse_node_id}/{action}":{"post":{"tags":["api_markets"],"summary":"Post Markets Node Crawl Action","description":"Enroll / pause / resume / remove one browse node in the CI crawl.\n\nAnswers with the node's new crawl overlay ({id, s?, e?, changed}) so the\ncanvas can refresh the card without reloading the 35k-node tree. Both\nfailure modes are 400 with the message the client shows as the toast: an\nunknown action, and the crawl-target layer's refusals (node never observed by\nCI, no CI schedule). The action is\nchecked against the dispatch table HERE, so no exception raised inside a\nverb can be mistaken for an unknown one.","operationId":"post_markets_node_crawl_action","parameters":[{"name":"browse_node_id","in":"path","required":true,"schema":{"type":"integer","title":"Browse Node Id"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","title":"Action"}},{"name":"marketplace","in":"query","required":false,"schema":{"type":"string","default":"DE","title":"Marketplace"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/export/sources":{"get":{"tags":["api_data_export"],"summary":"Api List Sources","description":"Return all export sources accessible to the current user.","operationId":"api_list_export_sources","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/data/export/sources/{source_key}/filters":{"get":{"tags":["api_data_export"],"summary":"Api Get Filters","description":"Return filter metadata for a source, with populated options.","operationId":"api_get_export_filters","parameters":[{"name":"source_key","in":"path","required":true,"schema":{"type":"string","title":"Source Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/export/preview":{"post":{"tags":["api_data_export"],"summary":"Api Preview Export","description":"Preview export data as JSON.","operationId":"api_preview_export","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ApiPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/export/download":{"post":{"tags":["api_data_export"],"summary":"Api Download Export","description":"Download export as CSV or XLSX file.","operationId":"api_download_export","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ApiDownloadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/assignments/":{"get":{"tags":["api_assignments"],"summary":"Api Assignment List","description":"Return paginated assignment list as JSON.","operationId":"api_list_assignments","parameters":[{"name":"organization_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Slug"}},{"name":"brand","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"assignment_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(owner|watcher)$"},{"type":"null"}],"title":"Assignment Type"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Dir"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api_assignments"],"summary":"Api Add Assignment","description":"Create assignment and return created item as JSON.","operationId":"api_add_assignment","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/assignments/{assignment_id}/remove":{"post":{"tags":["api_assignments"],"summary":"Api Remove Assignment","description":"Remove assignment and return 204.","operationId":"api_remove_assignment","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/":{"get":{"tags":["api_organizations"],"summary":"Api Organization List","description":"Return all organizations with product counts as JSON.","operationId":"api_list_organizations","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["api_organizations"],"summary":"Api Create Organization","description":"Create a new organization and return it as JSON.","operationId":"api_create_organization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}":{"get":{"tags":["api_organizations"],"summary":"Api Get Organization","description":"Return a single organization with all sections as JSON.","operationId":"api_get_organization","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["api_organizations"],"summary":"Api Update Organization","description":"Update an organization and return updated data as JSON.","operationId":"api_update_organization","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/toggle":{"post":{"tags":["api_organizations"],"summary":"Api Toggle Organization","description":"Toggle organization is_active and return updated data as JSON.","operationId":"api_toggle_organization","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/assignments/add":{"post":{"tags":["api_organizations"],"summary":"Api Add Organization Assignment","description":"Add product assignment to organization.","operationId":"api_add_organization_assignment","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationAssignmentCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/assignments/{assignment_id}/remove":{"post":{"tags":["api_organizations"],"summary":"Api Remove Organization Assignment","description":"Remove product assignment from organization.","operationId":"api_remove_organization_assignment","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/sellers/add":{"post":{"tags":["api_organizations"],"summary":"Api Add Organization Seller","description":"Add seller account to organization.","operationId":"api_add_organization_seller","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellerAssignmentCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/sellers/{seller_assignment_id}/remove":{"post":{"tags":["api_organizations"],"summary":"Api Remove Organization Seller","description":"Remove seller account from organization.","operationId":"api_remove_organization_seller","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"seller_assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Seller Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/agency-details":{"put":{"tags":["api_organizations"],"summary":"Api Update Agency Details","description":"Upsert agency details for organization.","operationId":"api_update_agency_details","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyDetailsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/responsibilities":{"get":{"tags":["api_organizations"],"summary":"Api List Organization Responsibilities","description":"List the agency stewards of an organization - current ones, or the full history.","operationId":"api_list_organization_responsibilities","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"history","in":"query","required":false,"schema":{"type":"boolean","description":"Return every row ever, not just the current ones","default":false,"title":"History"},"description":"Return every row ever, not just the current ones"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api_organizations"],"summary":"Api Assign Organization Responsibility","description":"Make a colleague responsible for this organization in one service.","operationId":"api_assign_organization_responsibility","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsibilityCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/responsibilities/{responsibility_id}/end":{"post":{"tags":["api_organizations"],"summary":"Api End Organization Responsibility","description":"End a responsibility (set the period's upper bound). Never deletes.","operationId":"api_end_organization_responsibility","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"responsibility_id","in":"path","required":true,"schema":{"type":"integer","title":"Responsibility Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResponsibilityEndRequest"},{"type":"null"}],"title":"Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/responsibilities/{responsibility_id}/change-role":{"post":{"tags":["api_organizations"],"summary":"Api Change Organization Responsibility Role","description":"Move a running responsibility to another role - one transaction, no gap.","operationId":"api_change_organization_responsibility_role","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"responsibility_id","in":"path","required":true,"schema":{"type":"integer","title":"Responsibility Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsibilityRoleChangeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/{organization_id}/responsibilities/{responsibility_id}":{"delete":{"tags":["api_organizations"],"summary":"Api Delete Organization Responsibility","description":"Delete a responsibility row - for a mistyped entry, not for ending one.","operationId":"api_delete_organization_responsibility","parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"responsibility_id","in":"path","required":true,"schema":{"type":"integer","title":"Responsibility Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/":{"get":{"tags":["users"],"summary":"Api List Users","operationId":"list_users","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"organization_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Slug"}},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"display_name","title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"type":"string","default":"asc","title":"Sort Dir"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}":{"get":{"tags":["users"],"summary":"Api Get User","operationId":"get_user","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/":{"get":{"tags":["api_jobs"],"summary":"Api Job List","description":"Return recent jobs with computed metrics as JSON.","operationId":"api_list_jobs","parameters":[{"name":"schedule_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Schedule Id"}},{"name":"crawler_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crawler Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"run_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Type"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Dir"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/stats":{"get":{"tags":["api_jobs"],"summary":"Api Job Stats","description":"Return job dashboard stats as JSON.","operationId":"api_job_stats","parameters":[{"name":"schedule_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Schedule Id"}},{"name":"crawler_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crawler Type"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"run_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/import/preview":{"post":{"tags":["api_product_import"],"summary":"Api Preview Import","operationId":"api_preview_product_import","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_preview_product_import"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/import/apply":{"post":{"tags":["api_product_import"],"summary":"Api Apply Import","operationId":"api_apply_product_import","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportApplyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/":{"get":{"tags":["api_products"],"summary":"Api Product List","description":"Return paginated product list with enrollment badges as JSON.","operationId":"api_list_products","parameters":[{"name":"organization_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Slug"}},{"name":"manufacturer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manufacturer"}},{"name":"brand","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"}},{"name":"keepa_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Keepa Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"asin","title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"type":"string","default":"asc","title":"Sort Dir"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api_products"],"summary":"Api Create Product","description":"Create a new product and return detail as JSON.","operationId":"api_create_product","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/search":{"get":{"tags":["api_products"],"summary":"Api Search Products","description":"Search products for autocomplete.","operationId":"api_search_products","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"exclude_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exclude Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/suggest":{"get":{"tags":["api_products"],"summary":"Api Suggest Field Values","description":"Suggest distinct values for a product field (prefix match).","operationId":"api_suggest_field_values","parameters":[{"name":"field","in":"query","required":true,"schema":{"enum":["brand","manufacturer","title"],"type":"string","title":"Field"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/bulk/enroll":{"post":{"tags":["api_products"],"summary":"Api Bulk Enroll Products","operationId":"api_bulk_enroll_products","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEnrollRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/bulk/assign":{"post":{"tags":["api_products"],"summary":"Api Bulk Assign Products","operationId":"api_bulk_assign_products","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAssignRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/bulk/delete":{"post":{"tags":["api_products"],"summary":"Api Bulk Delete Products","description":"Bulk delete products and return operation result.","operationId":"api_bulk_delete_products","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}":{"get":{"tags":["api_products"],"summary":"Api Product Detail","description":"Return product detail with enrollments as JSON.","operationId":"api_get_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["api_products"],"summary":"Api Update Product","description":"Update an existing product and return detail as JSON.","operationId":"api_update_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["api_products"],"summary":"Api Delete Product","description":"Delete a product and return confirmation.","operationId":"api_delete_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/relationships":{"post":{"tags":["api_products"],"summary":"Api Add Product Relationship","description":"Add a product relationship via API.","operationId":"api_add_product_relationship","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRelationshipCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/relationships/{relationship_id}":{"delete":{"tags":["api_products"],"summary":"Api Remove Product Relationship","description":"Remove a product relationship via API.","operationId":"api_remove_product_relationship","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}},{"name":"relationship_id","in":"path","required":true,"schema":{"type":"integer","title":"Relationship Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/assignments/add":{"post":{"tags":["api_products"],"summary":"Api Add Product Assignment","operationId":"api_add_product_assignment","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductAssignmentCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/assignments/{assignment_id}/remove":{"post":{"tags":["api_products"],"summary":"Api Remove Product Assignment","operationId":"api_remove_product_assignment","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/enroll":{"post":{"tags":["api_products"],"summary":"Api Enroll Product","operationId":"api_enroll_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductEnrollmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/unenroll":{"post":{"tags":["api_products"],"summary":"Api Unenroll Product","operationId":"api_unenroll_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductEnrollmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/enrollment/{schedule_id}/pause":{"post":{"tags":["api_products"],"summary":"Api Pause Product Enrollment","operationId":"api_pause_product_enrollment","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}},{"name":"schedule_id","in":"path","required":true,"schema":{"type":"integer","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/products/{product_id}/enrollment/{schedule_id}/resume":{"post":{"tags":["api_products"],"summary":"Api Resume Product Enrollment","operationId":"api_resume_product_enrollment","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"integer","title":"Product Id"}},{"name":"schedule_id","in":"path","required":true,"schema":{"type":"integer","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/schedules/":{"get":{"tags":["api_schedules"],"summary":"Api Schedule List","description":"Return the lines (core tasks and switches) with their order counts as JSON.","operationId":"api_list_schedules","parameters":[{"name":"crawler_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crawler Type"}},{"name":"marketplace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Marketplace Id"}},{"name":"active","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Dir"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/schedules/{schedule_id}/toggle":{"post":{"tags":["api_schedules"],"summary":"Api Toggle Schedule","description":"Toggle schedule is_active and return updated item as JSON.","operationId":"api_toggle_schedule","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"integer","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/schedules/{schedule_id}/trigger":{"post":{"tags":["api_schedules"],"summary":"Api Trigger Run","description":"Trigger a real manual run and return the outcome as JSON.","operationId":"api_trigger_run","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"integer","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/schedules/stats":{"get":{"tags":["api_schedules"],"summary":"Api Schedule Stats","description":"Return schedule dashboard stats as JSON.","operationId":"api_schedule_stats","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/targets/":{"get":{"tags":["api_targets"],"summary":"Api Target List","description":"Return paginated monitoring rows as JSON.","operationId":"api_list_monitoring_targets","parameters":[{"name":"crawler_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crawler Type"}},{"name":"schedule_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Name"}},{"name":"marketplace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Marketplace Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Dir"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/targets/stats":{"get":{"tags":["api_targets"],"summary":"Api Monitoring Stats","description":"Return monitoring dashboard counters as JSON.","operationId":"api_get_monitoring_stats","parameters":[{"name":"crawler_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crawler Type"}},{"name":"schedule_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/targets/{target_id}/pause":{"post":{"tags":["api_targets"],"summary":"Api Pause Target","description":"Pause a single target and return updated row as JSON.","operationId":"api_pause_target","parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"integer","title":"Target Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/targets/{target_id}/resume":{"post":{"tags":["api_targets"],"summary":"Api Resume Target","description":"Resume a paused target and return updated row as JSON.","operationId":"api_resume_target","parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"integer","title":"Target Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/targets/{target_id}/unenroll":{"post":{"tags":["api_targets"],"summary":"Api Unenroll Target","description":"Remove a single target and return confirmation as JSON.","operationId":"api_unenroll_target","parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"integer","title":"Target Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agency/":{"get":{"tags":["api_agency_overview"],"summary":"Api Agency Overview","description":"Return full agency overview data as JSON.","operationId":"api_agency_overview","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/dashboard/":{"get":{"tags":["api_dashboard"],"summary":"Api Dashboard","description":"Return full dashboard data as JSON.","operationId":"api_dashboard","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/system/options/":{"get":{"tags":["api_system_options"],"summary":"Api Get Options","operationId":"api_system_options","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/integrations/amazon/sellers/{seller_pk}/connection-init":{"get":{"tags":["api_integrations_amazon"],"summary":"Connection Init","description":"Generate a fresh invite link for the Connect modal.\n\nGET endpoint — generates a HMAC invite token in memory, no DB write,\nno CSRF needed (require_permission, not the CSRF variant).\n\nThe link points at this request's own ``/connect`` redirector (built via\n``request.url_for``) so the seller's whole flow — click-time validation,\nAmazon handoff, callback — stays on the origin the operator initiated\nfrom (dev vs prod).\n\nJSON response keyed on success:\n    { connect_url, signed_invite, state_ttl_seconds,\n      seller_amazon_id, organization_slug }\n\nOn failure (e.g. App credential missing in the vault), returns 4xx\nwith {detail} which the modal surfaces via its inline error slot.","operationId":"api_integrations_amazon_connection_init","parameters":[{"name":"seller_pk","in":"path","required":true,"schema":{"type":"integer","title":"Seller Pk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Api Integrations Amazon Connection Init"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assets/{key}":{"get":{"tags":["assets"],"summary":"Proxy Asset","description":"Serve a public S3 asset through the app origin.\n\nPRIVATE ASSETS DO NOT BELONG HERE. When private assets land later they\nneed a SEPARATE endpoint with explicit `actor: AuthContext`. Do NOT\nadd an `elif key.startswith(\"private/\")` branch — this handler is on\nthe KNOWN_NO_ACTOR exception list precisely because the public/-guard\nholds it to anonymous-read territory. Extending it would silently\ngrant unauthenticated access to private storage.","operationId":"asset_proxy_get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/deliveries/previews/{edition_id}/files/{output_key}":{"get":{"tags":["deliveries"],"summary":"Delivery Preview File","description":"A preview's file, for the person who made it (see the module docstring).","operationId":"delivery_preview_file_admin_deliveries_previews__edition_id__files__output_key__get","parameters":[{"name":"edition_id","in":"path","required":true,"schema":{"type":"integer","title":"Edition Id"}},{"name":"output_key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,59}$","title":"Output Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/marketing/newsletter/signup":{"post":{"tags":["api_marketing_consent"],"summary":"Signup","description":"Record the subscription request and return a confirmation token.\n\n`status: token_issued` -> send the confirmation mail with `token`; a\n`signup` row was appended to the ledger.\n`status: already_pending` -> a live token younger than 24 h exists,\n`token` is null; do NOT send a second mail. Writes nothing to the ledger -\none journey stays one signup row plus one confirm row. A re-signup against\nan older live token supersedes it and comes back as `token_issued`.\n\n409 signup_conflict_retry: a concurrent redeem or cleanup raced us. The\nrequest itself is fine; retrying it succeeds.","operationId":"api_marketing_newsletter_signup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/marketing/newsletter/confirm":{"post":{"tags":["api_marketing_consent"],"summary":"Confirm","description":"Redeem the token (single-use) and record the confirmation.\n\n404 unknown_token · 409 already_confirmed · 410 token_expired.\nOn success the returned `email` is what the caller needs to create the\nResend contact.","operationId":"api_marketing_newsletter_confirm","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/marketing/newsletter/legitimate-basis":{"post":{"tags":["api_marketing_consent"],"summary":"Legitimate Basis","description":"Document admissions of existing customers under § 7 Abs. 3 UWG.\n\nNo token, no mail, no Resend write - this endpoint only appends the ledger\nrow that says on which ground, by whose decision and from which source an\naddress was admitted. Bulk-capable (one legal ground, one responsible\nperson, one source per request) so the GoHighLevel backlog can be\ndocumented in one act.\n\nAll-or-nothing: every record is validated before the first row is added.\nA rejected record answers `422 {\"detail\": \"records[<i>]: <code>\"}` and\nNOTHING is written - codes `invalid_email`, `missing_basis_note`,\n`duplicate_email_in_batch`, `naive_source_captured_at`,\n`source_captured_at_in_future`. Batch-level rejections carry no index:\n`unknown_legal_basis`, `missing_authorized_by`, `missing_source_system`.\n\nAn address that already has an admission row comes back as\n`already_recorded` instead of being written twice, so re-running an import\nis safe.","operationId":"api_marketing_newsletter_legitimate_basis","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","description":"Health check endpoint. DB query keeps connection pool warm.","operationId":"health_check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/pump":{"get":{"summary":"Health Pump","description":"Output recency of the contract pump for the outside watch (Uptime Kuma polls it; review #794 L-02).\n\nThe pump carries every specialist alarm, the overdue watch and the delivery runtime; a hung or dead pump\nthread cannot report itself (architecture.md § 9: a healthcheck asserts output recency, never from a timer\nthread). 503 when its newest completed run is older than PUMP_STALE_AFTER (or implausibly in the future), so\na deploy's restart, even one that kills a running run, never trips it. It proves that the pump completes\nruns somewhere (dev shares the database and runs no loop), not that this process runs it. Intentionally\nunauthenticated, like /health: it says only ok or stale.","operationId":"health_pump","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AdmissionRecord":{"properties":{"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"basis_note":{"type":"string","maxLength":2000,"minLength":1,"title":"Basis Note"},"source_captured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Source Captured At"}},"type":"object","required":["email","basis_note"],"title":"AdmissionRecord","description":"One address admitted under the batch's legal basis.\n\n`basis_note` is per-record and has NO batch-level default on purpose: the\nconcrete business relationship differs per person, and a shared boilerplate\nreason is exactly what turns an admission path into a catch-all (issue\n#371, \"Abgrenzung\"). The blank-only case is caught in the service, because\nPydantic's min_length would accept a single space."},"AdmissionRequest":{"properties":{"legal_basis":{"type":"string","maxLength":100,"minLength":1,"title":"Legal Basis"},"authorized_by":{"type":"string","maxLength":200,"minLength":1,"title":"Authorized By"},"source_system":{"type":"string","maxLength":100,"minLength":1,"title":"Source System"},"records":{"items":{"$ref":"#/components/schemas/AdmissionRecord"},"type":"array","maxItems":500,"minItems":1,"title":"Records"}},"type":"object","required":["legal_basis","authorized_by","source_system","records"],"title":"AdmissionRequest","description":"A batch of admissions: one legal ground, one responsible person, one source.\n\nThose three are batch-level because one import IS one act — the same person\ninvoking the same ground on the same export. Anything that differs per\nperson belongs in AdmissionRecord."},"AdmissionResponse":{"properties":{"recorded":{"type":"integer","title":"Recorded"},"skipped":{"type":"integer","title":"Skipped"},"results":{"items":{"$ref":"#/components/schemas/AdmissionResult"},"type":"array","title":"Results"}},"type":"object","required":["recorded","skipped","results"],"title":"AdmissionResponse","description":"Batch outcome. `recorded + skipped == len(request.records)` always —\nthe batch is all-or-nothing, so a 200 means every record was handled."},"AdmissionResult":{"properties":{"email":{"type":"string","title":"Email"},"status":{"type":"string","title":"Status"}},"type":"object","required":["email","status"],"title":"AdmissionResult","description":"Per-record outcome. `email` is the NORMALIZED address, so a caller can\nsee what actually reached the ledger."},"AgencyDetailsUpdateRequest":{"properties":{"billing_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Address"},"vat_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vat Id"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"}},"type":"object","title":"AgencyDetailsUpdateRequest","description":"Request body for the agency's master data of an organization - the domain's input type."},"AssignmentCreateRequest":{"properties":{"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"product_id":{"type":"integer","title":"Product Id"},"assignment_type":{"type":"string","enum":["owner","watcher"],"title":"Assignment Type","default":"owner"}},"type":"object","required":["organization_id","product_id"],"title":"AssignmentCreateRequest","description":"Request body for creating an organization-product assignment."},"Body_api_preview_product_import":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_api_preview_product_import"},"BulkAssignRequest":{"properties":{"product_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Product Ids"},"organization_id":{"type":"string","title":"Organization Id"},"assignment_type":{"type":"string","title":"Assignment Type","default":"watcher"}},"type":"object","required":["product_ids","organization_id"],"title":"BulkAssignRequest","description":"Request body for bulk assignment. Empty selection → 422 (see BulkEnrollRequest)."},"BulkDeleteRequest":{"properties":{"product_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Product Ids"}},"type":"object","required":["product_ids"],"title":"BulkDeleteRequest","description":"Request body for bulk delete. Empty selection → 422 (see BulkEnrollRequest)."},"BulkEnrollRequest":{"properties":{"product_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Product Ids"},"schedule_id":{"type":"integer","title":"Schedule Id"}},"type":"object","required":["product_ids","schedule_id"],"title":"BulkEnrollRequest","description":"Request body for bulk enrollment.\n\nEmpty-selection policy: min_length=1 makes the JSON API reject an empty\nselection with 422, matching the HTML routes (which guard the Form input\nwith DomainValidationError). Without it the request parsed fine and the\nservice returned a silent 200 with \"0 succeeded\" (#284)."},"ConfirmRequest":{"properties":{"token":{"type":"string","maxLength":200,"minLength":1,"title":"Token"},"ip_address":{"type":"string","maxLength":45,"minLength":3,"title":"Ip Address"},"mail_template_version":{"type":"string","maxLength":100,"minLength":1,"title":"Mail Template Version"},"user_agent":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"User Agent"}},"type":"object","required":["token","ip_address","mail_template_version"],"title":"ConfirmRequest","description":"Log line 2: the visitor clicked the link in the confirmation mail."},"ConfirmResponse":{"properties":{"status":{"type":"string","title":"Status"},"email":{"type":"string","title":"Email"},"confirmed_at":{"type":"string","format":"date-time","title":"Confirmed At"}},"type":"object","required":["status","email","confirmed_at"],"title":"ConfirmResponse","description":"Success payload — `email` is what the website needs to create the\nResend contact (that step stays on the website side, issue #359 non-scope)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImportApplyRequest":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/ImportRow"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"ImportApplyRequest","description":"JSON payload for API apply endpoint.\n\nOptions are now per-row (org_slug / assignment_type / schedule_name / duplicate_of),\nso the request carries only rows."},"ImportRow":{"properties":{"row_number":{"type":"integer","title":"Row Number"},"asin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asin"},"pzn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pzn"},"gtin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gtin"},"display_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Title"},"display_title_short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Title Short"},"display_brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Brand"},"display_manufacturer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Manufacturer"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"org_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Slug"},"assignment_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Type"},"schedule_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Name"},"group_axis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Axis"},"group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Name"},"duplicate_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duplicate Of"},"clear_fields":{"items":{"type":"string","enum":["display_title_short","notes"]},"type":"array","title":"Clear Fields"},"unlink_duplicate":{"type":"boolean","title":"Unlink Duplicate","default":false}},"type":"object","required":["row_number"],"title":"ImportRow","description":"Normalized import input row (long-format)."},"MarketIn":{"properties":{"name":{"type":"string","title":"Name"},"color":{"type":"string","title":"Color"},"parent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent"},"sort_order":{"type":"integer","title":"Sort Order","default":0},"name_de":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name De"},"definition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition"}},"type":"object","required":["name","color","name_de","definition"],"title":"MarketIn","description":"One market label as the client sends it - the domain's ``MarketLabel`` (src/domain/markets/types.py: fields,\nand why ``name_de`` / ``definition`` are required keys)."},"OrganizationAssignmentCreateRequest":{"properties":{"product_id":{"type":"integer","title":"Product Id"},"assignment_type":{"type":"string","title":"Assignment Type","default":"owner"}},"type":"object","required":["product_id"],"title":"OrganizationAssignmentCreateRequest"},"OrganizationCreateRequest":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"organization_type":{"type":"string","enum":["customer","partner","internal"],"title":"Organization Type","default":"customer"}},"type":"object","required":["name","slug"],"title":"OrganizationCreateRequest","description":"Request body for creating a new organization - the domain's input type (src/domain/customers/types.py)."},"OrganizationUpdateRequest":{"properties":{"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"}},"type":"object","required":["name","slug"],"title":"OrganizationUpdateRequest","description":"Request body for updating an existing organization - the domain's input type."},"ProductAssignmentCreateRequest":{"properties":{"organization_id":{"type":"string","title":"Organization Id"},"assignment_type":{"type":"string","title":"Assignment Type","default":"owner"}},"type":"object","required":["organization_id"],"title":"ProductAssignmentCreateRequest","description":"Request body for assigning an organization to a product."},"ProductCreateRequest":{"properties":{"display_title":{"type":"string","maxLength":500,"minLength":1,"title":"Display Title"},"display_title_short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Title Short"},"display_brand":{"type":"string","maxLength":200,"minLength":1,"title":"Display Brand"},"display_manufacturer":{"type":"string","maxLength":200,"minLength":1,"title":"Display Manufacturer"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"identifiers":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Identifiers"}},"type":"object","required":["display_title","display_brand","display_manufacturer"],"title":"ProductCreateRequest","description":"Request body for creating a new product."},"ProductEnrollmentRequest":{"properties":{"schedule_id":{"type":"integer","title":"Schedule Id"}},"type":"object","required":["schedule_id"],"title":"ProductEnrollmentRequest","description":"Request body for enrollment actions."},"ProductRelationshipCreateRequest":{"properties":{"target_product_id":{"type":"integer","title":"Target Product Id"},"relationship_type":{"type":"string","title":"Relationship Type"}},"type":"object","required":["target_product_id","relationship_type"],"title":"ProductRelationshipCreateRequest","description":"Request body for adding a product relationship."},"ProductUpdateRequest":{"properties":{"display_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Title"},"display_title_short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Title Short"},"display_brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Brand"},"display_manufacturer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Manufacturer"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"identifiers":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Identifiers"},"confirm_brand_rename":{"type":"boolean","title":"Confirm Brand Rename","default":false}},"type":"object","title":"ProductUpdateRequest","description":"Partial update payload for product detail edits."},"ResponsibilityCreateRequest":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"service":{"type":"string","title":"Service"},"role":{"type":"string","title":"Role"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"valid_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid From"}},"type":"object","required":["user_id","service","role"],"title":"ResponsibilityCreateRequest","description":"Request body for assigning a steward to an organization.\n\nservice/role are validated against src.shared.constants in the service\nlayer (and by the database's CHECKs) rather than by a Literal here, so the\nvocabulary has exactly one source that a migration changes."},"ResponsibilityEndRequest":{"properties":{"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"}},"type":"object","title":"ResponsibilityEndRequest","description":"Request body for ending a responsibility. None = now."},"ResponsibilityRoleChangeRequest":{"properties":{"role":{"type":"string","title":"Role"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["role"],"title":"ResponsibilityRoleChangeRequest","description":"Request body for moving a running responsibility to another role.\n\nDeliberately no timestamp: the whole point of the operation is that the\npredecessor's end and the successor's start are the SAME instant, and a\ncaller-supplied one would only let the two drift apart again."},"SaveStateRequest":{"properties":{"perspective":{"type":"string","title":"Perspective","default":"sss-global"},"base_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Version Id"},"markets":{"items":{"$ref":"#/components/schemas/MarketIn"},"type":"array","title":"Markets"},"assignments":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Assignments"},"assignment_notes":{"additionalProperties":{"type":"string"},"type":"object","title":"Assignment Notes"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["markets","assignments","assignment_notes"],"title":"SaveStateRequest","description":"Full snapshot the client wants saved as the next version.\n\n`assignments` maps browse_node_id (as string key) to a market name, or\nNone for an explicit exclusion. `assignment_notes` carries the reason\nwritten on an anchor (markets.assignments.note) - the client passes back\nwhat it loaded, so a save never drops a reason it did not touch; a note\nfor a node that is no longer anchored is refused. `base_version_id` is\nthe version the client started from - the server refuses (409) if it\nmoved on."},"SellerAssignmentCreateRequest":{"properties":{"seller_id":{"type":"string","title":"Seller Id"}},"type":"object","required":["seller_id"],"title":"SellerAssignmentCreateRequest"},"SignupRequest":{"properties":{"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"ip_address":{"type":"string","maxLength":45,"minLength":3,"title":"Ip Address"},"consent_text":{"type":"string","minLength":1,"title":"Consent Text"},"consent_form_version":{"type":"string","maxLength":100,"minLength":1,"title":"Consent Form Version"},"user_agent":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"User Agent"}},"type":"object","required":["email","ip_address","consent_text","consent_form_version"],"title":"SignupRequest","description":"Log line 1: the visitor submitted the newsletter form."},"SignupResponse":{"properties":{"status":{"type":"string","title":"Status"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["status","token","expires_at"],"title":"SignupResponse","description":"`token` is the ONLY place the confirmation secret ever appears.\n\nIt is returned exactly once, on `token_issued`. On `already_pending` it is\nnull: a live token younger than RESEND_AFTER_HOURS exists, so the website\nmust NOT send a second confirmation mail (that is the anti-mail-bomb rule,\nnot an error). A re-signup against an older live token comes back as\n`token_issued` with a fresh token — the old link stops working."},"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"},"_ApiDownloadRequest":{"properties":{"source_key":{"type":"string","title":"Source Key"},"filters":{"additionalProperties":{"type":"string"},"type":"object","title":"Filters"},"format":{"type":"string","enum":["csv","xlsx"],"title":"Format","default":"csv"}},"type":"object","required":["source_key"],"title":"_ApiDownloadRequest","description":"JSON body for the API download endpoint."},"_ApiPreviewRequest":{"properties":{"source_key":{"type":"string","title":"Source Key"},"filters":{"additionalProperties":{"type":"string"},"type":"object","title":"Filters"}},"type":"object","required":["source_key"],"title":"_ApiPreviewRequest","description":"JSON body for the API preview endpoint."}}}}