{"openapi":"3.1.0","info":{"title":"Mock furniture catalog API","version":"1.0.0","description":"A fictional furniture platform: catalog search, sandbox accounts and projects. Errors are application/problem+json."},"servers":[{"url":"https://furniture-catalog-api.avakode-dev.workers.dev"}],"tags":[{"name":"catalog"},{"name":"accounts"},{"name":"projects"},{"name":"assets"}],"paths":{"/v1/meta":{"get":{"tags":["catalog"],"summary":"Vocabulary, counts, currency rates","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Meta"}}}}}}},"/v1/pieces":{"get":{"tags":["catalog"],"summary":"Search pieces, or batch fetch with ?ids=","parameters":[{"name":"q","in":"query","required":false,"description":"Free text over title, category, materials, maker, period, tags and description. Plural-tolerant; most words must match. At most 200 characters and 16 words; longer text is refused with 422, not truncated.","schema":{"type":"string","maxLength":200}},{"name":"category","in":"query","required":false,"description":"Comma-separated or repeated; OR inside.","schema":{"type":"string","enum":["sideboard","credenza","cabinet","bookcase","dining_table","coffee_table","side_table","console_table","desk","dining_chair","lounge_chair","armchair","sofa","daybed","bench","stool","bed","nightstand","floor_lamp","table_lamp","pendant_lamp","wall_sconce","rug","mirror"]}},{"name":"material","in":"query","required":false,"description":"Matches any material of the piece; OR inside.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Style period; OR inside.","schema":{"type":"string"}},{"name":"maker","in":"query","required":false,"description":"Maker id or part of the maker name.","schema":{"type":"string"}},{"name":"seller_id","in":"query","required":false,"description":"Seller id.","schema":{"type":"string"}},{"name":"country","in":"query","required":false,"description":"Seller country (ISO 3166-1 alpha-2).","schema":{"type":"string"}},{"name":"city","in":"query","required":false,"description":"Seller city.","schema":{"type":"string"}},{"name":"stock","in":"query","required":false,"description":"Default in_stock,made_to_order. Also accepts available and any.","schema":{"type":"string"}},{"name":"min_width","in":"query","required":false,"description":"Minimum width in cm.","schema":{"type":"number"}},{"name":"max_width","in":"query","required":false,"description":"Maximum width in cm.","schema":{"type":"number"}},{"name":"min_depth","in":"query","required":false,"description":"Minimum depth in cm.","schema":{"type":"number"}},{"name":"max_depth","in":"query","required":false,"description":"Maximum depth in cm.","schema":{"type":"number"}},{"name":"min_height","in":"query","required":false,"description":"Minimum height in cm.","schema":{"type":"number"}},{"name":"max_height","in":"query","required":false,"description":"Maximum height in cm.","schema":{"type":"number"}},{"name":"min_price","in":"query","required":false,"description":"Minimum price in USD.","schema":{"type":"number"}},{"name":"max_price","in":"query","required":false,"description":"Maximum price in USD.","schema":{"type":"number"}},{"name":"include_price_on_request","in":"query","required":false,"description":"Default false when a price filter is set, otherwise true.","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort order.","schema":{"type":"string","enum":["relevance","price_asc","price_desc","newest","width_asc","width_desc"],"default":"relevance"}},{"name":"limit","in":"query","required":false,"description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"cursor","in":"query","required":false,"description":"next_cursor of the previous page. Only valid with identical filters.","schema":{"type":"string"}},{"name":"ids","in":"query","required":false,"description":"Batch mode: comma-separated piece ids (max 20). All other parameters are ignored; unknown ids are listed in `missing`.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PieceSearchResponse"},{"$ref":"#/components/schemas/PieceBatchResponse"}]}}}},"422":{"description":"Validation failed, unknown value or limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/pieces/{id}":{"get":{"tags":["catalog"],"summary":"One piece","parameters":[{"name":"id","in":"path","required":true,"description":"Piece id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Piece"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/sellers/{id}":{"get":{"tags":["catalog"],"summary":"Seller profile","parameters":[{"name":"id","in":"path","required":true,"description":"Seller id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seller"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/users":{"post":{"tags":["accounts"],"summary":"Create a sandbox account from a template (internal)","security":[{"internalKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeat a write safely: the same key with the same request returns the first response; the same key with a different request is a 409.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["template","name"],"additionalProperties":false,"properties":{"template":{"type":"string","enum":["designer","dealer","homeowner"]},"name":{"type":"string","maxLength":80}}}}}},"responses":{"200":{"description":"Repeated Idempotency-Key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed, unknown value or limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"limit_exceeded: the daily cap of new sandbox accounts is reached (Retry-After: seconds to midnight UTC)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me":{"get":{"tags":["accounts"],"summary":"The signed-in user","security":[{"internalKey":[],"userId":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/projects":{"get":{"tags":["projects"],"summary":"List projects","security":[{"internalKey":[],"userId":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProjectSummary"}}}}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["projects"],"summary":"Create a project","security":[{"internalKey":[],"userId":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeat a write safely: the same key with the same request returns the first response; the same key with a different request is a 409.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"client":{"type":"string"},"budget_usd":{"type":"number"},"notes":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed, unknown value or limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/projects/{id}":{"get":{"tags":["projects"],"summary":"Project with items","security":[{"internalKey":[],"userId":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Project id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"tags":["projects"],"summary":"Rename, set budget, client or notes (null clears)","security":[{"internalKey":[],"userId":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Project id","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeat a write safely: the same key with the same request returns the first response; the same key with a different request is a 409.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"client":{"type":["string","null"]},"budget_usd":{"type":["number","null"]},"notes":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed, unknown value or limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["projects"],"summary":"Delete a project","security":[{"internalKey":[],"userId":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Project id","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeat a write safely: the same key with the same request returns the first response; the same key with a different request is a 409.","schema":{"type":"string","maxLength":200}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/projects/{id}/items":{"post":{"tags":["projects"],"summary":"Add a piece; the same piece in the same room updates the existing item","security":[{"internalKey":[],"userId":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Project id","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeat a write safely: the same key with the same request returns the first response; the same key with a different request is a 409.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["piece_id"],"properties":{"piece_id":{"type":"string"},"room":{"type":"string","default":"General"},"quantity":{"type":"integer","minimum":1,"maximum":99},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"Merged into an existing item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddItemResponse"}}}},"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddItemResponse"}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Piece is sold","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed, unknown value or limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/projects/{id}/items/{item_id}":{"patch":{"tags":["projects"],"summary":"Swap (new piece_id), move, re-quantify or annotate an item","security":[{"internalKey":[],"userId":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Project id","schema":{"type":"string"}},{"name":"item_id","in":"path","required":true,"description":"Item id","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeat a write safely: the same key with the same request returns the first response; the same key with a different request is a 409.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"piece_id":{"type":"string"},"room":{"type":"string"},"quantity":{"type":"integer"},"note":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/ProjectItem"},"project":{"$ref":"#/components/schemas/ProjectSummary"}}}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Piece is sold, or the same piece is already in that room","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation failed, unknown value or limit exceeded","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["projects"],"summary":"Remove an item","security":[{"internalKey":[],"userId":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Project id","schema":{"type":"string"}},{"name":"item_id","in":"path","required":true,"description":"Item id","schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Repeat a write safely: the same key with the same request returns the first response; the same key with a different request is a 409.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed_item_id":{"type":"string"},"project":{"$ref":"#/components/schemas/ProjectSummary"}}}}}},"401":{"description":"Missing or wrong X-Internal-Key, or unknown X-User-Id","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/images/{piece_id}/{view}.svg":{"get":{"tags":["assets"],"summary":"Generated drawing of the piece (SVG)","parameters":[{"name":"piece_id","in":"path","required":true,"description":"Piece id","schema":{"type":"string"}},{"name":"view","in":"path","required":true,"schema":{"type":"string","enum":["front","side","detail","scale"]}}],"responses":{"200":{"description":"SVG image","content":{"image/svg+xml":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/pieces/{id}":{"get":{"tags":["assets"],"summary":"Listing page (HTML)","parameters":[{"name":"id","in":"path","required":true,"description":"Piece id","schema":{"type":"string"}}],"responses":{"200":{"description":"HTML","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Not found"}}}},"/sellers/{id}":{"get":{"tags":["assets"],"summary":"Seller page (HTML)","parameters":[{"name":"id","in":"path","required":true,"description":"Seller id","schema":{"type":"string"}}],"responses":{"200":{"description":"HTML","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Not found"}}}},"/openapi.json":{"get":{"tags":["assets"],"summary":"This document","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/":{"get":{"tags":["assets"],"summary":"Docs page (HTML)","responses":{"200":{"description":"HTML","content":{"text/html":{"schema":{"type":"string"}}}}}}}},"components":{"securitySchemes":{"internalKey":{"type":"apiKey","in":"header","name":"X-Internal-Key"},"userId":{"type":"apiKey","in":"header","name":"X-User-Id"}},"schemas":{"Problem":{"type":"object","required":["type","title","status","code","detail"],"properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string","enum":["validation_failed","unknown_value","not_found","unauthorized","forbidden","conflict","limit_exceeded","piece_unavailable","method_not_allowed","internal_error"]},"detail":{"type":"string"},"hint":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}},"Piece":{"type":"object","required":["id","title","category","maker","period","materials","dimensions_cm","price","price_usd","condition","stock","seller","ships_to","description","tags","images","listed_at","url"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["sideboard","credenza","cabinet","bookcase","dining_table","coffee_table","side_table","console_table","desk","dining_chair","lounge_chair","armchair","sofa","daybed","bench","stool","bed","nightstand","floor_lamp","table_lamp","pendant_lamp","wall_sconce","rug","mirror"]},"maker":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"period":{"type":"string","enum":["Art Deco","Bauhaus","Mid-Century Modern","Scandinavian Modern","Brutalist","Space Age","Postmodern","Japandi","Contemporary","Antique"]},"year":{"type":["integer","null"]},"origin_country":{"type":"string"},"materials":{"type":"array","items":{"type":"string","enum":["walnut","oak","teak","rosewood","ash","elm","pine","cherry","mahogany","birch","rattan","cane","brass","steel","chrome","aluminium","bronze","glass","marble","travertine","granite","ceramic","leather","bouclé","wool","linen","velvet","lacquer","paper","plaster"]}},"finish":{"type":["string","null"]},"dimensions_cm":{"type":"object","required":["width","depth","height"],"properties":{"width":{"type":"number"},"depth":{"type":"number"},"height":{"type":"number"},"seat_height":{"type":"number"},"diameter":{"type":"number"}}},"price":{"oneOf":[{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"number"},"currency":{"type":"string","enum":["USD","EUR","GBP"]}}},{"type":"null"}]},"price_usd":{"type":["number","null"]},"condition":{"type":"string","enum":["new","excellent","good","restored","patina"]},"stock":{"type":"object","required":["status","quantity","lead_time_weeks"],"properties":{"status":{"type":"string","enum":["in_stock","made_to_order","on_hold","sold"]},"quantity":{"type":"integer"},"lead_time_weeks":{"type":["integer","null"]}}},"seller":{"type":"object","required":["id","name","type","city","country"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["gallery","studio","maker","dealer"]},"city":{"type":"string"},"country":{"type":"string"}}},"ships_to":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"view":{"type":"string","enum":["front","side","detail","scale"]},"width":{"type":"integer"},"height":{"type":"integer"}}}},"listed_at":{"type":"string","format":"date"},"url":{"type":"string"}}},"Seller":{"allOf":[{"type":"object","required":["id","name","type","city","country"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["gallery","studio","maker","dealer"]},"city":{"type":"string"},"country":{"type":"string"}}},{"type":"object","properties":{"about":{"type":"string"},"founded":{"type":["integer","null"]},"piece_count":{"type":"integer"},"url":{"type":"string"}}}]},"Meta":{"type":"object","properties":{"catalog_version":{"type":"string"},"total_pieces":{"type":"integer"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/FacetCount"}},"periods":{"type":"array","items":{"$ref":"#/components/schemas/FacetCount"}},"materials":{"type":"array","items":{"$ref":"#/components/schemas/FacetCount"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/FacetCount"}},"cities":{"type":"array","items":{"$ref":"#/components/schemas/FacetCount"}},"currency_rates":{"type":"object","additionalProperties":{"type":"number"}}}},"FacetCount":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}}},"PieceSearchResponse":{"type":"object","required":["items","total","next_cursor","applied"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Piece"}},"total":{"type":"integer"},"next_cursor":{"type":["string","null"]},"applied":{"type":"object","description":"Normalized filters actually used."}}},"PieceBatchResponse":{"type":"object","required":["items","missing"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Piece"}},"missing":{"type":"array","items":{"type":"string"}}}},"User":{"type":"object","required":["id","name","role","seller_id","units","currency"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["designer","dealer","homeowner"]},"seller_id":{"type":["string","null"]},"units":{"type":"string","enum":["cm","in"]},"currency":{"type":"string","enum":["USD","EUR","GBP"]}}},"ProjectSummary":{"type":"object","required":["id","name","client","budget_usd","notes","item_count","rooms","total_usd","price_on_request_count","created_at","updated_at"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"client":{"type":["string","null"]},"budget_usd":{"type":["number","null"]},"notes":{"type":["string","null"]},"item_count":{"type":"integer"},"rooms":{"type":"array","items":{"type":"string"}},"total_usd":{"type":"number"},"price_on_request_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ProjectItem":{"type":"object","properties":{"id":{"type":"string"},"piece_id":{"type":"string"},"room":{"type":"string"},"quantity":{"type":"integer"},"note":{"type":["string","null"]},"added_at":{"type":"string"},"piece":{"type":["object","null"],"description":"Compact piece resolved from the current catalog."}}},"Project":{"allOf":[{"type":"object","required":["id","name","client","budget_usd","notes","item_count","rooms","total_usd","price_on_request_count","created_at","updated_at"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"client":{"type":["string","null"]},"budget_usd":{"type":["number","null"]},"notes":{"type":["string","null"]},"item_count":{"type":"integer"},"rooms":{"type":"array","items":{"type":"string"}},"total_usd":{"type":"number"},"price_on_request_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProjectItem"}}}}]},"AddItemResponse":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/ProjectItem"},"outcome":{"type":"string","enum":["added","updated"]},"project":{"$ref":"#/components/schemas/ProjectSummary"}}}}}}