{"openapi":"3.1.0","info":{"title":"Établi API","version":"0.1.0","description":"Order physical work in plain English. Post a project (or a single tender), answer a few questions, publish it to workshops, award a contract per leg, then place one order per unit of work. Établi finds the workshops, including ones not on Établi yet."},"tags":[{"name":"Projects","description":"Buyers: a request broken into legs, one workshop each"},{"name":"Tenders","description":"Buyers: from a sentence to a contract"},{"name":"Workshops","description":"Workshops: invitations and bids"},{"name":"Contracts","description":"Awarded work and weekly statements"},{"name":"Orders","description":"Units of work, routing and proof"},{"name":"Bid links","description":"Prospects Établi contacted: see the job, bid, ask"},{"name":"Sourcing","description":"Operators: matches, sourcing runs and prospects"},{"name":"Outreach","description":"Operators: messages to prospects and their channels"},{"name":"Accounts"},{"name":"Operators"},{"name":"System"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key, `etb_live_…` (`etb_test_…` outside production), for a buyer's, a workshop's or an operator's account"},"projectKey":{"type":"http","scheme":"bearer","description":"A project key, `etb_live_prj_…`, from a draft made without a key: reads that one project, answers its questions, mints claim codes"},"ownerToken":{"type":"http","scheme":"bearer","description":"An owner token, `etb_live_own_…`, from claiming a project (in the status page's link): reads it, its offers and events, reads and answers workshops' questions, revokes the agent's key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"not_found"},"message":{"type":"string"},"details":{}},"required":["code","message"]}},"required":["error"]},"WaitlistRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["buyer","workshop"]},"note":{"type":["string","null"],"maxLength":1000}},"required":["email","role"]},"Me":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/Account"},"workshop":{"$ref":"#/components/schemas/Workshop"}},"required":["account","workshop"]},"Account":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["buyer","workshop","operator"]},"name":{"type":"string"},"email":{"type":["string","null"],"format":"email"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","name","email","createdAt"]},"Workshop":{"type":["object","null"],"properties":{"id":{"type":"string"},"accountId":{"type":"string"},"name":{"type":"string"},"entity":{"type":"string","enum":["individual","business"]},"description":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]}},"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]}},"country":{"type":"string","minLength":2,"maxLength":2},"region":{"type":"string","maxLength":80},"serviceArea":{"type":["string","null"]},"postalCode":{"type":["string","null"]},"receivingAddress":{"type":["object","null"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"type":["string","null"],"maxLength":200,"default":null},"city":{"type":"string","minLength":1,"maxLength":100},"region":{"type":"string","minLength":2,"maxLength":2},"postalCode":{"type":"string","minLength":3,"maxLength":12},"country":{"type":"string","enum":["US"],"default":"US"}},"required":["name","line1","city","region","postalCode"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"weeklyCapacity":{"type":["integer","null"],"exclusiveMinimum":0},"rating":{"type":"number","minimum":0,"maximum":5},"onTimeRate":{"type":"number","minimum":0,"maximum":1},"completedOrders":{"type":"integer","minimum":0},"active":{"type":"boolean"},"source":{"type":"string","enum":["direct","application","outreach"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","accountId","name","entity","description","capabilities","certifications","country","region","serviceArea","postalCode","receivingAddress","email","phone","weeklyCapacity","rating","onTimeRate","completedOrders","active","source","createdAt"]},"OnboardedWorkshop":{"type":"object","properties":{"workshop":{"$ref":"#/components/schemas/Workshop"},"apiKey":{"type":"string","description":"Shown once. Give it to the workshop."}},"required":["workshop","apiKey"]},"OnboardWorkshopRequest":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"entity":{"type":"string","enum":["individual","business"],"default":"business"},"email":{"type":["string","null"],"format":"email","description":"Where Établi sends contracts and orders; also the account's email unless another account has it"},"description":{"type":"string","maxLength":2000,"description":"What they make or do, in their own words (embedded for matching)"},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"minItems":1},"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]},"default":[]},"country":{"type":"string","minLength":2,"maxLength":2,"default":"US"},"region":{"type":"string","minLength":1,"maxLength":80,"description":"Two-letter state code in the US; province or region elsewhere"},"serviceArea":{"type":["string","null"],"maxLength":80,"example":"Austin, TX","description":"City covered for on-site work"},"postalCode":{"type":["string","null"],"maxLength":12},"receivingAddress":{"type":["object","null"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"type":["string","null"],"maxLength":200,"default":null},"city":{"type":"string","minLength":1,"maxLength":100},"region":{"type":"string","minLength":2,"maxLength":2},"postalCode":{"type":"string","minLength":3,"maxLength":12},"country":{"type":"string","enum":["US"],"default":"US"}},"required":["name","line1","city","region","postalCode"],"description":"Where another leg's output is delivered to them (e.g. pots for a nursery)"},"phone":{"type":["string","null"],"maxLength":40},"weeklyCapacity":{"type":["integer","null"],"exclusiveMinimum":0}},"required":["name","capabilities","region"]},"Project":{"type":"object","properties":{"id":{"type":"string"},"buyerId":{"type":["string","null"]},"claim":{"type":"object","properties":{"status":{"type":"string","enum":["unclaimed","claimed","expired","discarded"]},"expiresAt":{"type":["string","null"],"format":"date-time"},"claimedAt":{"type":["string","null"],"format":"date-time"}},"required":["status","expiresAt","claimedAt"]},"draftedBy":{"type":["object","null"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"version":{"type":["string","null"],"maxLength":40,"default":null}},"required":["name"]},"next":{"type":["object","null"],"properties":{"action":{"type":"string","enum":["show_claim_link","answer_questions","wait_for_claim","wait_for_bids","review_offers","awarded","expired","discarded"]},"message":{"type":"string"},"url":{"type":["string","null"]},"checkAfter":{"type":["string","null"],"format":"date-time"}},"required":["action","message","url","checkAfter"]},"request":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["needs_clarification","ready","open","awarded","cancelled","declined"]},"legs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$"},"tenderId":{"type":"string"},"title":{"type":"string"},"role":{"type":"string"},"status":{"type":"string","enum":["needs_clarification","ready","open","awarded","cancelled","declined"]},"spec":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"type":"string","maxLength":600},"kind":{"type":"string","enum":["transform_and_ship","batch_production","on_site_service","field_data","other"]},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"minItems":1},"inputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1},"suppliedBy":{"type":"string","enum":["buyer","workshop","leg"]},"notes":{"type":["string","null"]},"fromLeg":{"type":["string","null"],"default":null}},"required":["item","suppliedBy","notes"]}},"work":{"type":"string","minLength":1},"output":{"type":"string","minLength":1},"price":{"type":"object","properties":{"ceilingCents":{"type":["integer","null"],"exclusiveMinimum":0},"per":{"type":"string","enum":["unit","job","hour","head","visit"]},"includes":{"type":"array","items":{"type":"string"}},"excludes":{"type":"array","items":{"type":"string"}}},"required":["ceilingCents","per","includes","excludes"]},"deadline":{"type":"object","properties":{"kind":{"type":"string","enum":["per_order","fixed_date","scheduled","flexible"]},"businessDays":{"type":["integer","null"],"exclusiveMinimum":0},"date":{"type":["string","null"],"format":"date"}},"required":["kind","businessDays","date"]},"proof":{"type":"array","items":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"minItems":1},"where":{"type":"object","properties":{"shipTo":{"type":"string"},"excludedRegions":{"type":"array","items":{"type":"string"}},"serviceArea":{"type":["string","null"]}},"required":["shipTo","excludedRegions","serviceArea"]},"rules":{"type":"object","properties":{"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]}},"notes":{"type":"array","items":{"type":"string"}}},"required":["certifications","notes"]},"volume":{"type":"object","properties":{"perWeek":{"type":["integer","null"],"minimum":0},"peakPerWeek":{"type":["integer","null"],"minimum":0},"totalUnits":{"type":["integer","null"],"minimum":0}},"required":["perWeek","peakPerWeek","totalUnits"]},"ordering":{"type":"string","enum":["per_order","one_off"]},"assumptions":{"type":"array","items":{"type":"string"}}},"required":["title","summary","kind","capabilities","inputs","work","output","price","deadline","proof","where","rules","volume","ordering","assumptions"]},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string"},"text":{"type":"string"},"why":{"type":"string"},"suggestedAnswer":{"type":["string","null"]},"answer":{"type":["string","null"]}},"required":["id","field","text","why","suggestedAnswer","answer"]}},"inputsFrom":{"type":"array","items":{"type":"object","properties":{"fromLeg":{"type":"string"},"item":{"type":"string"}},"required":["fromLeg","item"]}},"sourcing":{"type":"object","properties":{"lookFor":{"type":"string","minLength":3,"maxLength":500},"searchTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":120},"maxItems":8},"countries":{"type":["array","null"],"items":{"type":"string","minLength":2,"maxLength":2}},"preferOnshore":{"type":"boolean"}},"required":["lookFor","searchTerms","countries","preferOnshore"]},"invitedWorkshops":{"type":"integer","minimum":0},"biddingClosesAt":{"type":["string","null"],"format":"date-time"},"contractId":{"type":["string","null"]}},"required":["key","tenderId","title","role","status","spec","questions","inputsFrom","sourcing","invitedWorkshops","biddingClosesAt","contractId"]},"minItems":1},"engine":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","buyerId","claim","draftedBy","next","request","title","summary","status","legs","engine","createdAt","updatedAt"]},"DraftCreated":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"projectKey":{"type":"string"},"claim":{"type":"object","properties":{"url":{"type":"string"},"code":{"type":"string"},"codeExpiresAt":{"type":"string","format":"date-time"}},"required":["url","code","codeExpiresAt"]}},"required":["project","projectKey","claim"]},"CreateProjectRequest":{"type":"object","properties":{"request":{"type":"string","minLength":10,"maxLength":4000,"example":"I would like natural pastel colored self-watering potted plants shipped DTC on demand (with most customers in United States). Pots should be cheap and in lots of at most 100 and sent to a nursery for potting on shipping on demand. Nursery should support a variety of houseplants."},"answers":{"type":"array","items":{"type":"object","properties":{"leg":{"type":["string","null"],"maxLength":40,"default":null},"field":{"type":"string","minLength":1,"maxLength":100},"text":{"type":"string","minLength":1,"maxLength":500},"answer":{"type":"string","minLength":1,"maxLength":1000}},"required":["field","text","answer"]},"maxItems":40,"default":[],"description":"Without a key: answers to the questions a preview returned, each with its leg's key. With a buyer key, answer each leg's questions with POST /v1/tenders/{tenderId}/answers instead."},"contact":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"minLength":2,"maxLength":120,"default":null},"email":{"type":"string","maxLength":254,"format":"email"}},"default":null,"required":["email"],"description":"Without a key, and only with the person's consent: their name and email, to prefill the claim page (shown masked)."},"agent":{"type":["object","null"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"version":{"type":["string","null"],"maxLength":40,"default":null}},"default":null,"required":["name"],"description":"Without a key: the agent, as it names itself, e.g. { \"name\": \"claude-code\" }."}},"required":["request"]},"ClaimCodeIssued":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"claim":{"type":"object","properties":{"url":{"type":"string"},"code":{"type":"string"},"codeExpiresAt":{"type":"string","format":"date-time"}},"required":["url","code","codeExpiresAt"]}},"required":["project","claim"]},"ClaimCodeRequest":{"type":"object","properties":{"ttlMinutes":{"type":"integer","minimum":5,"maximum":1440,"default":15,"description":"How long the code works: 15 minutes by default, up to 24 hours when nobody is watching (a background run)"}}},"ProjectEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"legKey":{"type":["string","null"]},"summary":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","type","legKey","summary","createdAt"]},"PublishProjectRequest":{"type":"object","properties":{"biddingHours":{"type":"integer","minimum":1,"maximum":336}}},"ProjectOffers":{"type":"object","properties":{"legs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$"},"title":{"type":"string"},"tenderId":{"type":"string"},"offers":{"type":"array","items":{"type":"object","properties":{"bidId":{"type":"string"},"workshop":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"entity":{"type":"string","enum":["individual","business"]},"country":{"type":"string"},"region":{"type":"string"},"rating":{"type":"number"},"onTimeRate":{"type":"number"},"completedOrders":{"type":"integer"}},"required":["id","name","entity","country","region","rating","onTimeRate","completedOrders"]},"buyerUnitPriceCents":{"type":"integer","exclusiveMinimum":0},"weeklyCapacity":{"type":"integer","exclusiveMinimum":0},"leadTimeDays":{"type":["integer","null"]},"note":{"type":["string","null"]},"portfolio":{"type":"array","items":{"type":"string"}},"withinCeiling":{"type":"boolean"},"score":{"type":"number"},"recommended":{"type":["string","null"],"enum":["primary","backup",null]}},"required":["bidId","workshop","buyerUnitPriceCents","weeklyCapacity","leadTimeDays","note","portfolio","withinCeiling","score","recommended"]}}},"required":["key","title","tenderId","offers"]}},"combined":{"type":"object","properties":{"perUnitCents":{"type":["integer","null"]},"note":{"type":"string"}},"required":["perUnitCents","note"]}},"required":["legs","combined"]},"ProjectAward":{"type":"object","properties":{"contracts":{"type":"array","items":{"type":"object","properties":{"leg":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$"},"contract":{"type":"object","properties":{"id":{"type":"string"},"tenderId":{"type":"string"},"buyerId":{"type":"string"},"title":{"type":"string"},"primaryWorkshopId":{"type":"string"},"backupWorkshopId":{"type":["string","null"]},"buyerUnitPriceCents":{"type":"integer","exclusiveMinimum":0},"primaryUnitPriceCents":{"type":"integer","exclusiveMinimum":0},"backupUnitPriceCents":{"type":["integer","null"],"exclusiveMinimum":0},"feeRate":{"type":"number","minimum":0,"maximum":0.5},"backupShare":{"type":"number","minimum":0,"maximum":0.5},"orderCount":{"type":"integer","minimum":0},"status":{"type":"string","enum":["active","paused","ended"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","tenderId","buyerId","title","primaryWorkshopId","backupWorkshopId","buyerUnitPriceCents","primaryUnitPriceCents","backupUnitPriceCents","feeRate","backupShare","orderCount","status","createdAt"]}},"required":["leg","contract"]}}},"required":["contracts"]},"AwardProjectRequest":{"type":"object","properties":{"legs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"pots"},"primaryBidId":{"type":"string"},"backupBidId":{"type":["string","null"],"description":"null for no backup"}},"required":["key"]},"description":"Choices per leg; legs left out get Établi's recommendation"}}},"ClaimView":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"draftedAt":{"type":"string","format":"date-time"},"code":{"type":"string"},"codeExpiresAt":{"type":"string","format":"date-time"},"contactHint":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"emailMasked":{"type":"string"}},"required":["name","emailMasked"]},"maxCostCents":{"type":["integer","null"]},"publishing":{"type":"object","properties":{"maxInvites":{"type":"integer"},"minInvites":{"type":"integer"},"defaultBiddingHours":{"type":"integer"}},"required":["maxInvites","minInvites","defaultBiddingHours"]}},"required":["project","draftedAt","code","codeExpiresAt","contactHint","maxCostCents","publishing"]},"ClaimResult":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"statusUrl":{"type":"string"}},"required":["project","statusUrl"]},"ClaimRequest":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120,"example":"Maya Ortiz"},"email":{"type":"string","maxLength":254,"format":"email","example":"maya@example.com"},"company":{"type":["string","null"],"maxLength":120,"default":null},"answers":{"type":"array","items":{"type":"object","properties":{"leg":{"type":["string","null"],"maxLength":40,"default":null},"field":{"type":"string","minLength":1,"maxLength":100},"text":{"type":"string","minLength":1,"maxLength":500},"answer":{"type":"string","minLength":1,"maxLength":1000}},"required":["field","text","answer"]},"maxItems":40,"default":[],"description":"Questions still open on the draft, answered here, each with its leg's key"},"biddingHours":{"type":"integer","minimum":24,"maximum":336,"description":"How long workshops can bid (48 hours by default)"},"agentMay":{"type":"array","items":{"type":"string","enum":["answer_clarifications"]},"default":[],"description":"What the agent may go on doing: `answer_clarifications` lets it answer workshops' questions"},"confirmed":{"type":"boolean","enum":[true],"description":"The person ticked \"I asked an AI agent for this\""}},"required":["name","email","confirmed"]},"Tender":{"type":"object","properties":{"id":{"type":"string"},"buyerId":{"type":["string","null"]},"request":{"type":"string"},"projectId":{"type":["string","null"]},"legKey":{"type":["string","null"]},"status":{"type":"string","enum":["needs_clarification","ready","open","awarded","cancelled","declined"]},"spec":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"type":"string","maxLength":600},"kind":{"type":"string","enum":["transform_and_ship","batch_production","on_site_service","field_data","other"]},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"minItems":1},"inputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1},"suppliedBy":{"type":"string","enum":["buyer","workshop","leg"]},"notes":{"type":["string","null"]},"fromLeg":{"type":["string","null"],"default":null}},"required":["item","suppliedBy","notes"]}},"work":{"type":"string","minLength":1},"output":{"type":"string","minLength":1},"price":{"type":"object","properties":{"ceilingCents":{"type":["integer","null"],"exclusiveMinimum":0},"per":{"type":"string","enum":["unit","job","hour","head","visit"]},"includes":{"type":"array","items":{"type":"string"}},"excludes":{"type":"array","items":{"type":"string"}}},"required":["ceilingCents","per","includes","excludes"]},"deadline":{"type":"object","properties":{"kind":{"type":"string","enum":["per_order","fixed_date","scheduled","flexible"]},"businessDays":{"type":["integer","null"],"exclusiveMinimum":0},"date":{"type":["string","null"],"format":"date"}},"required":["kind","businessDays","date"]},"proof":{"type":"array","items":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"minItems":1},"where":{"type":"object","properties":{"shipTo":{"type":"string"},"excludedRegions":{"type":"array","items":{"type":"string"}},"serviceArea":{"type":["string","null"]}},"required":["shipTo","excludedRegions","serviceArea"]},"rules":{"type":"object","properties":{"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]}},"notes":{"type":"array","items":{"type":"string"}}},"required":["certifications","notes"]},"volume":{"type":"object","properties":{"perWeek":{"type":["integer","null"],"minimum":0},"peakPerWeek":{"type":["integer","null"],"minimum":0},"totalUnits":{"type":["integer","null"],"minimum":0}},"required":["perWeek","peakPerWeek","totalUnits"]},"ordering":{"type":"string","enum":["per_order","one_off"]},"assumptions":{"type":"array","items":{"type":"string"}}},"required":["title","summary","kind","capabilities","inputs","work","output","price","deadline","proof","where","rules","volume","ordering","assumptions"]},"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string"},"text":{"type":"string"},"why":{"type":"string"},"suggestedAnswer":{"type":["string","null"]},"answer":{"type":["string","null"]}},"required":["id","field","text","why","suggestedAnswer","answer"]}},"specEngine":{"type":"string"},"declineReason":{"type":["string","null"]},"invitedWorkshops":{"type":"integer","minimum":0},"biddingClosesAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","buyerId","request","projectId","legKey","status","spec","questions","specEngine","declineReason","invitedWorkshops","biddingClosesAt","createdAt","updatedAt"]},"CreateTenderRequest":{"type":"object","properties":{"request":{"type":"string","minLength":10,"maxLength":4000,"example":"Paying up to $5 to intake pots and on demand fill them with soil and a plant and ship to customer with a max delay of 2 business days."}},"required":["request"]},"AnswerQuestionsRequest":{"type":"object","properties":{"answers":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string"},"answer":{"type":"string","minLength":1,"maxLength":1000}},"required":["questionId","answer"]},"default":[]},"acceptSuggested":{"type":"boolean","default":false,"description":"Answer every open question that has a suggested answer with that suggestion"}}},"PublishTenderRequest":{"type":"object","properties":{"biddingHours":{"type":"integer","minimum":1,"maximum":336}}},"Offer":{"type":"object","properties":{"bidId":{"type":"string"},"workshop":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"entity":{"type":"string","enum":["individual","business"]},"country":{"type":"string"},"region":{"type":"string"},"rating":{"type":"number"},"onTimeRate":{"type":"number"},"completedOrders":{"type":"integer"}},"required":["id","name","entity","country","region","rating","onTimeRate","completedOrders"]},"buyerUnitPriceCents":{"type":"integer","exclusiveMinimum":0},"weeklyCapacity":{"type":"integer","exclusiveMinimum":0},"leadTimeDays":{"type":["integer","null"]},"note":{"type":["string","null"]},"portfolio":{"type":"array","items":{"type":"string"}},"withinCeiling":{"type":"boolean"},"score":{"type":"number"},"recommended":{"type":["string","null"],"enum":["primary","backup",null]}},"required":["bidId","workshop","buyerUnitPriceCents","weeklyCapacity","leadTimeDays","note","portfolio","withinCeiling","score","recommended"]},"Contract":{"type":"object","properties":{"id":{"type":"string"},"tenderId":{"type":"string"},"buyerId":{"type":"string"},"title":{"type":"string"},"primaryWorkshopId":{"type":"string"},"backupWorkshopId":{"type":["string","null"]},"buyerUnitPriceCents":{"type":"integer","exclusiveMinimum":0},"primaryUnitPriceCents":{"type":"integer","exclusiveMinimum":0},"backupUnitPriceCents":{"type":["integer","null"],"exclusiveMinimum":0},"feeRate":{"type":"number","minimum":0,"maximum":0.5},"backupShare":{"type":"number","minimum":0,"maximum":0.5},"orderCount":{"type":"integer","minimum":0},"status":{"type":"string","enum":["active","paused","ended"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","tenderId","buyerId","title","primaryWorkshopId","backupWorkshopId","buyerUnitPriceCents","primaryUnitPriceCents","backupUnitPriceCents","feeRate","backupShare","orderCount","status","createdAt"]},"AwardTenderRequest":{"type":"object","properties":{"primaryBidId":{"type":"string","description":"Defaults to Établi's recommendation"},"backupBidId":{"type":["string","null"],"description":"null for no backup"}}},"Invitation":{"type":"object","properties":{"tenderId":{"type":"string"},"title":{"type":"string"},"spec":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"type":"string","maxLength":600},"kind":{"type":"string","enum":["transform_and_ship","batch_production","on_site_service","field_data","other"]},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"minItems":1},"inputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1},"suppliedBy":{"type":"string","enum":["buyer","workshop","leg"]},"notes":{"type":["string","null"]},"fromLeg":{"type":["string","null"],"default":null}},"required":["item","suppliedBy","notes"]}},"work":{"type":"string","minLength":1},"output":{"type":"string","minLength":1},"price":{"type":"object","properties":{"ceilingCents":{"type":["integer","null"],"exclusiveMinimum":0},"per":{"type":"string","enum":["unit","job","hour","head","visit"]},"includes":{"type":"array","items":{"type":"string"}},"excludes":{"type":"array","items":{"type":"string"}}},"required":["ceilingCents","per","includes","excludes"]},"deadline":{"type":"object","properties":{"kind":{"type":"string","enum":["per_order","fixed_date","scheduled","flexible"]},"businessDays":{"type":["integer","null"],"exclusiveMinimum":0},"date":{"type":["string","null"],"format":"date"}},"required":["kind","businessDays","date"]},"proof":{"type":"array","items":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"minItems":1},"where":{"type":"object","properties":{"shipTo":{"type":"string"},"excludedRegions":{"type":"array","items":{"type":"string"}},"serviceArea":{"type":["string","null"]}},"required":["shipTo","excludedRegions","serviceArea"]},"rules":{"type":"object","properties":{"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]}},"notes":{"type":"array","items":{"type":"string"}}},"required":["certifications","notes"]},"volume":{"type":"object","properties":{"perWeek":{"type":["integer","null"],"minimum":0},"peakPerWeek":{"type":["integer","null"],"minimum":0},"totalUnits":{"type":["integer","null"],"minimum":0}},"required":["perWeek","peakPerWeek","totalUnits"]},"ordering":{"type":"string","enum":["per_order","one_off"]},"assumptions":{"type":"array","items":{"type":"string"}}},"required":["title","summary","kind","capabilities","inputs","work","output","price","deadline","proof","where","rules","volume","ordering","assumptions"]},"biddingClosesAt":{"type":["string","null"],"format":"date-time"},"maxBidCents":{"type":["integer","null"],"description":"Highest unit bid within the buyer's ceiling"},"bid":{"type":["object","null"],"properties":{"id":{"type":"string"},"tenderId":{"type":"string"},"workshopId":{"type":"string"},"unitPriceCents":{"type":"integer","exclusiveMinimum":0},"weeklyCapacity":{"type":"integer","exclusiveMinimum":0},"leadTimeDays":{"type":["integer","null"],"minimum":0},"note":{"type":["string","null"],"maxLength":500},"portfolio":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":6},"status":{"type":"string","enum":["submitted","withdrawn","won","backup","lost"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","tenderId","workshopId","unitPriceCents","weeklyCapacity","leadTimeDays","note","portfolio","status","createdAt","updatedAt"]},"clarifications":{"type":"array","items":{"$ref":"#/components/schemas/Clarification"},"description":"Answered questions (shared with every bidder) and your own open ones"}},"required":["tenderId","title","spec","biddingClosesAt","maxBidCents","bid","clarifications"]},"Clarification":{"type":"object","properties":{"id":{"type":"string"},"tenderId":{"type":"string"},"question":{"type":"string","minLength":3,"maxLength":1000},"answer":{"type":["string","null"]},"askedBy":{"type":["object","null"],"properties":{"workshopId":{"type":"string"},"name":{"type":"string"}},"required":["workshopId","name"]},"createdAt":{"type":"string","format":"date-time"},"answeredAt":{"type":["string","null"],"format":"date-time"}},"required":["id","tenderId","question","answer","askedBy","createdAt","answeredAt"]},"Bid":{"type":"object","properties":{"id":{"type":"string"},"tenderId":{"type":"string"},"workshopId":{"type":"string"},"unitPriceCents":{"type":"integer","exclusiveMinimum":0},"weeklyCapacity":{"type":"integer","exclusiveMinimum":0},"leadTimeDays":{"type":["integer","null"],"minimum":0},"note":{"type":["string","null"],"maxLength":500},"portfolio":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":6},"status":{"type":"string","enum":["submitted","withdrawn","won","backup","lost"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","tenderId","workshopId","unitPriceCents","weeklyCapacity","leadTimeDays","note","portfolio","status","createdAt","updatedAt"]},"BidRequest":{"type":"object","properties":{"unitPriceCents":{"type":"integer","exclusiveMinimum":0,"example":430,"description":"Your net price per unit, before Établi's fee"},"weeklyCapacity":{"type":"integer","exclusiveMinimum":0,"example":300},"leadTimeDays":{"type":["integer","null"],"minimum":0,"maximum":365},"note":{"type":["string","null"],"maxLength":500},"portfolio":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":6,"description":"Up to six photo URLs of similar past work, shown to the buyer with your bid","example":["https://example.com/work/quarter-zip-embroidery.jpg"]}},"required":["unitPriceCents","weeklyCapacity"]},"BidLinkView":{"type":"object","properties":{"leg":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string"},"spec":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"type":"string","maxLength":600},"kind":{"type":"string","enum":["transform_and_ship","batch_production","on_site_service","field_data","other"]},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"minItems":1},"inputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1},"suppliedBy":{"type":"string","enum":["buyer","workshop","leg"]},"notes":{"type":["string","null"]},"fromLeg":{"type":["string","null"],"default":null}},"required":["item","suppliedBy","notes"]}},"work":{"type":"string","minLength":1},"output":{"type":"string","minLength":1},"price":{"type":"object","properties":{"ceilingCents":{"type":["integer","null"],"exclusiveMinimum":0},"per":{"type":"string","enum":["unit","job","hour","head","visit"]},"includes":{"type":"array","items":{"type":"string"}},"excludes":{"type":"array","items":{"type":"string"}}},"required":["ceilingCents","per","includes","excludes"]},"deadline":{"type":"object","properties":{"kind":{"type":"string","enum":["per_order","fixed_date","scheduled","flexible"]},"businessDays":{"type":["integer","null"],"exclusiveMinimum":0},"date":{"type":["string","null"],"format":"date"}},"required":["kind","businessDays","date"]},"proof":{"type":"array","items":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"minItems":1},"where":{"type":"object","properties":{"shipTo":{"type":"string"},"excludedRegions":{"type":"array","items":{"type":"string"}},"serviceArea":{"type":["string","null"]}},"required":["shipTo","excludedRegions","serviceArea"]},"rules":{"type":"object","properties":{"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]}},"notes":{"type":"array","items":{"type":"string"}}},"required":["certifications","notes"]},"volume":{"type":"object","properties":{"perWeek":{"type":["integer","null"],"minimum":0},"peakPerWeek":{"type":["integer","null"],"minimum":0},"totalUnits":{"type":["integer","null"],"minimum":0}},"required":["perWeek","peakPerWeek","totalUnits"]},"ordering":{"type":"string","enum":["per_order","one_off"]},"assumptions":{"type":"array","items":{"type":"string"}}},"required":["title","summary","kind","capabilities","inputs","work","output","price","deadline","proof","where","rules","volume","ordering","assumptions"]}},"required":["title","role","spec"]},"projectTitle":{"type":"string"},"invitedAs":{"type":"string"},"maxBidCents":{"type":["integer","null"]},"clarifications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tenderId":{"type":"string"},"question":{"type":"string","minLength":3,"maxLength":1000},"answer":{"type":["string","null"]},"askedBy":{"type":["object","null"],"properties":{"workshopId":{"type":"string"},"name":{"type":"string"}},"required":["workshopId","name"]},"createdAt":{"type":"string","format":"date-time"},"answeredAt":{"type":["string","null"],"format":"date-time"}},"required":["id","tenderId","question","answer","askedBy","createdAt","answeredAt"]}},"closesAt":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["open","closed","bid_submitted","declined"]}},"required":["leg","projectTitle","invitedAs","maxBidCents","clarifications","closesAt","status"]},"BidLinkBidRequest":{"type":"object","properties":{"business":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":160},"entity":{"type":"string","enum":["individual","business"]},"email":{"type":"string","format":"email"},"phone":{"type":["string","null"],"maxLength":40,"default":null},"website":{"type":["string","null"],"maxLength":300,"default":null},"country":{"type":"string","minLength":2,"maxLength":2},"region":{"type":["string","null"],"maxLength":80,"default":null},"city":{"type":["string","null"],"maxLength":80,"default":null},"description":{"type":"string","minLength":20,"maxLength":2000}},"required":["name","entity","email","country","description"]},"unitPriceCents":{"type":"integer","exclusiveMinimum":0},"weeklyCapacity":{"type":"integer","exclusiveMinimum":0},"leadTimeDays":{"type":["integer","null"],"minimum":0,"maximum":365,"default":null},"note":{"type":["string","null"],"maxLength":500,"default":null},"portfolio":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":6,"default":[]}},"required":["business","unitPriceCents","weeklyCapacity"]},"BidLinkQuestionRequest":{"type":"object","properties":{"business":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":160},"phone":{"type":["string","null"],"maxLength":40,"default":null},"email":{"type":["string","null"],"format":"email","default":null}},"required":["name"]},"question":{"type":"string","minLength":3,"maxLength":1000}},"required":["business","question"]},"BidLinkDeclineRequest":{"type":"object","properties":{"reason":{"type":["string","null"],"maxLength":1000,"default":null}}},"AskClarificationRequest":{"type":"object","properties":{"question":{"type":"string","minLength":3,"maxLength":1000,"example":"Is there parking on site, or should we plan for street parking?"}},"required":["question"]},"AnswerClarificationRequest":{"type":"object","properties":{"answer":{"type":"string","minLength":1,"maxLength":2000,"example":"Street parking only; it's free before 10am."}},"required":["answer"]},"WorkshopApplicationRequest":{"type":"object","properties":{"entity":{"type":"string","enum":["individual","business"]},"name":{"type":"string","minLength":2,"maxLength":120},"email":{"type":"string","format":"email"},"description":{"type":"string","minLength":20,"maxLength":2000},"trades":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"maxItems":12,"default":[]},"area":{"type":"string","minLength":2,"maxLength":80},"country":{"type":"string","minLength":2,"maxLength":2,"default":"US"},"website":{"type":["string","null"],"maxLength":300,"default":null},"weeklyCapacity":{"type":["integer","null"],"exclusiveMinimum":0,"maximum":100000,"default":null},"note":{"type":["string","null"],"maxLength":1000,"default":null}},"required":["entity","name","email","description","area"]},"WorkshopApplication":{"type":"object","properties":{"entity":{"type":"string","enum":["individual","business"]},"name":{"type":"string","minLength":2,"maxLength":120},"email":{"type":"string","format":"email"},"description":{"type":"string","minLength":20,"maxLength":2000},"trades":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"maxItems":12,"default":[]},"area":{"type":"string","minLength":2,"maxLength":80},"country":{"type":"string","minLength":2,"maxLength":2,"default":"US"},"website":{"type":["string","null"],"maxLength":300,"default":null},"weeklyCapacity":{"type":["integer","null"],"exclusiveMinimum":0,"maximum":100000,"default":null},"note":{"type":["string","null"],"maxLength":1000,"default":null},"id":{"type":"string"},"status":{"type":"string","enum":["new","approved","declined"]},"workshopId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["entity","name","email","description","area","id","status","workshopId","createdAt"]},"ApproveApplicationRequest":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"description":"Override the trades they picked"},"region":{"type":"string","maxLength":80,"description":"State code in the US (read from their area when omitted)"},"serviceArea":{"type":["string","null"],"maxLength":80,"description":"City covered for on-site work, e.g. Austin, TX"}}},"DeclineApplicationRequest":{"type":"object","properties":{"reason":{"type":["string","null"],"maxLength":1000}}},"PlanPreview":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"legs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$"},"title":{"type":"string"},"role":{"type":"string"},"spec":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"type":"string","maxLength":600},"kind":{"type":"string","enum":["transform_and_ship","batch_production","on_site_service","field_data","other"]},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"minItems":1},"inputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1},"suppliedBy":{"type":"string","enum":["buyer","workshop","leg"]},"notes":{"type":["string","null"]},"fromLeg":{"type":["string","null"],"default":null}},"required":["item","suppliedBy","notes"]}},"work":{"type":"string","minLength":1},"output":{"type":"string","minLength":1},"price":{"type":"object","properties":{"ceilingCents":{"type":["integer","null"],"exclusiveMinimum":0},"per":{"type":"string","enum":["unit","job","hour","head","visit"]},"includes":{"type":"array","items":{"type":"string"}},"excludes":{"type":"array","items":{"type":"string"}}},"required":["ceilingCents","per","includes","excludes"]},"deadline":{"type":"object","properties":{"kind":{"type":"string","enum":["per_order","fixed_date","scheduled","flexible"]},"businessDays":{"type":["integer","null"],"exclusiveMinimum":0},"date":{"type":["string","null"],"format":"date"}},"required":["kind","businessDays","date"]},"proof":{"type":"array","items":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"minItems":1},"where":{"type":"object","properties":{"shipTo":{"type":"string"},"excludedRegions":{"type":"array","items":{"type":"string"}},"serviceArea":{"type":["string","null"]}},"required":["shipTo","excludedRegions","serviceArea"]},"rules":{"type":"object","properties":{"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]}},"notes":{"type":"array","items":{"type":"string"}}},"required":["certifications","notes"]},"volume":{"type":"object","properties":{"perWeek":{"type":["integer","null"],"minimum":0},"peakPerWeek":{"type":["integer","null"],"minimum":0},"totalUnits":{"type":["integer","null"],"minimum":0}},"required":["perWeek","peakPerWeek","totalUnits"]},"ordering":{"type":"string","enum":["per_order","one_off"]},"assumptions":{"type":"array","items":{"type":"string"}}},"required":["title","summary","kind","capabilities","inputs","work","output","price","deadline","proof","where","rules","volume","ordering","assumptions"]},"questions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"text":{"type":"string"},"why":{"type":"string"},"suggestedAnswer":{"type":["string","null"]}},"required":["field","text","why","suggestedAnswer"]}},"inputsFrom":{"type":"array","items":{"type":"object","properties":{"fromLeg":{"type":"string"},"item":{"type":"string"}},"required":["fromLeg","item"]}},"sourcing":{"type":"object","properties":{"lookFor":{"type":"string","minLength":3,"maxLength":500},"searchTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":120},"maxItems":8},"countries":{"type":["array","null"],"items":{"type":"string","minLength":2,"maxLength":2}},"preferOnshore":{"type":"boolean"}},"required":["lookFor","searchTerms","countries","preferOnshore"]}},"required":["key","title","role","spec","questions","inputsFrom","sourcing"]},"minItems":1},"engine":{"type":"string"}},"required":["title","summary","legs","engine"]},"QuotePreviewRequest":{"type":"object","properties":{"request":{"type":"string","minLength":10,"maxLength":2000},"answers":{"type":"array","items":{"type":"object","properties":{"leg":{"type":["string","null"],"maxLength":40,"default":null},"field":{"type":"string","minLength":1,"maxLength":100},"text":{"type":"string","minLength":1,"maxLength":500},"answer":{"type":"string","minLength":1,"maxLength":1000}},"required":["field","text","answer"]},"maxItems":20,"default":[]}},"required":["request"]},"QuoteRequestRequest":{"type":"object","properties":{"request":{"type":"string","minLength":10,"maxLength":2000},"answers":{"type":"array","items":{"type":"object","properties":{"leg":{"type":["string","null"],"maxLength":40,"default":null},"field":{"type":"string","minLength":1,"maxLength":100},"text":{"type":"string","minLength":1,"maxLength":500},"answer":{"type":"string","minLength":1,"maxLength":1000}},"required":["field","text","answer"]},"maxItems":20,"default":[]},"name":{"type":"string","minLength":2,"maxLength":120},"email":{"type":"string","format":"email"},"company":{"type":["string","null"],"maxLength":120,"default":null},"note":{"type":["string","null"],"maxLength":1000,"default":null}},"required":["request","name","email"]},"QuoteRequest":{"type":"object","properties":{"id":{"type":"string"},"request":{"type":"string"},"answers":{"type":"array","items":{"type":"object","properties":{"leg":{"type":["string","null"],"maxLength":40,"default":null},"field":{"type":"string","minLength":1,"maxLength":100},"text":{"type":"string","minLength":1,"maxLength":500},"answer":{"type":"string","minLength":1,"maxLength":1000}},"required":["field","text","answer"]}},"plan":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"legs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,39}$"},"title":{"type":"string"},"role":{"type":"string"},"spec":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"type":"string","maxLength":600},"kind":{"type":"string","enum":["transform_and_ship","batch_production","on_site_service","field_data","other"]},"capabilities":{"type":"array","items":{"type":"string","enum":["cleaning.home","cleaning.turnover","cleaning.office","laundry.linens","apparel.screen_printing","apparel.embroidery","apparel.dtf","plants.potting","plants.live_shipping","ceramics.production","plastics.molding","packaging.printing","labels.printing","engraving.laser","candles.pouring","cosmetics.filling","food.co_packing","food.catering","kitting.assembly","fulfillment.parcel","photography.product","field.photo_audit","returns.grading","property.maintenance","machining.cnc","electronics.assembly","data.video_capture"]},"minItems":1},"inputs":{"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1},"suppliedBy":{"type":"string","enum":["buyer","workshop","leg"]},"notes":{"type":["string","null"]},"fromLeg":{"type":["string","null"],"default":null}},"required":["item","suppliedBy","notes"]}},"work":{"type":"string","minLength":1},"output":{"type":"string","minLength":1},"price":{"type":"object","properties":{"ceilingCents":{"type":["integer","null"],"exclusiveMinimum":0},"per":{"type":"string","enum":["unit","job","hour","head","visit"]},"includes":{"type":"array","items":{"type":"string"}},"excludes":{"type":"array","items":{"type":"string"}}},"required":["ceilingCents","per","includes","excludes"]},"deadline":{"type":"object","properties":{"kind":{"type":"string","enum":["per_order","fixed_date","scheduled","flexible"]},"businessDays":{"type":["integer","null"],"exclusiveMinimum":0},"date":{"type":["string","null"],"format":"date"}},"required":["kind","businessDays","date"]},"proof":{"type":"array","items":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"minItems":1},"where":{"type":"object","properties":{"shipTo":{"type":"string"},"excludedRegions":{"type":"array","items":{"type":"string"}},"serviceArea":{"type":["string","null"]}},"required":["shipTo","excludedRegions","serviceArea"]},"rules":{"type":"object","properties":{"certifications":{"type":"array","items":{"type":"string","enum":["nursery_license","fda_food_facility","food_handler","general_liability","background_checked","bonded"]}},"notes":{"type":"array","items":{"type":"string"}}},"required":["certifications","notes"]},"volume":{"type":"object","properties":{"perWeek":{"type":["integer","null"],"minimum":0},"peakPerWeek":{"type":["integer","null"],"minimum":0},"totalUnits":{"type":["integer","null"],"minimum":0}},"required":["perWeek","peakPerWeek","totalUnits"]},"ordering":{"type":"string","enum":["per_order","one_off"]},"assumptions":{"type":"array","items":{"type":"string"}}},"required":["title","summary","kind","capabilities","inputs","work","output","price","deadline","proof","where","rules","volume","ordering","assumptions"]},"questions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"text":{"type":"string"},"why":{"type":"string"},"suggestedAnswer":{"type":["string","null"]}},"required":["field","text","why","suggestedAnswer"]}},"inputsFrom":{"type":"array","items":{"type":"object","properties":{"fromLeg":{"type":"string"},"item":{"type":"string"}},"required":["fromLeg","item"]}},"sourcing":{"type":"object","properties":{"lookFor":{"type":"string","minLength":3,"maxLength":500},"searchTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":120},"maxItems":8},"countries":{"type":["array","null"],"items":{"type":"string","minLength":2,"maxLength":2}},"preferOnshore":{"type":"boolean"}},"required":["lookFor","searchTerms","countries","preferOnshore"]}},"required":["key","title","role","spec","questions","inputsFrom","sourcing"]},"minItems":1},"engine":{"type":"string"}},"required":["title","summary","legs","engine"]},"name":{"type":"string"},"email":{"type":"string"},"company":{"type":["string","null"]},"note":{"type":["string","null"]},"status":{"type":"string","enum":["new","quoted","closed"]},"projectId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","request","answers","plan","name","email","company","note","status","projectId","createdAt"]},"SupportRequestRequest":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email"},"topic":{"type":"string","enum":["buying","workshop","api","privacy","other"],"default":"other"},"message":{"type":"string","minLength":10,"maxLength":4000},"source":{"type":["string","null"],"maxLength":120,"default":null}},"required":["name","email","message"]},"SupportRequest":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"topic":{"type":"string","enum":["buying","workshop","api","privacy","other"]},"message":{"type":"string"},"source":{"type":["string","null"]},"status":{"type":"string","enum":["new","handled"]},"createdAt":{"type":"string","format":"date-time"},"handledAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","email","topic","message","source","status","createdAt","handledAt"]},"Statement":{"type":"object","properties":{"contractId":{"type":"string"},"week":{"type":"string"},"ordersPlaced":{"type":"integer","minimum":0},"ordersCompleted":{"type":"integer","minimum":0},"buyerChargesCents":{"type":"integer"},"refundsCents":{"type":"integer"},"workshopPayoutsCents":{"type":"integer"},"platformFeesCents":{"type":"integer"}},"required":["contractId","week","ordersPlaced","ordersCompleted","buyerChargesCents","refundsCents","workshopPayoutsCents","platformFeesCents"]},"Order":{"type":"object","properties":{"id":{"type":"string"},"contractId":{"type":"string"},"buyerId":{"type":"string"},"workshopId":{"type":"string"},"sequence":{"type":"integer","exclusiveMinimum":0},"route":{"type":"string","enum":["primary","backup"]},"reference":{"type":["string","null"]},"quantity":{"type":"integer","exclusiveMinimum":0},"address":{"type":["object","null"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"type":["string","null"],"maxLength":200,"default":null},"city":{"type":"string","minLength":1,"maxLength":100},"region":{"type":"string","minLength":2,"maxLength":2},"postalCode":{"type":"string","minLength":3,"maxLength":12},"country":{"type":"string","enum":["US"],"default":"US"}},"required":["name","line1","city","region","postalCode"]},"scheduledFor":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["routed","accepted","shipped","completed","failed","cancelled"]},"dueBy":{"type":"string","format":"date-time"},"buyerPriceCents":{"type":"integer","minimum":0},"workshopPayoutCents":{"type":"integer","minimum":0},"proofs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"kind":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"value":{"type":"string","minLength":1,"maxLength":2000},"carrier":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","orderId","kind","value","carrier","createdAt"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"shippedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","contractId","buyerId","workshopId","sequence","route","reference","quantity","address","scheduledFor","status","dueBy","buyerPriceCents","workshopPayoutCents","proofs","createdAt","updatedAt","shippedAt","completedAt"]},"CreateOrderRequest":{"type":"object","properties":{"quantity":{"type":"integer","minimum":1,"maximum":100000,"default":1},"reference":{"type":["string","null"],"maxLength":200,"example":"shopify-#1042"},"address":{"type":["object","null"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"type":["string","null"],"maxLength":200,"default":null},"city":{"type":"string","minLength":1,"maxLength":100},"region":{"type":"string","minLength":2,"maxLength":2},"postalCode":{"type":"string","minLength":3,"maxLength":12},"country":{"type":"string","enum":["US"],"default":"US"}},"required":["name","line1","city","region","postalCode"],"description":"Where the order ships to, or where the work happens. Required for on-site work and for contracts that ship to end customers."},"scheduledFor":{"type":["string","null"],"format":"date-time","example":"2026-10-13T08:00:00-05:00","description":"When the work should happen. Required when the contract's deadline is `scheduled` (e.g. an on-site visit or a weekly pickup)."}}},"ProofRequest":{"type":"object","properties":{"kind":{"type":"string","enum":["tracking_number","photo","signature","document","video"]},"value":{"type":"string","minLength":1,"maxLength":2000,"example":"9400111899223197428490","description":"A tracking number, or an https:// link for photos, videos and documents"},"carrier":{"type":["string","null"],"maxLength":60,"example":"USPS"}},"required":["kind","value"]},"LegMatch":{"type":"object","properties":{"kind":{"type":"string","enum":["workshop","prospect"]},"id":{"type":"string"},"name":{"type":"string"},"entity":{"type":["string","null"],"enum":["individual","business",null]},"country":{"type":["string","null"]},"region":{"type":["string","null"]},"similarity":{"type":"number"},"reasons":{"type":"array","items":{"type":"string"}},"invited":{"type":"boolean"}},"required":["kind","id","name","entity","country","region","similarity","reasons","invited"]},"SourcingRun":{"type":"object","properties":{"prospects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"website":{"type":["string","null"]},"country":{"type":["string","null"],"minLength":2,"maxLength":2},"region":{"type":["string","null"]},"city":{"type":["string","null"]},"description":{"type":"string"},"contacts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"value":{"type":"string","minLength":1,"maxLength":500},"label":{"type":["string","null"],"maxLength":120}},"required":["kind","value","label"]}},"source":{"type":"object","properties":{"query":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["query","url"]},"fit":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","interested","bid","declined","onboarded","do_not_contact"]},"workshopId":{"type":["string","null"]},"tenderIds":{"type":"array","items":{"type":"string"}},"notes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","website","country","region","city","description","contacts","source","fit","status","workshopId","tenderIds","notes","createdAt"]}},"drafts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"prospect":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":["string","null"]}},"required":["id","name","country"]},"tenderId":{"type":"string"},"projectId":{"type":["string","null"]},"legTitle":{"type":"string"},"channelId":{"type":["string","null"]},"to":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"value":{"type":"string","minLength":1,"maxLength":500},"label":{"type":["string","null"],"maxLength":120}},"required":["kind","value","label"]},"subject":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["draft","approved","sent","failed","rejected","replied"]},"bidUrl":{"type":["string","null"]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"approvedAt":{"type":["string","null"],"format":"date-time"},"sentAt":{"type":["string","null"],"format":"date-time"}},"required":["id","prospect","tenderId","projectId","legTitle","channelId","to","subject","body","status","bidUrl","error","createdAt","approvedAt","sentAt"]}}},"required":["prospects","drafts"]},"Prospect":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"website":{"type":["string","null"]},"country":{"type":["string","null"],"minLength":2,"maxLength":2},"region":{"type":["string","null"]},"city":{"type":["string","null"]},"description":{"type":"string"},"contacts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"value":{"type":"string","minLength":1,"maxLength":500},"label":{"type":["string","null"],"maxLength":120}},"required":["kind","value","label"]}},"source":{"type":"object","properties":{"query":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["query","url"]},"fit":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","interested","bid","declined","onboarded","do_not_contact"]},"workshopId":{"type":["string","null"]},"tenderIds":{"type":"array","items":{"type":"string"}},"notes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","website","country","region","city","description","contacts","source","fit","status","workshopId","tenderIds","notes","createdAt"]},"ProspectRequest":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":160},"website":{"type":["string","null"],"maxLength":300,"default":null},"country":{"type":["string","null"],"minLength":2,"maxLength":2,"default":null},"region":{"type":["string","null"],"maxLength":80,"default":null},"city":{"type":["string","null"],"maxLength":80,"default":null},"description":{"type":"string","minLength":3,"maxLength":2000},"contacts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"value":{"type":"string","minLength":1,"maxLength":500},"label":{"type":["string","null"],"maxLength":120}},"required":["kind","value","label"]},"maxItems":10,"default":[]},"tenderId":{"type":["string","null"],"default":null},"notes":{"type":["string","null"],"maxLength":2000,"default":null}},"required":["name","description"]},"ProspectEditRequest":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":160},"website":{"type":["string","null"],"maxLength":300},"country":{"type":["string","null"],"minLength":2,"maxLength":2},"region":{"type":["string","null"],"maxLength":80},"city":{"type":["string","null"],"maxLength":80},"description":{"type":"string","minLength":3,"maxLength":2000},"contacts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"value":{"type":"string","minLength":1,"maxLength":500},"label":{"type":["string","null"],"maxLength":120}},"required":["kind","value","label"]},"maxItems":10},"fit":{"type":["string","null"],"maxLength":1000},"status":{"type":"string","enum":["new","contacted","interested","bid","declined","onboarded","do_not_contact"]},"notes":{"type":["string","null"],"maxLength":2000},"tenderId":{"type":"string"}}},"OutreachMessage":{"type":"object","properties":{"id":{"type":"string"},"prospect":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":["string","null"]}},"required":["id","name","country"]},"tenderId":{"type":"string"},"projectId":{"type":["string","null"]},"legTitle":{"type":"string"},"channelId":{"type":["string","null"]},"to":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"value":{"type":"string","minLength":1,"maxLength":500},"label":{"type":["string","null"],"maxLength":120}},"required":["kind","value","label"]},"subject":{"type":"string"},"body":{"type":"string"},"status":{"type":"string","enum":["draft","approved","sent","failed","rejected","replied"]},"bidUrl":{"type":["string","null"]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"approvedAt":{"type":["string","null"],"format":"date-time"},"sentAt":{"type":["string","null"],"format":"date-time"}},"required":["id","prospect","tenderId","projectId","legTitle","channelId","to","subject","body","status","bidUrl","error","createdAt","approvedAt","sentAt"]},"OutreachMessageEditRequest":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":10000},"channelId":{"type":["string","null"]},"to":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"value":{"type":"string","minLength":1,"maxLength":500},"label":{"type":["string","null"],"maxLength":120}},"required":["kind","value","label"]}}},"OutreachReply":{"type":"object","properties":{"id":{"type":"string"},"messageId":{"type":"string"},"body":{"type":"string"},"classification":{"type":"string","enum":["interested","declined","question","other"]},"summary":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","messageId","body","classification","summary","createdAt"]},"OutreachReplyRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":20000,"example":"Yes, we can do lots of 100."}},"required":["body"]},"OutreachChannel":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["email","manual"]},"name":{"type":"string"},"settings":{"type":"object","properties":{"fromAddress":{"type":["string","null"],"maxLength":200},"replyTo":{"type":["string","null"],"maxLength":200},"instructions":{"type":["string","null"],"maxLength":2000},"contactKinds":{"type":"array","items":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"minItems":1}},"required":["fromAddress","replyTo","instructions","contactKinds"]},"hasSecret":{"type":"boolean"},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","name","settings","hasSecret","active","createdAt"]},"OutreachChannelRequest":{"type":"object","properties":{"kind":{"type":"string","enum":["email","manual"]},"name":{"type":"string","minLength":2,"maxLength":80},"settings":{"type":"object","properties":{"fromAddress":{"type":["string","null"],"maxLength":200},"replyTo":{"type":["string","null"],"maxLength":200},"instructions":{"type":["string","null"],"maxLength":2000},"contactKinds":{"type":"array","items":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"minItems":1}},"required":["fromAddress","replyTo","instructions","contactKinds"]},"secret":{"type":["string","null"],"minLength":1,"maxLength":500},"active":{"type":"boolean","default":true}},"required":["kind","name","settings"]},"OutreachChannelEditRequest":{"type":"object","properties":{"kind":{"type":"string","enum":["email","manual"]},"name":{"type":"string","minLength":2,"maxLength":80},"settings":{"type":"object","properties":{"fromAddress":{"type":["string","null"],"maxLength":200},"replyTo":{"type":["string","null"],"maxLength":200},"instructions":{"type":["string","null"],"maxLength":2000},"contactKinds":{"type":"array","items":{"type":"string","enum":["email","phone","website","contact_form","alibaba","linkedin","other"]},"minItems":1}},"required":["fromAddress","replyTo","instructions","contactKinds"]},"secret":{"type":["string","null"],"minLength":1,"maxLength":500},"active":{"type":"boolean"}}},"AdminOverview":{"type":"object","properties":{"counts":{"type":"object","properties":{"projects":{"type":"integer"},"openLegs":{"type":"integer"},"quoteRequestsNew":{"type":"integer"},"workshops":{"type":"integer"},"applicationsNew":{"type":"integer"},"prospects":{"type":"integer"},"outreachDrafts":{"type":"integer"},"outreachAwaitingSend":{"type":"integer"},"repliesToRead":{"type":"integer"},"supportRequestsNew":{"type":"integer"}},"required":["projects","openLegs","quoteRequestsNew","workshops","applicationsNew","prospects","outreachDrafts","outreachAwaitingSend","repliesToRead","supportRequestsNew"]},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"subjectId":{"type":"string"},"accountId":{"type":["string","null"]},"summary":{"type":"string"},"payload":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","type","subjectId","accountId","summary","payload","createdAt"]}}},"required":["counts","recent"]},"ActivityEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"subjectId":{"type":"string"},"accountId":{"type":["string","null"]},"summary":{"type":"string"},"payload":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","type","subjectId","accountId","summary","payload","createdAt"]},"AdminProject":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"buyer":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]}},"required":["id","name","email"]},"contact":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"minLength":2,"maxLength":120,"default":null},"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"]},"agentFamily":{"type":["string","null"],"enum":["claude_code","codex","chatgpt","claude","cursor","vscode","gemini","etabli_cli","browser","curl","python","node","other",null]}},"required":["project","buyer","contact","agentFamily"]},"AgentActivity":{"type":"object","properties":{"families":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","enum":["claude_code","codex","chatgpt","claude","cursor","vscode","gemini","etabli_cli","browser","curl","python","node","other"]},"label":{"type":"string"},"last7Days":{"type":"object","properties":{"previews":{"type":"integer"},"drafts":{"type":"integer"},"claims":{"type":"integer"},"quoteRequests":{"type":"integer"}},"required":["previews","drafts","claims","quoteRequests"]},"last30Days":{"type":"object","properties":{"previews":{"type":"integer"},"drafts":{"type":"integer"},"claims":{"type":"integer"},"quoteRequests":{"type":"integer"}},"required":["previews","drafts","claims","quoteRequests"]}},"required":["family","label","last7Days","last30Days"]}},"totals":{"type":"object","properties":{"last7Days":{"type":"object","properties":{"previews":{"type":"integer"},"drafts":{"type":"integer"},"claims":{"type":"integer"},"quoteRequests":{"type":"integer"}},"required":["previews","drafts","claims","quoteRequests"]},"last30Days":{"type":"object","properties":{"previews":{"type":"integer"},"drafts":{"type":"integer"},"claims":{"type":"integer"},"quoteRequests":{"type":"integer"}},"required":["previews","drafts","claims","quoteRequests"]}},"required":["last7Days","last30Days"]},"through":{"type":"string","format":"date"}},"required":["families","totals","through"]}},"parameters":{}},"paths":{"/":{"get":{"tags":["System"],"summary":"Service info","responses":{"200":{"description":"Service info","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"docs":{"type":"string"},"openapi":{"type":"string"},"specEngine":{"type":"string"}},"required":["name","docs","openapi","specEngine"]}}}}}}},"/health":{"get":{"tags":["System"],"summary":"Liveness check","responses":{"200":{"description":"Healthy","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/v1/waitlist":{"post":{"tags":["System"],"summary":"Request early access (used by the website)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistRequest"}}}},"responses":{"201":{"description":"Signed up","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"tags":["Accounts"],"summary":"The account behind this API key","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Your account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workshops":{"post":{"tags":["Operators"],"summary":"Onboard a workshop (operators only)","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardWorkshopRequest"}}}},"responses":{"201":{"description":"The workshop and its first API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardedWorkshop"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Operators"],"summary":"List workshops (operators only)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Workshops","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Workshop"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects":{"post":{"tags":["Projects"],"summary":"Plan a request into legs (with a buyer key), or draft one for a person to claim","description":"Breaks the request into legs (one per kind of workshop it needs: a pot factory feeding a nursery is two), each a tender with its own spec and questions.\n\nWith a buyer key: the project is yours. Answer each leg's questions with POST /v1/tenders/{tenderId}/answers, then publish the project.\n\nWithout a key: a draft that belongs to nobody until a person claims it on etabli.io (7 days). The response carries a project key (shown once: keep it) and a claim link with a short code: show the person `project.next.message` verbatim. Nothing reaches a workshop and nothing is charged until they claim it. Send `Idempotency-Key` to make retries safe. 10 drafts an hour and 30 a day per address.","security":[{"bearerAuth":[]},{}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Without a key: the same key within 24 hours returns the same draft, project key and claim code instead of a second draft"},"required":false,"description":"Without a key: the same key within 24 hours returns the same draft, project key and claim code instead of a second draft","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"201":{"description":"With a buyer key, the planned project; without one, the draft with its project key and claim link","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Project"},{"$ref":"#/components/schemas/DraftCreated"}]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused by policy or price rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The spec engine is unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Projects"],"summary":"List your projects, newest first","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Projects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}":{"get":{"tags":["Projects"],"summary":"Get a project, its legs and what to do next","description":"Works with a buyer key, the project key or the owner token. `next` says what to do now in words to repeat to the person, and when to look again (`next.checkAfter`, mirrored in `Retry-After` while waiting for a claim or for bids). Bids take days: look again when it says, not sooner.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The project","headers":{"Retry-After":{"description":"Seconds until `next.checkAfter`, while waiting for a claim or for bids: look again then, not sooner","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Projects"],"summary":"Discard an unclaimed draft","description":"With the project key: the draft's legs are cancelled and its claim code stops working. Nothing ever reached a workshop. A claimed project can't be discarded.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The discarded draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}/claim-codes":{"post":{"tags":["Projects"],"summary":"Get a fresh claim code for an unclaimed draft","description":"With the project key, when the person is ready to look (a code lasts 15 minutes by default, up to 24 hours on request). The old code stops working. Show the person `project.next.message`: it carries the new link.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimCodeRequest"}}}},"responses":{"201":{"description":"The new code and link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimCodeIssued"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}/events":{"get":{"tags":["Projects"],"summary":"A project's history, oldest first","description":"With a buyer key, the project key or the owner token. Pass the last id you have seen as `after` to get only what's new: drafted, claimed, legs published, bids, workshops' questions, contracts. Summaries are Établi's words, never a workshop's.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The last event id you have seen: return only newer events"},"required":false,"description":"The last event id you have seen: return only newer events","name":"after","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"example":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Events, oldest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectEvent"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}/agent-key/revoke":{"post":{"tags":["Projects"],"summary":"Revoke the agent's project key","description":"With the owner token (from the status page's link) or the buyer's key: the agent that drafted the project can no longer read it or act on it.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}/publish":{"post":{"tags":["Projects"],"summary":"Publish every leg","description":"Opens every ready leg to the workshops that qualify for it. If a leg still has open questions, nothing is published and the 400 lists the legs that aren't ready. A leg with too few qualified workshops gets Établi's sourcing. Buyer keys only: an agent's draft is published by its person's claim (403 `claim_required`, with the claim page in `details.claimUrl`).","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishProjectRequest"}}}},"responses":{"200":{"description":"The project, its legs open","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}/offers":{"get":{"tags":["Projects"],"summary":"Compare offers on every leg","description":"Each leg's offers in the usual Offer shape, and the recommended offers added up into one all-in price per finished unit when every leg is priced per unit. With a buyer key, the owner token, or the project key once the person has claimed the project.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Offers per leg","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectOffers"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects/{id}/award":{"post":{"tags":["Projects"],"summary":"Award every leg","description":"Creates one contract per leg, together: legs left out of `legs` get Établi's recommendation, and nothing is awarded unless every open leg has an eligible offer. Place each leg's orders against its contract; an upstream leg's orders ship to the downstream workshop's receiving address. Buyer keys only: on a claimed draft the person chooses offers on their status page.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AwardProjectRequest"}}}},"responses":{"201":{"description":"A contract per leg","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAward"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/claims/{code}":{"get":{"tags":["Projects"],"summary":"Read a draft by its claim code (no API key needed)","description":"What the claim page shows before the person decides: the plan, the questions still open, each leg's ceiling and the most it can cost, and what publishing does. Changes nothing. An expired, used or unknown code is a 404; five wrong codes from one address lock it out for 15 minutes (429).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":32,"example":"KQ7M-4TRD","description":"The claim code, with or without its dash, in any case"},"required":true,"description":"The claim code, with or without its dash, in any case","name":"code","in":"path"}],"responses":{"200":{"description":"The draft, as the claim page shows it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimView"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Projects"],"summary":"Claim and publish a draft (the person, on etabli.io; no API key)","description":"The one approval: the project becomes the person's (their buyer account is made, or found by email), the answers given here are folded in, and every leg is published to workshops. Nothing is charged. If a leg still isn't ready (a missing ceiling, open questions), nothing happens and the 409 lists what's missing in `details.legs`. Returns the status page's link with the owner token, shown once. Refused when sent with a key: agents show the link, they don't claim.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":32,"example":"KQ7M-4TRD","description":"The claim code, with or without its dash, in any case"},"required":true,"description":"The claim code, with or without its dash, in any case","name":"code","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}}},"responses":{"201":{"description":"The claimed project and the status page's link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResult"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders":{"post":{"tags":["Tenders"],"summary":"Post a tender in plain English","description":"Compiles the request into a spec and returns the questions, if any, the buyer must answer before publishing.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenderRequest"}}}},"responses":{"201":{"description":"The compiled tender","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tender"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused by policy or price rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The spec engine is unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Tenders"],"summary":"List your tenders, newest first","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Tenders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tender"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}":{"get":{"tags":["Tenders"],"summary":"Get a tender","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The tender","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tender"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/answers":{"post":{"tags":["Tenders"],"summary":"Answer clarifying questions","description":"Folds the answers into the spec. The tender becomes `ready` when nothing is left to ask. For a leg of an unclaimed draft, the project key answers too.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerQuestionsRequest"}}}},"responses":{"200":{"description":"The updated tender","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tender"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The spec engine is unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/publish":{"post":{"tags":["Tenders"],"summary":"Publish a ready tender to matching workshops","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishTenderRequest"}}}},"responses":{"200":{"description":"The open tender, with how many workshops were invited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tender"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/cancel":{"post":{"tags":["Tenders"],"summary":"Cancel a tender that has not been awarded","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The cancelled tender","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tender"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/offers":{"get":{"tags":["Tenders"],"summary":"Compare offers","description":"Each bid as the buyer would pay it, ranked, with Établi's recommended primary and backup.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Ranked offers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Offer"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/award":{"post":{"tags":["Tenders"],"summary":"Award the tender and create a contract","description":"With an empty body, awards Établi's recommendation: the best offer as primary, the next as backup.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AwardTenderRequest"}}}},"responses":{"201":{"description":"The new contract","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contract"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invitations":{"get":{"tags":["Workshops"],"summary":"Open tenders you're invited to bid on","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Invitations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/bid":{"put":{"tags":["Workshops"],"summary":"Place or replace your bid","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BidRequest"}}}},"responses":{"200":{"description":"Your bid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bid"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused by policy or price rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Workshops"],"summary":"Withdraw your bid","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The withdrawn bid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bid"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bid-links/{token}":{"get":{"tags":["Bid links"],"summary":"See the job behind a bid link (no API key needed)","description":"The leg as any invited workshop sees it, without the buyer: the spec, the most a bid can be, answered questions, when bidding closes, and whether the link can still be used. Once the leg is no longer open or `closesAt` has passed, this still answers 200, with `status` `closed`.","parameters":[{"schema":{"type":"string","minLength":10,"maxLength":100},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"The job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BidLinkView"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bid-links/{token}/bid":{"post":{"tags":["Bid links"],"summary":"Bid through a bid link (no API key needed)","description":"Joins Établi as a workshop (the first time) and places or replaces the bid: the net price per unit, before Établi's fee. The business's email is required (Établi sends the contract and orders there); a phone is optional. Both are kept on the workshop. Answers 409 once bidding has closed.","parameters":[{"schema":{"type":"string","minLength":10,"maxLength":100},"required":true,"name":"token","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BidLinkBidRequest"}}}},"responses":{"201":{"description":"Bid placed","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"bidId":{"type":"string"}},"required":["ok","bidId"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused by policy or price rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bid-links/{token}/questions":{"post":{"tags":["Bid links"],"summary":"Ask the buyer a question through a bid link (no API key needed)","description":"Every bidder sees the answer once given (without who asked), and it becomes part of the contract. Only a name is needed; an email or phone, if given, is kept with the workshop. Answers 409 once bidding has closed.","parameters":[{"schema":{"type":"string","minLength":10,"maxLength":100},"required":true,"name":"token","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BidLinkQuestionRequest"}}}},"responses":{"201":{"description":"The question","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Clarification"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bid-links/{token}/decline":{"post":{"tags":["Bid links"],"summary":"Decline through a bid link (no API key needed)","description":"Answers 409 once bidding has closed, or after a bid through this link.","parameters":[{"schema":{"type":"string","minLength":10,"maxLength":100},"required":true,"name":"token","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BidLinkDeclineRequest"}}}},"responses":{"200":{"description":"Declined","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/clarifications":{"post":{"tags":["Workshops"],"summary":"Ask the buyer a question before you bid","description":"The buyer sees who asked. Other invited workshops see the question once it is answered, without your name.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskClarificationRequest"}}}},"responses":{"201":{"description":"Your question","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Clarification"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Tenders"],"summary":"Questions about a tender","description":"Buyers see every question and who asked it (so does the owner token, and the project key if the person let the agent answer them). Invited workshops see answered questions and their own.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Questions, oldest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Clarification"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/clarifications/{id}/answer":{"post":{"tags":["Tenders"],"summary":"Answer a workshop's question","description":"The answer is shared with every invited workshop and added to the spec's rules, so it is part of the contract. The buyer answers (on a claimed project, with the owner token from their status page), or the project key if the person allowed `answer_clarifications` when claiming.","security":[{"bearerAuth":[]},{"projectKey":[]},{"ownerToken":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerClarificationRequest"}}}},"responses":{"200":{"description":"The answered question","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Clarification"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workshop-applications":{"post":{"tags":["Workshops"],"summary":"Apply to join as a workshop (no API key needed)","description":"For one person or a company. An operator reviews each application and gets in touch about first jobs.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopApplicationRequest"}}}},"responses":{"201":{"description":"Application received","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok","id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Operators"],"summary":"List workshop applications (operators only)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Applications, newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkshopApplication"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workshop-applications/{id}/approve":{"post":{"tags":["Operators"],"summary":"Approve an application and onboard the workshop (operators only)","description":"Creates the workshop from the application (its description is embedded for matching) and returns its first API key, shown once.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveApplicationRequest"}}}},"responses":{"201":{"description":"The workshop and its first API key","content":{"application/json":{"schema":{"type":"object","properties":{"workshop":{"$ref":"#/components/schemas/Workshop"},"apiKey":{"type":"string"}},"required":["workshop","apiKey"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workshop-applications/{id}/decline":{"post":{"tags":["Operators"],"summary":"Decline an application (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclineApplicationRequest"}}}},"responses":{"200":{"description":"The application","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopApplication"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/quotes/preview":{"post":{"tags":["Quotes"],"summary":"Preview a quote (no API key needed)","description":"Plans a plain-English request into the legs Établi would put out to bid (one workshop per leg; most jobs are one leg), each with its spec and the questions still open (with suggested answers). Établi adds no price estimate of its own: prices come from workshops' bids once the request is put out to bid. Nothing goes to workshops; the plan is kept for a day so a request made from it is instant. Send answers back with each question's `leg`, `field` and `text` to refine it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotePreviewRequest"}}}},"responses":{"200":{"description":"The plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPreview"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused by policy or price rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The spec engine is unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/quote-requests":{"post":{"tags":["Quotes"],"summary":"Ask for firm quotes (no API key needed)","description":"Sends the request, with any answers, to Établi. Firm prices from workshops follow by email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequestRequest"}}}},"responses":{"201":{"description":"Request received","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"},"plan":{"$ref":"#/components/schemas/PlanPreview"}},"required":["ok","id","plan"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused by policy or price rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Operators"],"summary":"List quote requests (operators only)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Quote requests, newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QuoteRequest"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/quote-requests/{id}/project":{"post":{"tags":["Operators"],"summary":"Create the project for a quote request (operators only)","description":"Creates (or reuses) the requester's buyer account and a project, planned into legs, with the answers they gave on the quote page. Returns a buyer API key, shown once, for publishing and awarding on their behalf.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"201":{"description":"The project, its buyer and a buyer key","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"},"buyer":{"$ref":"#/components/schemas/Account"},"apiKey":{"type":"string"}},"required":["project","buyer","apiKey"]}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused by policy or price rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The spec engine is unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/support-requests":{"post":{"tags":["Support"],"summary":"Contact Établi (no API key needed)","description":"Sends a message to Établi: the contact form on etabli.io/support. Établi replies to the email given. `source` is the page or app the person came from, e.g. `chatgpt`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportRequestRequest"}}}},"responses":{"201":{"description":"Request received","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok","id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this address; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Operators"],"summary":"List support requests (operators only)","description":"Newest first. `status` is `new` or `handled`; leave it out for both.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["new","handled"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Support requests, newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SupportRequest"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/support-requests/{id}/handled":{"post":{"tags":["Operators"],"summary":"Mark a support request handled (operators only)","description":"Sets `handledAt`. Idempotent: a request that is already handled comes back unchanged.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The support request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportRequest"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contracts":{"get":{"tags":["Contracts"],"summary":"List contracts you are party to","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Contracts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Contract"}}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contracts/{id}":{"get":{"tags":["Contracts"],"summary":"Get a contract","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The contract","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contract"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contracts/{id}/statement":{"get":{"tags":["Contracts"],"summary":"Weekly statement: orders, charges, payouts and fees","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-W\\d{2}$","example":"2026-W41","description":"ISO week; defaults to the current week"},"required":false,"description":"ISO week; defaults to the current week","name":"week","in":"query"}],"responses":{"200":{"description":"The statement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Statement"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contracts/{id}/orders":{"post":{"tags":["Orders"],"summary":"Place an order","description":"One call per unit of work: one customer's purchase, one recipient's parcel, one batch, or one lot for a leg that supplies another leg (without an address, it ships to the receiving address of the workshop awarded the leg it feeds). Routed to the primary or backup workshop.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":200,"description":"Retrying with the same key returns the original order instead of a duplicate"},"required":false,"description":"Retrying with the same key returns the original order instead of a duplicate","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"An existing order with this idempotency key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"201":{"description":"The new order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders":{"get":{"tags":["Orders"],"summary":"List orders","description":"Buyers see their orders; workshops see orders routed to them (their work queue).","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"contractId","in":"query"},{"schema":{"type":"string","enum":["routed","accepted","shipped","completed","failed","cancelled"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Orders, newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}":{"get":{"tags":["Orders"],"summary":"Get an order with its proofs","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}/accept":{"post":{"tags":["Orders"],"summary":"Accept an order routed to your workshop","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}/proofs":{"post":{"tags":["Orders"],"summary":"Add proof: a tracking number (marks the order shipped), photo, signature…","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProofRequest"}}}},"responses":{"200":{"description":"The order with its proofs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}/complete":{"post":{"tags":["Orders"],"summary":"Complete an order (pays the workshop)","description":"Delivered, for orders that ship (in production a carrier webhook calls this), or done, for on-site work. Workshops must first add the proof the spec asks for: a tracking number for orders that ship, otherwise a photo or other listed proof.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The completed order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}/cancel":{"post":{"tags":["Orders"],"summary":"Cancel an order before it ships or is done (refunds the buyer)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The cancelled order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/matches":{"get":{"tags":["Sourcing"],"summary":"Workshops and prospects ranked for a leg (operators only)","description":"Every workshop and prospect considered for the leg: similarity of their description to the leg, why each is in or out, and whether they were invited or contacted.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Matches","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LegMatch"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenders/{id}/sourcing":{"post":{"tags":["Sourcing"],"summary":"Run sourcing for a leg (operators only)","description":"Links known prospects that fit, asks the sourcing agent (web search) for up to eight new ones, and drafts a message with a bid link to each. Drafts wait for approval.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Prospects and drafts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourcingRun"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The spec engine is unavailable; retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/prospects":{"get":{"tags":["Sourcing"],"summary":"List prospects (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["new","contacted","interested","bid","declined","onboarded","do_not_contact"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"tenderId","in":"query"}],"responses":{"200":{"description":"Prospects, newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Prospect"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sourcing"],"summary":"Add a prospect by hand (operators only)","description":"With a `tenderId`, the prospect is linked to that leg and a draft message is written for approval.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProspectRequest"}}}},"responses":{"201":{"description":"The prospect","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prospect"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/prospects/{id}":{"patch":{"tags":["Sourcing"],"summary":"Edit a prospect (operators only)","description":"Only the fields sent change. Status `do_not_contact` rejects every unsent message to them.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProspectEditRequest"}}}},"responses":{"200":{"description":"The prospect","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prospect"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach":{"get":{"tags":["Outreach"],"summary":"List outreach messages (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["draft","approved","sent","failed","rejected","replied"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"tenderId","in":"query"}],"responses":{"200":{"description":"Messages, newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutreachMessage"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach/{id}":{"patch":{"tags":["Outreach"],"summary":"Edit a message before it is sent (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachMessageEditRequest"}}}},"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachMessage"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach/{id}/approve":{"post":{"tags":["Outreach"],"summary":"Approve a message (operators only)","description":"An email channel sends it now (`sent`, or `failed` with the error; approve again to retry). A manual channel leaves it `approved` for you to send by hand and mark sent.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachMessage"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach/{id}/sent":{"post":{"tags":["Outreach"],"summary":"Mark an approved message sent by hand (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachMessage"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach/{id}/reject":{"post":{"tags":["Outreach"],"summary":"Reject a draft (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachMessage"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach/{id}/replies":{"post":{"tags":["Outreach"],"summary":"Record a prospect's reply (operators only)","description":"Classified as interested, declined, question or other, with the next step.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachReplyRequest"}}}},"responses":{"201":{"description":"The reply","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachReply"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Outreach"],"summary":"A message's replies, oldest first (operators only)","description":"Listing them marks them read.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Replies","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutreachReply"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach-channels":{"get":{"tags":["Outreach"],"summary":"List outreach channels (operators only)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Channels","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutreachChannel"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Outreach"],"summary":"Add an outreach channel (operators only)","description":"`email` sends through Resend with `secret` as its API key (stored encrypted, never returned); `manual` is sent by hand.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachChannelRequest"}}}},"responses":{"201":{"description":"The channel","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachChannel"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/outreach-channels/{id}":{"patch":{"tags":["Outreach"],"summary":"Edit an outreach channel (operators only)","description":"Omit `secret` to keep the current one; send null to clear it.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachChannelEditRequest"}}}},"responses":{"200":{"description":"The channel","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachChannel"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflicts with the resource's current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/overview":{"get":{"tags":["Operators"],"summary":"Counts and what needs you (operators only)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOverview"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/activity":{"get":{"tags":["Operators"],"summary":"Activity, newest first (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"An event id: return events older than it (the next page)"},"required":false,"description":"An event id: return events older than it (the next page)","name":"before","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"example":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Events with readable summaries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActivityEvent"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/projects":{"get":{"tags":["Operators"],"summary":"Projects with who drafted and who claimed them (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["unclaimed","claimed","expired","discarded"],"description":"Only projects in this claim status, e.g. `unclaimed` for agents' drafts"},"required":false,"description":"Only projects in this claim status, e.g. `unclaimed` for agents' drafts","name":"claim","in":"query"}],"responses":{"200":{"description":"Projects, newest first","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminProject"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/projects/{id}":{"get":{"tags":["Operators"],"summary":"A project with who drafted and who claimed it (operators only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":4,"example":"tnd_01k7f3x9qz8m2c4v6b0n5r7t9w"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminProject"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/agents":{"get":{"tags":["Operators"],"summary":"Who sends work, by agent family, last 7 and 30 days (operators only)","description":"Previews, keyless drafts, claims (counted under the family that drafted the project) and quote requests, from daily counters.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Counts per agent family","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentActivity"}}}},"401":{"description":"Missing or unknown API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not allowed for this account type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}