{
  "openapi": "3.1.0",
  "info": {
    "title": "Citeda API",
    "version": "2026-10-16",
    "description": "Read-only K-beauty gap data from Seoul, plus an inquiry endpoint. Citeda tries to introduce buyers to brands; it does not sell, ship or take payment. Every order-related request is reviewed by a human (Sean Lim) and routed to the brand or its US distributor.",
    "contact": {
      "name": "Sean Lim",
      "email": "sean@go.citeda.com"
    },
    "license": {
      "name": "Free to read, attribute and link"
    }
  },
  "servers": [
    {
      "url": "https://citeda.com"
    }
  ],
  "paths": {
    "/data/products.json": {
      "get": {
        "operationId": "listProducts",
        "summary": "Products with US Amazon gap status and check dates",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          }
        }
      }
    },
    "/data/brands.json": {
      "get": {
        "operationId": "listBrands",
        "summary": "Brands referenced in issues",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/data/offers.json": {
      "get": {
        "operationId": "listOffers",
        "summary": "Wholesale offers published by brands (empty until brands onboard)",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/data/issue-01.json": {
      "get": {
        "operationId": "getIssue01",
        "summary": "Issue 01 with export trends",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/inquiries": {
      "post": {
        "operationId": "createInquiry",
        "summary": "Ask to buy or stock products. A human reviews it and replies to the buyer's email; brands answer on their own schedule, so no reply time is promised.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InquiryRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted, pending the buyer's email confirmation",
            "content": {
              "application/json": {
                "example": {
                  "inquiry_id": "inq_…",
                  "status": "pending_confirmation",
                  "referral_token": "ref_…",
                  "registered_agent": false,
                  "next": "We emailed the buyer a confirmation link…"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limited: 5/hour/IP (50 with a registered key), plus per-instance hourly and daily caps"
          },
          "503": {
            "description": "Not configured"
          },
          "401": {
            "description": "X-Citeda-Agent key not recognised"
          },
          "415": {
            "description": "content-type must be application/json"
          },
          "405": {
            "description": "Method not allowed (POST only)"
          },
          "413": {
            "description": "Payload too large (20 KB)"
          },
          "502": {
            "description": "Mail delivery failed; try again later"
          }
        },
        "description": "Flow: the inquiry is held as PENDING and a confirmation link is emailed to buyer.contact_email; the page behind it has a Confirm button that must be pressed (a POST), so link scanners and previews cannot confirm; only then does Sean act. Optional header X-Citeda-Agent: <key> marks a registered agent (limit 50/hour instead of 5; request a key by emailing sean@go.citeda.com, subject 'Agent key request'). Unknown keys get 401.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Citeda-Agent",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Registered agent key. Optional."
          }
        ]
      }
    },
    "/data/seoul/products.json": {
      "get": {
        "summary": "Seoul Now consumer product records: why Seoul is into each product, Seoul price, and a dated Amazon US status (seen / not_seen / unclear) with ASINs when seen",
        "responses": {
          "200": {
            "description": "JSON object with items[]",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/data/index.json": {
      "get": {
        "summary": "Catalog of every machine-readable file, status vocabularies, ids and the freshness rule. Start here.",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/data/seoul/popups.json": {
      "get": {
        "summary": "Pop-ups and store openings in Seoul: address, dates, hours, how to get there, products with dated Amazon US status",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/data/watchlist.json": {
      "get": {
        "summary": "Seller-side watchlist: products checked against Amazon US (gap / brand / early) with Seoul list prices; themes ranked by Korean YouTube views",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/data/briefs/index.json": {
      "get": {
        "summary": "Index of buyer briefs (each also has a markdown twin at /p/<slug>.md)",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/data/issues.json": {
      "get": {
        "summary": "Index of issues with product ids",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/confirm": {
      "get": {
        "summary": "Renders the confirmation page for an inquiry (link from the confirmation email). Not for agents to call.",
        "parameters": [
          {
            "in": "query",
            "name": "t",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HTML page with a Confirm button"
          },
          "400": {
            "description": "HTML: invalid link"
          },
          "410": {
            "description": "HTML: expired (7 days)"
          }
        }
      },
      "post": {
        "summary": "Confirms the inquiry (the button on the GET page). Form field t=<token>.",
        "responses": {
          "200": {
            "description": "HTML: confirmed"
          },
          "400": {
            "description": "HTML: invalid"
          },
          "410": {
            "description": "HTML: expired"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ProductList": {
        "type": "object",
        "properties": {
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "prd_46cm-deodorant-body-wash",
              "prd_healing-bird-revive-no-wash-treatment",
              "prd_tamburins",
              "prd_borntostandout",
              "prd_collagen-gel-masks",
              "prd_boj-stay-fresh-tone-up-spf50",
              "prd_modamoda-blue-biotin-scalp",
              "prd_vt-pdrn-tone-on-jelly-pack",
              "prd_tcfs-erasing-cover-cushion",
              "prd_mamacare-sea-grape-skin-pack",
              "prd_sollab-hair-root-aquapik-scaler",
              "prd_musinsa-standard-beauty-skincare"
            ]
          },
          "name": {
            "type": "string"
          },
          "brand_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "type": "string"
          },
          "signal": {
            "type": "string"
          },
          "tier": {
            "enum": [
              "feature",
              "watch"
            ]
          },
          "amazon_us": {
            "type": "object",
            "properties": {
              "listings": {
                "type": "integer"
              },
              "status": {
                "type": "string"
              },
              "checked": {
                "type": "string"
              }
            }
          }
        }
      },
      "InquiryRequest": {
        "type": "object",
        "required": [
          "buyer",
          "items"
        ],
        "properties": {
          "agent": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "operator": {
                "type": "string"
              }
            }
          },
          "buyer": {
            "type": "object",
            "required": [
              "business_name",
              "country",
              "contact_email"
            ],
            "properties": {
              "business_name": {
                "type": "string",
                "maxLength": 300
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              },
              "region": {
                "type": "string"
              },
              "website": {
                "type": "string",
                "format": "uri"
              },
              "contact_email": {
                "type": "string",
                "format": "email"
              },
              "reseller_license": {
                "type": "string",
                "description": "Resale or tax ID if the buyer wants wholesale pricing"
              }
            }
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "required": [
                "product_id",
                "quantity"
              ],
              "properties": {
                "product_id": {
                  "type": "string",
                  "enum": [
                    "prd_46cm-deodorant-body-wash",
                    "prd_healing-bird-revive-no-wash-treatment",
                    "prd_tamburins",
                    "prd_borntostandout",
                    "prd_collagen-gel-masks",
                    "prd_boj-stay-fresh-tone-up-spf50",
                    "prd_modamoda-blue-biotin-scalp",
                    "prd_vt-pdrn-tone-on-jelly-pack",
                    "prd_tcfs-erasing-cover-cushion",
                    "prd_mamacare-sea-grape-skin-pack",
                    "prd_sollab-hair-root-aquapik-scaler",
                    "prd_musinsa-standard-beauty-skincare"
                  ]
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                },
                "target_price_usd": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "nullable": true,
                  "description": "Number 0..1000000, or null/omitted."
                }
              }
            }
          },
          "message": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "InquiryReceipt": {
        "type": "object",
        "properties": {
          "inquiry_id": {
            "type": "string"
          },
          "status": {
            "const": "pending_confirmation"
          },
          "next": {
            "type": "string"
          },
          "referral_token": {
            "type": "string",
            "description": "Quote this when the brand or distributor replies."
          }
        }
      }
    }
  }
}