{"openapi":"3.1.0","info":{"title":"SiteSwap API","version":"v1","description":"Listings, offers, companies, the product catalog and alerts of SiteSwap, the construction marketplace. Docs: https://dev.siteswap.pro/developers"},"servers":[{"url":"https://dev.siteswap.pro/api/v1"}],"security":[{"bearer":[]},{"apiKey":[]}],"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"A stable code to branch on, for example `rate_limited`"},"message":{"type":"string","description":"What happened and what to do, for people. It may change"},"request_id":{"type":"string","description":"The id of this request"},"field":{"description":"With `invalid`: the field that was refused","type":"string"}},"required":["code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key (ssk_...) or a sign-in token (sst_...)"},"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"tags":[{"name":"Listings"},{"name":"Offers"},{"name":"Companies"},{"name":"Catalog"},{"name":"Alerts"},{"name":"Keys"},{"name":"Sign-in tokens"},{"name":"Meta"}],"paths":{"/marketplaces":{"get":{"operationId":"listMarketplaces","tags":["Listings"],"summary":"List marketplaces","description":"The marketplaces that are open now, with what each one takes. A closed marketplace is left out, and its listings are not found or changed until it opens.\n\nNeeds the `listings:read` scope.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"offers":{"type":"boolean","description":"Takes offers through SiteSwap"},"trades":{"type":"boolean","description":"Takes trades and counteroffers"},"kinds":{"type":"array","items":{"type":"string","enum":["have","need"]},"description":"What can be posted"}},"required":["key","name","offers","trades","kinds"],"additionalProperties":false}},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":[{"key":"materials","name":"Materials","offers":true,"trades":true,"kinds":["have","need"]}],"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings":{"get":{"operationId":"searchListings","tags":["Listings"],"summary":"Search listings","description":"Live listings of one marketplace, with the same filters as the browse pages on the site. Nearest first when you send a `zip`, newest first without one. Pages follow each other by cursor, so listings added meanwhile never move a page.\n\nNeeds the `listings:read` scope.","parameters":[{"name":"marketplace","in":"query","required":false,"description":"A marketplace key, as `GET /marketplaces` lists them, for example `materials`","schema":{"default":"materials","type":"string","pattern":"^[a-z]{3,20}$"}},{"name":"q","in":"query","required":false,"description":"Words to look for: titles, materials, brands, regional names","schema":{"type":"string","maxLength":200}},{"name":"zip","in":"query","required":false,"description":"Sort by distance from here","schema":{"type":"string","pattern":"^\\d{5}$"}},{"name":"radius","in":"query","required":false,"description":"Miles from `zip`","schema":{"type":"string","enum":["25","50","100"]}},{"name":"kind","in":"query","required":false,"description":"Only offered or only wanted","schema":{"type":"string","enum":["have","need"]}},{"name":"deal","in":"query","required":false,"description":"Marketplaces with trades","schema":{"type":"string","enum":["sale","trade","both"]}},{"name":"category","in":"query","required":false,"description":"A category slug","schema":{"type":"string","maxLength":80}},{"name":"material","in":"query","required":false,"description":"With `category`: materials or types by their short name, comma separated, as in a browse address on the site","schema":{"type":"string","maxLength":300}},{"name":"brand","in":"query","required":false,"description":"A brand or maker id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"line","in":"query","required":false,"description":"A product line id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"color","in":"query","required":false,"description":"A color id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"model","in":"query","required":false,"description":"A model id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"platform","in":"query","required":false,"description":"A battery platform id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"price","in":"query","required":false,"description":"Materials: only this kind of price","schema":{"type":"string","enum":["fixed","offers","free","pays_to_take"]}},{"name":"delivers","in":"query","required":false,"description":"Only listings that can deliver","schema":{"type":"string","enum":["1"]}},{"name":"pickup","in":"query","required":false,"description":"Only pickup only listings","schema":{"type":"string","enum":["1"]}},{"name":"loading","in":"query","required":false,"description":"Materials: loading on site","schema":{"type":"string","enum":["1"]}},{"name":"ships","in":"query","required":false,"description":"Tools: ships","schema":{"type":"string","enum":["1"]}},{"name":"company","in":"query","required":false,"description":"Only this company's listings, by its slug","schema":{"type":"string","maxLength":60}},{"name":"cursor","in":"query","required":false,"description":"The `next_cursor` of the page before. Leave it out for the first page","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many to return on one page","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The listing's id"},"url":{"type":"string","description":"The listing on SiteSwap"},"marketplace":{"type":"string","description":"The marketplace key"},"kind":{"type":"string","enum":["have","need"],"description":"`have` for something offered, `need` for something wanted"},"deal":{"type":"string","enum":["sale","trade","both"],"description":"Marketplaces with trades: for sale, for trade or either; `sale` everywhere else"},"status":{"type":"string","enum":["active","paused","closed"],"description":"Only `active` listings are found by search; your own can be paused or closed"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"material":{"description":"The material or type, or the name typed under Other","type":["string","null"]},"brand":{"description":"The brand or maker","type":["string","null"]},"product_line":{"description":"The product line","type":["string","null"]},"color":{"description":"The color","type":["string","null"]},"model":{"description":"The model","type":["string","null"]},"quantity":{"type":"object","properties":{"total":{"type":"number","description":"Listed in all"},"open":{"type":"number","description":"Still open: not promised to an accepted offer and not handed over"},"unit":{"type":"string"},"basis":{"type":"string","description":"`measured` or `estimated`"}},"required":["total","open","unit","basis"],"additionalProperties":false},"price":{"type":"object","properties":{"model":{"type":"string","description":"`fixed`, `offers`, `free` or `pays_to_take` (the poster pays to have it taken)"},"cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Per unit, in US cents; null without a price"}},"required":["model","cents"],"additionalProperties":false},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string","description":"The state"},"distance_mi":{"description":"Straight-line miles from the `zip` you sent; null without one","type":["number","null"]}},"required":["city","region","distance_mi"],"additionalProperties":false},"pickup_only":{"type":"boolean"},"can_deliver":{"type":"boolean"},"can_load":{"type":"boolean"},"available_from":{"description":"The first day, YYYY-MM-DD","type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The category's questions and their answers, by key (see `GET /catalog/categories/{id}`)"},"photo":{"description":"A small picture of the first photo","type":["string","null"]},"company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"sample":{"type":"boolean","description":"True for sample data on test servers"},"created_at":{"type":"string","description":"When it was posted. ISO 8601 in UTC"}},"required":["id","url","marketplace","kind","deal","status","title","description","category","material","brand","product_line","color","model","quantity","price","location","pickup_only","can_deliver","can_load","available_from","fields","photo","company","sample","created_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` for the next page; null on the last page","type":["string","null"]},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","next_cursor","meta"],"additionalProperties":false},"example":{"data":[{"id":"1042","url":"https://siteswap.pro/listing/1042","marketplace":"materials","kind":"have","deal":"sale","status":"active","title":"Clean fill, screened","description":"About 40 yards from a basement dig.","category":{"id":"3","slug":"soil-and-fill","name":"Soil and fill"},"material":"Clean fill","brand":null,"product_line":null,"color":null,"model":null,"quantity":{"total":40,"open":40,"unit":"yd","basis":"estimated"},"price":{"model":"free","cents":null},"location":{"city":"Woburn","region":"MA","distance_mi":3.2},"pickup_only":true,"can_deliver":false,"can_load":true,"available_from":null,"fields":{},"photo":null,"company":{"slug":"acme-site-work","name":"Acme Site Work","kind":"contractor","url":"https://siteswap.pro/c/acme-site-work"},"sample":false,"created_at":"2026-12-02T14:03:20.991Z"}],"next_cursor":"eyJmIjoyNSwiYSI6MTA0Mn0","meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createListing","tags":["Listings"],"summary":"Post a listing","description":"Posts a listing for your company with the same checks as the posting form: the category, its questions, the units, the soil statement, the brand and model lists, the daily limit. Photos given by address are downloaded and stored like uploaded ones.\n\nNeeds the `listings:write` scope.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"marketplace":{"default":"materials","description":"Where it is posted. It cannot change later","type":"string","pattern":"^[a-z]{3,20}$"},"kind":{"type":"string","enum":["have","need"],"description":"`have` to offer something, `need` to ask for it. It cannot change later"},"category_id":{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"The category, from `GET /catalog/categories`"},"material_id":{"description":"Materials: a material of the category, or `other` with `custom_material`","anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A material"},{"type":"string","const":"other"}]},"custom_material":{"description":"The name, with `material_id: \"other\"`","type":"string","maxLength":80},"title":{"description":"Made from the material when left out","type":"string","maxLength":90},"description":{"type":"string","maxLength":2000},"quantity":{"description":"How much or how many","type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"description":"One of the category's units","type":"string","maxLength":30},"quantity_basis":{"description":"Materials: whether the quantity was measured","type":"string","enum":["measured","estimated"]},"price_model":{"description":"How it is priced. Each marketplace takes some of these","type":"string","enum":["fixed","offers","free","pays_to_take"]},"price":{"description":"Dollars per unit, with `fixed` or `pays_to_take`","type":"number","minimum":0,"maximum":10000000},"zip":{"type":"string","pattern":"^\\d{5}$","description":"Where it is: the 5-digit ZIP. It is never shown; listings show the town"},"site_id":{"description":"Takes the ZIP from that site","type":"string","pattern":"^[1-9][0-9]{0,15}$"},"deal":{"description":"Marketplaces with trades: for sale, for trade or both","type":"string","enum":["sale","trade","both"]},"can_load":{"type":"boolean"},"can_deliver":{"type":"boolean"},"pickup_only":{"type":"boolean"},"available_from":{"description":"YYYY-MM-DD","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"brand_id":{"description":"Materials with catalog brands","anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A brand"},{"type":"string","const":"other"}]},"line_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A product line"},{"type":"string","const":"other"}]},"color_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A color"},{"type":"string","const":"other"}]},"model_id":{"description":"Fills the maker and the maker's figures","type":"string","pattern":"^[1-9][0-9]{0,15}$"},"fields":{"description":"Answers to the category's questions by key, and any other field of this marketplace's posting form by its name","type":"object","propertyNames":{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}},"photo_urls":{"description":"Up to 8 photos by https address; each is downloaded once and stored by SiteSwap","maxItems":8,"type":"array","items":{"type":"string","maxLength":1000,"format":"uri"}}},"required":["kind","category_id","zip"]},"example":{"marketplace":"materials","kind":"have","category_id":"3","material_id":"12","quantity":40,"unit":"yd","quantity_basis":"estimated","price_model":"free","zip":"01801","pickup_only":true,"fields":{"d_prior_use":"Residential","d_contamination":"None known","ack":true}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The listing's id"},"url":{"type":"string","description":"The listing on SiteSwap"},"marketplace":{"type":"string","description":"The marketplace key"},"kind":{"type":"string","enum":["have","need"],"description":"`have` for something offered, `need` for something wanted"},"deal":{"type":"string","enum":["sale","trade","both"],"description":"Marketplaces with trades: for sale, for trade or either; `sale` everywhere else"},"status":{"type":"string","enum":["active","paused","closed"],"description":"Only `active` listings are found by search; your own can be paused or closed"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"material":{"description":"The material or type, or the name typed under Other","type":["string","null"]},"brand":{"description":"The brand or maker","type":["string","null"]},"product_line":{"description":"The product line","type":["string","null"]},"color":{"description":"The color","type":["string","null"]},"model":{"description":"The model","type":["string","null"]},"quantity":{"type":"object","properties":{"total":{"type":"number","description":"Listed in all"},"open":{"type":"number","description":"Still open: not promised to an accepted offer and not handed over"},"unit":{"type":"string"},"basis":{"type":"string","description":"`measured` or `estimated`"}},"required":["total","open","unit","basis"],"additionalProperties":false},"price":{"type":"object","properties":{"model":{"type":"string","description":"`fixed`, `offers`, `free` or `pays_to_take` (the poster pays to have it taken)"},"cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Per unit, in US cents; null without a price"}},"required":["model","cents"],"additionalProperties":false},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string","description":"The state"},"distance_mi":{"description":"Straight-line miles from the `zip` you sent; null without one","type":["number","null"]}},"required":["city","region","distance_mi"],"additionalProperties":false},"pickup_only":{"type":"boolean"},"can_deliver":{"type":"boolean"},"can_load":{"type":"boolean"},"available_from":{"description":"The first day, YYYY-MM-DD","type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The category's questions and their answers, by key (see `GET /catalog/categories/{id}`)"},"photo":{"description":"A small picture of the first photo","type":["string","null"]},"company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"sample":{"type":"boolean","description":"True for sample data on test servers"},"created_at":{"type":"string","description":"When it was posted. ISO 8601 in UTC"}},"required":["id","url","marketplace","kind","deal","status","title","description","category","material","brand","product_line","color","model","quantity","price","location","pickup_only","can_deliver","can_load","available_from","fields","photo","company","sample","created_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"1042","url":"https://siteswap.pro/listing/1042","marketplace":"materials","kind":"have","deal":"sale","status":"active","title":"Clean fill, screened","description":"About 40 yards from a basement dig.","category":{"id":"3","slug":"soil-and-fill","name":"Soil and fill"},"material":"Clean fill","brand":null,"product_line":null,"color":null,"model":null,"quantity":{"total":40,"open":40,"unit":"yd","basis":"estimated"},"price":{"model":"free","cents":null},"location":{"city":"Woburn","region":"MA","distance_mi":3.2},"pickup_only":true,"can_deliver":false,"can_load":true,"available_from":null,"fields":{},"photo":null,"company":{"slug":"acme-site-work","name":"Acme Site Work","kind":"contractor","url":"https://siteswap.pro/c/acme-site-work"},"sample":false,"created_at":"2026-12-02T14:03:20.991Z"},"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"marketplace_closed: the marketplace is not open","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"invalid: a field was refused; `message` says which and why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}":{"get":{"operationId":"getListing","tags":["Listings"],"summary":"Get a listing","description":"One listing. Live listings are found by anyone; a paused or closed one only by its own company. 404 when it was removed, its marketplace is closed, or its company blocks yours.\n\nNeeds the `listings:read` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The listing's id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"zip","in":"query","required":false,"description":"Also say how far it is from here","schema":{"type":"string","pattern":"^\\d{5}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The listing's id"},"url":{"type":"string","description":"The listing on SiteSwap"},"marketplace":{"type":"string","description":"The marketplace key"},"kind":{"type":"string","enum":["have","need"],"description":"`have` for something offered, `need` for something wanted"},"deal":{"type":"string","enum":["sale","trade","both"],"description":"Marketplaces with trades: for sale, for trade or either; `sale` everywhere else"},"status":{"type":"string","enum":["active","paused","closed"],"description":"Only `active` listings are found by search; your own can be paused or closed"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"material":{"description":"The material or type, or the name typed under Other","type":["string","null"]},"brand":{"description":"The brand or maker","type":["string","null"]},"product_line":{"description":"The product line","type":["string","null"]},"color":{"description":"The color","type":["string","null"]},"model":{"description":"The model","type":["string","null"]},"quantity":{"type":"object","properties":{"total":{"type":"number","description":"Listed in all"},"open":{"type":"number","description":"Still open: not promised to an accepted offer and not handed over"},"unit":{"type":"string"},"basis":{"type":"string","description":"`measured` or `estimated`"}},"required":["total","open","unit","basis"],"additionalProperties":false},"price":{"type":"object","properties":{"model":{"type":"string","description":"`fixed`, `offers`, `free` or `pays_to_take` (the poster pays to have it taken)"},"cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Per unit, in US cents; null without a price"}},"required":["model","cents"],"additionalProperties":false},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string","description":"The state"},"distance_mi":{"description":"Straight-line miles from the `zip` you sent; null without one","type":["number","null"]}},"required":["city","region","distance_mi"],"additionalProperties":false},"pickup_only":{"type":"boolean"},"can_deliver":{"type":"boolean"},"can_load":{"type":"boolean"},"available_from":{"description":"The first day, YYYY-MM-DD","type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The category's questions and their answers, by key (see `GET /catalog/categories/{id}`)"},"photo":{"description":"A small picture of the first photo","type":["string","null"]},"company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"sample":{"type":"boolean","description":"True for sample data on test servers"},"created_at":{"type":"string","description":"When it was posted. ISO 8601 in UTC"}},"required":["id","url","marketplace","kind","deal","status","title","description","category","material","brand","product_line","color","model","quantity","price","location","pickup_only","can_deliver","can_load","available_from","fields","photo","company","sample","created_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"1042","url":"https://siteswap.pro/listing/1042","marketplace":"materials","kind":"have","deal":"sale","status":"active","title":"Clean fill, screened","description":"About 40 yards from a basement dig.","category":{"id":"3","slug":"soil-and-fill","name":"Soil and fill"},"material":"Clean fill","brand":null,"product_line":null,"color":null,"model":null,"quantity":{"total":40,"open":40,"unit":"yd","basis":"estimated"},"price":{"model":"free","cents":null},"location":{"city":"Woburn","region":"MA","distance_mi":3.2},"pickup_only":true,"can_deliver":false,"can_load":true,"available_from":null,"fields":{},"photo":null,"company":{"slug":"acme-site-work","name":"Acme Site Work","kind":"contractor","url":"https://siteswap.pro/c/acme-site-work"},"sample":false,"created_at":"2026-12-02T14:03:20.991Z"},"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"replaceListing","tags":["Listings"],"summary":"Change a listing","description":"Replaces a listing of your company with the fields you send, with the same checks as the edit form. Send the whole listing: a field left out is cleared. The marketplace and the kind stay as they were. The quantity cannot go below what is promised to accepted offers.\n\nNeeds the `listings:write` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The listing's id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"marketplace":{"default":"materials","description":"Where it is posted. It cannot change later","type":"string","pattern":"^[a-z]{3,20}$"},"kind":{"type":"string","enum":["have","need"],"description":"`have` to offer something, `need` to ask for it. It cannot change later"},"category_id":{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"The category, from `GET /catalog/categories`"},"material_id":{"description":"Materials: a material of the category, or `other` with `custom_material`","anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A material"},{"type":"string","const":"other"}]},"custom_material":{"description":"The name, with `material_id: \"other\"`","type":"string","maxLength":80},"title":{"description":"Made from the material when left out","type":"string","maxLength":90},"description":{"type":"string","maxLength":2000},"quantity":{"description":"How much or how many","type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"description":"One of the category's units","type":"string","maxLength":30},"quantity_basis":{"description":"Materials: whether the quantity was measured","type":"string","enum":["measured","estimated"]},"price_model":{"description":"How it is priced. Each marketplace takes some of these","type":"string","enum":["fixed","offers","free","pays_to_take"]},"price":{"description":"Dollars per unit, with `fixed` or `pays_to_take`","type":"number","minimum":0,"maximum":10000000},"zip":{"type":"string","pattern":"^\\d{5}$","description":"Where it is: the 5-digit ZIP. It is never shown; listings show the town"},"site_id":{"description":"Takes the ZIP from that site","type":"string","pattern":"^[1-9][0-9]{0,15}$"},"deal":{"description":"Marketplaces with trades: for sale, for trade or both","type":"string","enum":["sale","trade","both"]},"can_load":{"type":"boolean"},"can_deliver":{"type":"boolean"},"pickup_only":{"type":"boolean"},"available_from":{"description":"YYYY-MM-DD","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"brand_id":{"description":"Materials with catalog brands","anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A brand"},{"type":"string","const":"other"}]},"line_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A product line"},{"type":"string","const":"other"}]},"color_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"A color"},{"type":"string","const":"other"}]},"model_id":{"description":"Fills the maker and the maker's figures","type":"string","pattern":"^[1-9][0-9]{0,15}$"},"fields":{"description":"Answers to the category's questions by key, and any other field of this marketplace's posting form by its name","type":"object","propertyNames":{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","category_id","zip"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The listing's id"},"url":{"type":"string","description":"The listing on SiteSwap"},"marketplace":{"type":"string","description":"The marketplace key"},"kind":{"type":"string","enum":["have","need"],"description":"`have` for something offered, `need` for something wanted"},"deal":{"type":"string","enum":["sale","trade","both"],"description":"Marketplaces with trades: for sale, for trade or either; `sale` everywhere else"},"status":{"type":"string","enum":["active","paused","closed"],"description":"Only `active` listings are found by search; your own can be paused or closed"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"material":{"description":"The material or type, or the name typed under Other","type":["string","null"]},"brand":{"description":"The brand or maker","type":["string","null"]},"product_line":{"description":"The product line","type":["string","null"]},"color":{"description":"The color","type":["string","null"]},"model":{"description":"The model","type":["string","null"]},"quantity":{"type":"object","properties":{"total":{"type":"number","description":"Listed in all"},"open":{"type":"number","description":"Still open: not promised to an accepted offer and not handed over"},"unit":{"type":"string"},"basis":{"type":"string","description":"`measured` or `estimated`"}},"required":["total","open","unit","basis"],"additionalProperties":false},"price":{"type":"object","properties":{"model":{"type":"string","description":"`fixed`, `offers`, `free` or `pays_to_take` (the poster pays to have it taken)"},"cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Per unit, in US cents; null without a price"}},"required":["model","cents"],"additionalProperties":false},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string","description":"The state"},"distance_mi":{"description":"Straight-line miles from the `zip` you sent; null without one","type":["number","null"]}},"required":["city","region","distance_mi"],"additionalProperties":false},"pickup_only":{"type":"boolean"},"can_deliver":{"type":"boolean"},"can_load":{"type":"boolean"},"available_from":{"description":"The first day, YYYY-MM-DD","type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The category's questions and their answers, by key (see `GET /catalog/categories/{id}`)"},"photo":{"description":"A small picture of the first photo","type":["string","null"]},"company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"sample":{"type":"boolean","description":"True for sample data on test servers"},"created_at":{"type":"string","description":"When it was posted. ISO 8601 in UTC"}},"required":["id","url","marketplace","kind","deal","status","title","description","category","material","brand","product_line","color","model","quantity","price","location","pickup_only","can_deliver","can_load","available_from","fields","photo","company","sample","created_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"1042","url":"https://siteswap.pro/listing/1042","marketplace":"materials","kind":"have","deal":"sale","status":"active","title":"Clean fill, screened","description":"About 40 yards from a basement dig.","category":{"id":"3","slug":"soil-and-fill","name":"Soil and fill"},"material":"Clean fill","brand":null,"product_line":null,"color":null,"model":null,"quantity":{"total":40,"open":40,"unit":"yd","basis":"estimated"},"price":{"model":"free","cents":null},"location":{"city":"Woburn","region":"MA","distance_mi":3.2},"pickup_only":true,"can_deliver":false,"can_load":true,"available_from":null,"fields":{},"photo":null,"company":{"slug":"acme-site-work","name":"Acme Site Work","kind":"contractor","url":"https://siteswap.pro/c/acme-site-work"},"sample":false,"created_at":"2026-12-02T14:03:20.991Z"},"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/status":{"post":{"operationId":"setListingStatus","tags":["Listings"],"summary":"Pause, reopen or close a listing","description":"Pauses a listing, puts it live again, or closes it for good. In a closed marketplace a listing can only be closed.\n\nNeeds the `listings:write` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The listing's id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","paused","closed"],"description":"`closed` cannot be undone"}},"required":["status"]},"example":{"status":"paused"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The listing's id"},"url":{"type":"string","description":"The listing on SiteSwap"},"marketplace":{"type":"string","description":"The marketplace key"},"kind":{"type":"string","enum":["have","need"],"description":"`have` for something offered, `need` for something wanted"},"deal":{"type":"string","enum":["sale","trade","both"],"description":"Marketplaces with trades: for sale, for trade or either; `sale` everywhere else"},"status":{"type":"string","enum":["active","paused","closed"],"description":"Only `active` listings are found by search; your own can be paused or closed"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"material":{"description":"The material or type, or the name typed under Other","type":["string","null"]},"brand":{"description":"The brand or maker","type":["string","null"]},"product_line":{"description":"The product line","type":["string","null"]},"color":{"description":"The color","type":["string","null"]},"model":{"description":"The model","type":["string","null"]},"quantity":{"type":"object","properties":{"total":{"type":"number","description":"Listed in all"},"open":{"type":"number","description":"Still open: not promised to an accepted offer and not handed over"},"unit":{"type":"string"},"basis":{"type":"string","description":"`measured` or `estimated`"}},"required":["total","open","unit","basis"],"additionalProperties":false},"price":{"type":"object","properties":{"model":{"type":"string","description":"`fixed`, `offers`, `free` or `pays_to_take` (the poster pays to have it taken)"},"cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Per unit, in US cents; null without a price"}},"required":["model","cents"],"additionalProperties":false},"location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string","description":"The state"},"distance_mi":{"description":"Straight-line miles from the `zip` you sent; null without one","type":["number","null"]}},"required":["city","region","distance_mi"],"additionalProperties":false},"pickup_only":{"type":"boolean"},"can_deliver":{"type":"boolean"},"can_load":{"type":"boolean"},"available_from":{"description":"The first day, YYYY-MM-DD","type":["string","null"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The category's questions and their answers, by key (see `GET /catalog/categories/{id}`)"},"photo":{"description":"A small picture of the first photo","type":["string","null"]},"company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"sample":{"type":"boolean","description":"True for sample data on test servers"},"created_at":{"type":"string","description":"When it was posted. ISO 8601 in UTC"}},"required":["id","url","marketplace","kind","deal","status","title","description","category","material","brand","product_line","color","model","quantity","price","location","pickup_only","can_deliver","can_load","available_from","fields","photo","company","sample","created_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"1042","url":"https://siteswap.pro/listing/1042","marketplace":"materials","kind":"have","deal":"sale","status":"paused","title":"Clean fill, screened","description":"About 40 yards from a basement dig.","category":{"id":"3","slug":"soil-and-fill","name":"Soil and fill"},"material":"Clean fill","brand":null,"product_line":null,"color":null,"model":null,"quantity":{"total":40,"open":40,"unit":"yd","basis":"estimated"},"price":{"model":"free","cents":null},"location":{"city":"Woburn","region":"MA","distance_mi":3.2},"pickup_only":true,"can_deliver":false,"can_load":true,"available_from":null,"fields":{},"photo":null,"company":{"slug":"acme-site-work","name":"Acme Site Work","kind":"contractor","url":"https://siteswap.pro/c/acme-site-work"},"sample":false,"created_at":"2026-12-02T14:03:20.991Z"},"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{id}/photos":{"post":{"operationId":"addListingPhotos","tags":["Listings"],"summary":"Add photos by address","description":"Downloads photos from https addresses and adds them to a listing of your company, through the same pipeline as uploads (shrunk, stored, a small copy made). Up to 8 a listing, 15 MB each, JPEG, PNG, WebP or HEIC. Addresses on private networks are refused.\n\nNeeds the `listings:write` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The listing's id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"urls":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","maxLength":1000,"format":"uri"},"description":"https addresses of the photos"}},"required":["urls"]},"example":{"urls":["https://example.com/photos/pile.jpg"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"photos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Photos the listing has now"}},"required":["added","photos"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"added":1,"photos":3},"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/stock":{"post":{"operationId":"updateStock","tags":["Listings"],"summary":"Update stock in bulk","description":"Sets the quantity of up to 100 of your listings in one call, for a dealer that keeps stock in its own system. Each line is checked on its own: a quantity below what is promised to accepted offers is refused for that line only. Raising a quantity tells saved searches the listing is back in stock.\n\nNeeds the `listings:write` scope.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"The listing's id"},"quantity":{"type":"number","minimum":0,"maximum":1000000000,"description":"The new total quantity. 0 pauses the listing"}},"required":["id","quantity"]},"description":"One line per listing"}},"required":["items"]},"example":{"items":[{"id":"1042","quantity":35},{"id":"1043","quantity":0}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ok":{"type":"boolean"},"quantity":{"type":["number","null"]},"status":{"type":["string","null"]},"error":{"description":"Why this line was refused","type":["string","null"]}},"required":["id","ok","quantity","status","error"],"additionalProperties":false}},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":[{"id":"1042","ok":true,"quantity":35,"status":"active","error":null},{"id":"1043","ok":true,"quantity":0,"status":"paused","error":null}],"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/offers":{"get":{"operationId":"listOffers","tags":["Offers"],"summary":"List offers","description":"Offers your company sent and received, newest first. Only the two companies of an offer ever see it.\n\nNeeds the `offers` scope.","parameters":[{"name":"status","in":"query","required":false,"description":"Only this status","schema":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"]}},{"name":"direction","in":"query","required":false,"description":"Only sent or only received","schema":{"type":"string","enum":["sent","received"]}},{"name":"listing_id","in":"query","required":false,"description":"Only offers on this listing","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"cursor","in":"query","required":false,"description":"The `next_cursor` of the page before. Leave it out for the first page","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many to return on one page","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"listing_id":{"type":"string"},"listing_title":{"type":"string"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"],"description":"Where the offer stands"},"direction":{"type":"string","enum":["sent","received"],"description":"`sent` when your company made it"},"other_company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"kind":{"type":"string","enum":["cash","trade","both"],"description":"Cash, a trade, or a trade with cash"},"quantity":{"type":"number"},"unit":{"type":"string"},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The cash part, in US cents"},"trade_listing_id":{"description":"A listing offered in trade","type":["string","null"]},"trade_quantity":{"description":"How much of it","type":["number","null"]},"trade_text":{"description":"An item offered in trade, in words","type":["string","null"]},"want_text":{"description":"What is wanted in return, in words","type":["string","null"]},"note":{"type":"string"},"counter_of":{"description":"The offer this one answers","type":["string","null"]},"expires_at":{"type":"string","description":"An open offer ends then. ISO 8601 in UTC"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"},"decided_at":{"description":"When it was answered","type":["string","null"]}},"required":["id","listing_id","listing_title","status","direction","other_company","kind","quantity","unit","total_cents","trade_listing_id","trade_quantity","trade_text","want_text","note","counter_of","expires_at","created_at","decided_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` for the next page; null on the last page","type":["string","null"]},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","next_cursor","meta"],"additionalProperties":false},"example":{"data":[{"id":"88","listing_id":"1042","listing_title":"Clean fill, screened","status":"open","direction":"received","other_company":{"slug":"north-shore-paving","name":"North Shore Paving","kind":"contractor","url":"https://siteswap.pro/c/north-shore-paving"},"kind":"cash","quantity":20,"unit":"yd","total_cents":0,"trade_listing_id":null,"trade_quantity":null,"trade_text":null,"want_text":null,"note":"Can pick up Friday.","counter_of":null,"expires_at":"2026-12-09T14:03:20.991Z","created_at":"2026-12-02T14:03:20.991Z","decided_at":null}],"next_cursor":null,"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createOffer","tags":["Offers"],"summary":"Send an offer","description":"Sends an offer on a listing of another company, where its marketplace takes offers: cash, a trade or both, as the listing allows. Accepting it later sets the quantity aside.\n\nNeeds the `offers` scope.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"description":"Left out where the listing takes cash only","type":"string","enum":["cash","trade","both"]},"quantity":{"type":"number","exclusiveMinimum":0,"description":"How much or how many, in the listing's unit"},"total":{"description":"The total cash, in dollars","type":"number","minimum":0,"maximum":100000000},"cash_from":{"description":"With `both`: who pays the cash","type":"string","enum":["me","them"]},"trade_listing_id":{"description":"One of your listings (or theirs, when you counter as the poster)","type":"string","pattern":"^[1-9][0-9]{0,15}$"},"trade_quantity":{"type":"number","exclusiveMinimum":0},"trade_text":{"description":"An item offered in trade, in words, when it is not a listing","type":"string","maxLength":500},"want_text":{"description":"On a wanted listing: what you want in return","type":"string","maxLength":500},"note":{"type":"string","maxLength":1000},"listing_id":{"type":"string","pattern":"^[1-9][0-9]{0,15}$","description":"The listing"}},"required":["quantity","listing_id"]},"example":{"listing_id":"1042","kind":"cash","quantity":20,"total":0,"note":"Can pick up Friday."}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"listing_id":{"type":"string"},"listing_title":{"type":"string"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"],"description":"Where the offer stands"},"direction":{"type":"string","enum":["sent","received"],"description":"`sent` when your company made it"},"other_company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"kind":{"type":"string","enum":["cash","trade","both"],"description":"Cash, a trade, or a trade with cash"},"quantity":{"type":"number"},"unit":{"type":"string"},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The cash part, in US cents"},"trade_listing_id":{"description":"A listing offered in trade","type":["string","null"]},"trade_quantity":{"description":"How much of it","type":["number","null"]},"trade_text":{"description":"An item offered in trade, in words","type":["string","null"]},"want_text":{"description":"What is wanted in return, in words","type":["string","null"]},"note":{"type":"string"},"counter_of":{"description":"The offer this one answers","type":["string","null"]},"expires_at":{"type":"string","description":"An open offer ends then. ISO 8601 in UTC"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"},"decided_at":{"description":"When it was answered","type":["string","null"]}},"required":["id","listing_id","listing_title","status","direction","other_company","kind","quantity","unit","total_cents","trade_listing_id","trade_quantity","trade_text","want_text","note","counter_of","expires_at","created_at","decided_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"second_offer: you have an open offer on this listing already; listing_closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"invalid: the offer was refused; `message` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/offers/{id}":{"get":{"operationId":"getOffer","tags":["Offers"],"summary":"Get an offer","description":"One offer of your company. 404 for anyone else's.\n\nNeeds the `offers` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The offer's id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"listing_id":{"type":"string"},"listing_title":{"type":"string"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"],"description":"Where the offer stands"},"direction":{"type":"string","enum":["sent","received"],"description":"`sent` when your company made it"},"other_company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"kind":{"type":"string","enum":["cash","trade","both"],"description":"Cash, a trade, or a trade with cash"},"quantity":{"type":"number"},"unit":{"type":"string"},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The cash part, in US cents"},"trade_listing_id":{"description":"A listing offered in trade","type":["string","null"]},"trade_quantity":{"description":"How much of it","type":["number","null"]},"trade_text":{"description":"An item offered in trade, in words","type":["string","null"]},"want_text":{"description":"What is wanted in return, in words","type":["string","null"]},"note":{"type":"string"},"counter_of":{"description":"The offer this one answers","type":["string","null"]},"expires_at":{"type":"string","description":"An open offer ends then. ISO 8601 in UTC"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"},"decided_at":{"description":"When it was answered","type":["string","null"]}},"required":["id","listing_id","listing_title","status","direction","other_company","kind","quantity","unit","total_cents","trade_listing_id","trade_quantity","trade_text","want_text","note","counter_of","expires_at","created_at","decided_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/offers/{id}/counter":{"post":{"operationId":"counterOffer","tags":["Offers"],"summary":"Counter an offer","description":"Answers an open offer of the other company with other terms, where the marketplace takes trades. The offer answered stops being open in the same step, so only one of the two can be accepted.\n\nNeeds the `offers` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The offer to answer","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"description":"Left out where the listing takes cash only","type":"string","enum":["cash","trade","both"]},"quantity":{"type":"number","exclusiveMinimum":0,"description":"How much or how many, in the listing's unit"},"total":{"description":"The total cash, in dollars","type":"number","minimum":0,"maximum":100000000},"cash_from":{"description":"With `both`: who pays the cash","type":"string","enum":["me","them"]},"trade_listing_id":{"description":"One of your listings (or theirs, when you counter as the poster)","type":"string","pattern":"^[1-9][0-9]{0,15}$"},"trade_quantity":{"type":"number","exclusiveMinimum":0},"trade_text":{"description":"An item offered in trade, in words, when it is not a listing","type":"string","maxLength":500},"want_text":{"description":"On a wanted listing: what you want in return","type":"string","maxLength":500},"note":{"type":"string","maxLength":1000}},"required":["quantity"]},"example":{"kind":"cash","quantity":20,"total":150}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"listing_id":{"type":"string"},"listing_title":{"type":"string"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"],"description":"Where the offer stands"},"direction":{"type":"string","enum":["sent","received"],"description":"`sent` when your company made it"},"other_company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"kind":{"type":"string","enum":["cash","trade","both"],"description":"Cash, a trade, or a trade with cash"},"quantity":{"type":"number"},"unit":{"type":"string"},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The cash part, in US cents"},"trade_listing_id":{"description":"A listing offered in trade","type":["string","null"]},"trade_quantity":{"description":"How much of it","type":["number","null"]},"trade_text":{"description":"An item offered in trade, in words","type":["string","null"]},"want_text":{"description":"What is wanted in return, in words","type":["string","null"]},"note":{"type":"string"},"counter_of":{"description":"The offer this one answers","type":["string","null"]},"expires_at":{"type":"string","description":"An open offer ends then. ISO 8601 in UTC"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"},"decided_at":{"description":"When it was answered","type":["string","null"]}},"required":["id","listing_id","listing_title","status","direction","other_company","kind","quantity","unit","total_cents","trade_listing_id","trade_quantity","trade_text","want_text","note","counter_of","expires_at","created_at","decided_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/offers/{id}/accept":{"post":{"operationId":"acceptOffer","tags":["Offers"],"summary":"Accept an offer","description":"Accepts an open offer your company received. The quantity is set aside on the listing at once; 409 when not enough is left or the listing changed since the offer was made.\n\nNeeds the `offers` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The offer","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"listing_id":{"type":"string"},"listing_title":{"type":"string"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"],"description":"Where the offer stands"},"direction":{"type":"string","enum":["sent","received"],"description":"`sent` when your company made it"},"other_company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"kind":{"type":"string","enum":["cash","trade","both"],"description":"Cash, a trade, or a trade with cash"},"quantity":{"type":"number"},"unit":{"type":"string"},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The cash part, in US cents"},"trade_listing_id":{"description":"A listing offered in trade","type":["string","null"]},"trade_quantity":{"description":"How much of it","type":["number","null"]},"trade_text":{"description":"An item offered in trade, in words","type":["string","null"]},"want_text":{"description":"What is wanted in return, in words","type":["string","null"]},"note":{"type":"string"},"counter_of":{"description":"The offer this one answers","type":["string","null"]},"expires_at":{"type":"string","description":"An open offer ends then. ISO 8601 in UTC"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"},"decided_at":{"description":"When it was answered","type":["string","null"]}},"required":["id","listing_id","listing_title","status","direction","other_company","kind","quantity","unit","total_cents","trade_listing_id","trade_quantity","trade_text","want_text","note","counter_of","expires_at","created_at","decided_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/offers/{id}/decline":{"post":{"operationId":"declineOffer","tags":["Offers"],"summary":"Decline an offer","description":"Declines an open offer your company received.\n\nNeeds the `offers` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The offer","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"listing_id":{"type":"string"},"listing_title":{"type":"string"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"],"description":"Where the offer stands"},"direction":{"type":"string","enum":["sent","received"],"description":"`sent` when your company made it"},"other_company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"kind":{"type":"string","enum":["cash","trade","both"],"description":"Cash, a trade, or a trade with cash"},"quantity":{"type":"number"},"unit":{"type":"string"},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The cash part, in US cents"},"trade_listing_id":{"description":"A listing offered in trade","type":["string","null"]},"trade_quantity":{"description":"How much of it","type":["number","null"]},"trade_text":{"description":"An item offered in trade, in words","type":["string","null"]},"want_text":{"description":"What is wanted in return, in words","type":["string","null"]},"note":{"type":"string"},"counter_of":{"description":"The offer this one answers","type":["string","null"]},"expires_at":{"type":"string","description":"An open offer ends then. ISO 8601 in UTC"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"},"decided_at":{"description":"When it was answered","type":["string","null"]}},"required":["id","listing_id","listing_title","status","direction","other_company","kind","quantity","unit","total_cents","trade_listing_id","trade_quantity","trade_text","want_text","note","counter_of","expires_at","created_at","decided_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/offers/{id}/withdraw":{"post":{"operationId":"withdrawOffer","tags":["Offers"],"summary":"Withdraw an offer","description":"Withdraws an open offer your company sent.\n\nNeeds the `offers` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The offer","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"listing_id":{"type":"string"},"listing_title":{"type":"string"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn","expired","countered","completed","cancelled"],"description":"Where the offer stands"},"direction":{"type":"string","enum":["sent","received"],"description":"`sent` when your company made it"},"other_company":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},"kind":{"type":"string","enum":["cash","trade","both"],"description":"Cash, a trade, or a trade with cash"},"quantity":{"type":"number"},"unit":{"type":"string"},"total_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The cash part, in US cents"},"trade_listing_id":{"description":"A listing offered in trade","type":["string","null"]},"trade_quantity":{"description":"How much of it","type":["number","null"]},"trade_text":{"description":"An item offered in trade, in words","type":["string","null"]},"want_text":{"description":"What is wanted in return, in words","type":["string","null"]},"note":{"type":"string"},"counter_of":{"description":"The offer this one answers","type":["string","null"]},"expires_at":{"type":"string","description":"An open offer ends then. ISO 8601 in UTC"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"},"decided_at":{"description":"When it was answered","type":["string","null"]}},"required":["id","listing_id","listing_title","status","direction","other_company","kind","quantity","unit","total_cents","trade_listing_id","trade_quantity","trade_text","want_text","note","counter_of","expires_at","created_at","decided_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/company":{"get":{"operationId":"getOwnCompany","tags":["Companies"],"summary":"Get your company","description":"The company this key or sign-in works for, the role of the person behind it, and what the key may do.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"},"id":{"type":"string","description":"The company's id"},"your_role":{"type":"string","description":"The role of the person behind this key or sign-in"},"acting_as":{"type":"string","enum":["key","person"],"description":"`key` for an API key, `person` for a sign-in token"},"scopes":{"type":"array","items":{"type":"string"},"description":"What this key may do"},"listings":{"type":"object","properties":{"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["active","paused"],"additionalProperties":false}},"required":["slug","name","kind","url","id","your_role","acting_as","scopes","listings"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"7","slug":"acme-site-work","name":"Acme Site Work","kind":"contractor","url":"https://siteswap.pro/c/acme-site-work","your_role":"owner","acting_as":"key","scopes":["listings:read","listings:write"],"listings":{"active":12,"paused":1}},"meta":{"request_id":"3f9a1c0b7d2e","api_version":"v1"}}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/companies/{slug}":{"get":{"operationId":"getCompany","tags":["Companies"],"summary":"Get a company profile","description":"A company's public profile: only what its page shows. A company that changed its address is found by the old one too. 404 for a suspended or closed company.\n\nNeeds the `listings:read` scope.","parameters":[{"name":"slug","in":"path","required":true,"description":"The company's slug","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,58}[a-z0-9]$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"},"city":{"description":"Its town","type":["string","null"]},"region":{"description":"Its state","type":["string","null"]},"about":{"description":"What it says about itself","type":["string","null"]},"website":{"type":["string","null"]},"phone":{"description":"A phone number it chose to show","type":["string","null"]},"email":{"description":"An address it chose to show","type":["string","null"]},"founded_year":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The year it started"},"service_miles":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How far it works"},"logo":{"description":"Its logo","type":["string","null"]},"live_listings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Listings that are live now"},"member_since":{"type":"string","description":"When it joined SiteSwap. ISO 8601 in UTC"}},"required":["slug","name","kind","url","city","region","about","website","phone","email","founded_year","service_miles","logo","live_listings","member_since"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog/categories":{"get":{"operationId":"listCategories","tags":["Catalog"],"summary":"List categories","description":"The categories of a marketplace, with their units.\n\nNeeds the `listings:read` scope.","parameters":[{"name":"marketplace","in":"query","required":false,"description":"A marketplace key, as `GET /marketplaces` lists them, for example `materials`","schema":{"default":"materials","type":"string","pattern":"^[a-z]{3,20}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"units":{"type":"array","items":{"type":"string"},"description":"The units a listing may use"},"soil_statement":{"type":"boolean","description":"Offered soil or fill needs the soil statement"},"live_listings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","slug","name","units","soil_statement","live_listings"],"additionalProperties":false}},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog/categories/{id}":{"get":{"operationId":"getCategory","tags":["Catalog"],"summary":"Get a category","description":"One category with its materials or types and the questions a listing answers (send the answers under `fields`).\n\nNeeds the `listings:read` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The category's id","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"units":{"type":"array","items":{"type":"string"},"description":"The units a listing may use"},"soil_statement":{"type":"boolean","description":"Offered soil or fill needs the soil statement"},"live_listings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"marketplace":{"type":"string"},"materials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"other_names":{"type":"array","items":{"type":"string"},"description":"Regional names it is also found by"}},"required":["id","name","other_names"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Send the answer under `fields.{key}`"},"label":{"type":"string"},"kind":{"type":"string","description":"`text`, `number` or `select`"},"options":{"type":"array","items":{"type":"string"},"description":"For `select`: the answers allowed"},"unit":{"type":["string","null"]},"required":{"type":"boolean","description":"Needed on an offered listing"}},"required":["key","label","kind","options","unit","required"],"additionalProperties":false}}},"required":["id","slug","name","units","soil_statement","live_listings","marketplace","materials","fields"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog/makers":{"get":{"operationId":"listMakers","tags":["Catalog"],"summary":"List makers","description":"Makers of the tool and equipment catalogs, 40 at a time, narrowed by what you type.\n\nNeeds the `listings:read` scope.","parameters":[{"name":"marketplace","in":"query","required":true,"description":"A marketplace key, as `GET /marketplaces` lists them, for example `materials`","schema":{"type":"string","pattern":"^[a-z]{3,20}$"}},{"name":"q","in":"query","required":false,"description":"Part of the name","schema":{"type":"string","maxLength":80}},{"name":"type","in":"query","required":false,"description":"A machine or tool type","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"detail":{"description":"More about it, for example the maker","type":["string","null"]},"maker":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"type":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"category_id":{"description":"A category the model can be posted under","type":["string","null"]},"source":{"description":"The maker's page it was read from","type":["string","null"]},"checked":{"description":"The day it was read","type":["string","null"]}},"required":["id","name","detail","maker","type","category_id","source","checked"],"additionalProperties":false}},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog/models":{"get":{"operationId":"listModels","tags":["Catalog"],"summary":"List models","description":"Models of one maker, 40 at a time, narrowed by what you type.\n\nNeeds the `listings:read` scope.","parameters":[{"name":"marketplace","in":"query","required":true,"description":"A marketplace key, as `GET /marketplaces` lists them, for example `materials`","schema":{"type":"string","pattern":"^[a-z]{3,20}$"}},{"name":"maker","in":"query","required":true,"description":"The maker","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}},{"name":"q","in":"query","required":false,"description":"Part of the model number or name","schema":{"type":"string","maxLength":80}},{"name":"type","in":"query","required":false,"description":"A machine or tool type","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"detail":{"description":"More about it, for example the maker","type":["string","null"]},"maker":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"type":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"category_id":{"description":"A category the model can be posted under","type":["string","null"]},"source":{"description":"The maker's page it was read from","type":["string","null"]},"checked":{"description":"The day it was read","type":["string","null"]}},"required":["id","name","detail","maker","type","category_id","source","checked"],"additionalProperties":false}},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/catalog/lookup":{"get":{"operationId":"lookupProduct","tags":["Catalog"],"summary":"Look up a model number or barcode","description":"Finds models by model number or name (`q`), or one model by a UPC, EAN or GTIN barcode (`code`). Send one of the two.\n\nNeeds the `listings:read` scope.","parameters":[{"name":"marketplace","in":"query","required":false,"description":"A marketplace key, as `GET /marketplaces` lists them, for example `materials`","schema":{"default":"tools","type":"string","pattern":"^[a-z]{3,20}$"}},{"name":"q","in":"query","required":false,"description":"A model number or name","schema":{"type":"string","maxLength":60}},{"name":"code","in":"query","required":false,"description":"A barcode number","schema":{"type":"string","maxLength":20}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"detail":{"description":"More about it, for example the maker","type":["string","null"]},"maker":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"type":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"category_id":{"description":"A category the model can be posted under","type":["string","null"]},"source":{"description":"The maker's page it was read from","type":["string","null"]},"checked":{"description":"The day it was read","type":["string","null"]}},"required":["id","name","detail","maker","type","category_id","source","checked"],"additionalProperties":false}},"code":{"anyOf":[{"type":"object","properties":{"valid":{"type":"boolean","description":"The barcode's check digit is right"},"pack":{"description":"The pack the code is printed on","type":["string","null"]},"quantity":{"description":"Pieces in that pack","type":["number","null"]}},"required":["valid","pack","quantity"],"additionalProperties":false},{"type":"null"}]}},"required":["models","code"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/saved-searches":{"get":{"operationId":"listSavedSearches","tags":["Alerts"],"summary":"List saved searches","description":"The saved searches of the person behind this key or sign-in.\n\nNeeds the `alerts` scope.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"marketplace":{"type":"string"},"query":{"type":"string","description":"The browse address it watches"},"mode":{"type":"string","enum":["instant","daily"],"description":"A notification per match, or one summary a day"},"paused":{"type":"boolean"},"matches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Listings matched so far"},"created_at":{"type":"string","description":"When it was saved. ISO 8601 in UTC"}},"required":["id","name","marketplace","query","mode","paused","matches","created_at"],"additionalProperties":false}},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createSavedSearch","tags":["Alerts"],"summary":"Save a search","description":"Saves a search the way the Save search button does: the filters are read again on the server, and only what a browse page accepts is kept. New matches arrive as notifications.\n\nNeeds the `alerts` scope.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"marketplace":{"type":"string","pattern":"^[a-z]{3,20}$","description":"A marketplace key, as `GET /marketplaces` lists them, for example `materials`"},"query":{"default":"","description":"The filters as a query string, with the names of `GET /listings` (or of a browse address on the site), for example `q=rebar&zip=01801&radius=50`","type":"string","maxLength":1500},"name":{"type":"string","minLength":1,"maxLength":80},"mode":{"default":"instant","type":"string","enum":["instant","daily"]}},"required":["marketplace","name"]},"example":{"marketplace":"materials","query":"q=rebar&zip=01801&radius=50","name":"Rebar near the yard","mode":"daily"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"marketplace":{"type":"string"},"query":{"type":"string","description":"The browse address it watches"},"mode":{"type":"string","enum":["instant","daily"],"description":"A notification per match, or one summary a day"},"paused":{"type":"boolean"},"matches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Listings matched so far"},"created_at":{"type":"string","description":"When it was saved. ISO 8601 in UTC"}},"required":["id","name","marketplace","query","mode","paused","matches","created_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/saved-searches/{id}":{"patch":{"operationId":"updateSavedSearch","tags":["Alerts"],"summary":"Change a saved search","description":"Renames it, pauses or resumes it, or changes how often it tells you.\n\nNeeds the `alerts` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The saved search","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"mode":{"type":"string","enum":["instant","daily"]},"paused":{"type":"boolean"}}},"example":{"paused":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"marketplace":{"type":"string"},"query":{"type":"string","description":"The browse address it watches"},"mode":{"type":"string","enum":["instant","daily"],"description":"A notification per match, or one summary a day"},"paused":{"type":"boolean"},"matches":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Listings matched so far"},"created_at":{"type":"string","description":"When it was saved. ISO 8601 in UTC"}},"required":["id","name","marketplace","query","mode","paused","matches","created_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteSavedSearch","tags":["Alerts"],"summary":"Delete a saved search","description":"Deletes it and its matches.\n\nNeeds the `alerts` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The saved search","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/notifications":{"get":{"operationId":"listNotifications","tags":["Alerts"],"summary":"List notifications","description":"Notifications of the person behind this key or sign-in, newest first: offers, deals, messages and saved search matches.\n\nNeeds the `alerts` scope.","parameters":[{"name":"cursor","in":"query","required":false,"description":"The `next_cursor` of the page before. Leave it out for the first page","schema":{"type":"string","maxLength":200}},{"name":"unread","in":"query","required":false,"description":"Only unread ones","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","description":"What it is about, for example `offer` or `alert`"},"title":{"type":"string"},"body":{"type":"string"},"url":{"type":"string","description":"Where it points on SiteSwap"},"read":{"type":"boolean"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"}},"required":["id","kind","title","body","url","read","created_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` for the next page; null on the last page","type":["string","null"]},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false},"unread":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Unread in all, up to 100"}},"required":["data","next_cursor","meta","unread"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/notifications/{id}/read":{"post":{"operationId":"readNotification","tags":["Alerts"],"summary":"Mark a notification read","description":"Marks one notification read.\n\nNeeds the `alerts` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The notification","schema":{"type":"string","pattern":"^[1-9][0-9]{0,15}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","description":"What it is about, for example `offer` or `alert`"},"title":{"type":"string"},"body":{"type":"string"},"url":{"type":"string","description":"Where it points on SiteSwap"},"read":{"type":"boolean"},"created_at":{"type":"string","description":"When it was made. ISO 8601 in UTC"}},"required":["id","kind","title","body","url","read","created_at"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/notifications/read-all":{"post":{"operationId":"readAllNotifications","tags":["Alerts"],"summary":"Mark all notifications read","description":"Marks every notification read.\n\nNeeds the `alerts` scope.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"marked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["marked"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys":{"get":{"operationId":"listKeys","tags":["Keys"],"summary":"List keys","description":"Your company's keys: waiting, active, declined and revoked, with their limits and use. With a key, or signed in on siteswap.pro as an owner or admin of the company.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The key's public prefix: the 10 characters after `ssk_`"},"name":{"type":"string"},"purpose":{"type":"string"},"status":{"type":"string","enum":["pending","active","declined","revoked"],"description":"`pending` until a SiteSwap admin approves it"},"scopes_asked":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"},"description":"What it was granted; empty until approved"},"per_minute":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Requests a minute"},"per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Requests a day (UTC)"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls counted so far"},"last_used_at":{"description":"The last call","type":["string","null"]},"created_at":{"type":"string","description":"When it was asked for. ISO 8601 in UTC"},"asked_by":{"type":"string","description":"Who asked for it"},"note":{"description":"Why it was declined, from the SiteSwap admin","type":["string","null"]}},"required":["id","name","purpose","status","scopes_asked","scopes","per_minute","per_day","calls","last_used_at","created_at","asked_by","note"],"additionalProperties":false}},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createKey","tags":["Keys"],"summary":"Ask for a key","description":"Asks for a key for your company. Only from siteswap.pro, signed in as an owner or admin (the API keys page does this). The key is in this answer only. It answers `403 key_pending` until a SiteSwap admin approves it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"purpose":{"type":"string","minLength":10,"maxLength":500,"description":"What the key is for. A SiteSwap admin reads it before approving"},"scopes":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["listings:read","listings:write","offers","alerts"]},"description":"What it may do"}},"required":["name","purpose","scopes"]},"example":{"name":"Stock sync","purpose":"Keep our yard stock in step with our inventory system.","scopes":["listings:read","listings:write"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"The key's public prefix: the 10 characters after `ssk_`"},"name":{"type":"string"},"purpose":{"type":"string"},"status":{"type":"string","enum":["pending","active","declined","revoked"],"description":"`pending` until a SiteSwap admin approves it"},"scopes_asked":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"},"description":"What it was granted; empty until approved"},"per_minute":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Requests a minute"},"per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Requests a day (UTC)"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls counted so far"},"last_used_at":{"description":"The last call","type":["string","null"]},"created_at":{"type":"string","description":"When it was asked for. ISO 8601 in UTC"},"asked_by":{"type":"string","description":"Who asked for it"},"note":{"description":"Why it was declined, from the SiteSwap admin","type":["string","null"]},"key":{"type":"string","description":"The key itself, shown only here"}},"required":["id","name","purpose","status","scopes_asked","scopes","per_minute","per_day","calls","last_used_at","created_at","asked_by","note","key"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/keys/{id}":{"delete":{"operationId":"revokeKey","tags":["Keys"],"summary":"Revoke a key","description":"Revokes one of your company's keys at once. With a key of the company, or signed in on siteswap.pro as an owner or admin.","parameters":[{"name":"id","in":"path","required":true,"description":"The key's id (its prefix)","schema":{"type":"string","pattern":"^[a-z0-9]{10}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"revoked":{"type":"string"}},"required":["revoked"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/keys/self":{"delete":{"operationId":"revokeSelf","tags":["Keys"],"summary":"Revoke the key you send","description":"Revokes the key in the header, whatever its state, even while it waits for approval. Use it the moment a key may have leaked.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"revoked":{"type":"string"}},"required":["revoked"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/session":{"post":{"operationId":"createSession","tags":["Sign-in tokens"],"summary":"Sign in (beta)","description":"For the phone apps: signs a person in with their email and password and returns a token that works like a key with every scope, for that person in their company. Rate limited per address and per email. The person must have accepted the current Terms on the site.","x-beta":true,"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":200,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200},"device":{"description":"A name for the device, shown to the person","type":"string","maxLength":80}},"required":["email","password"]},"example":{"email":"you@example.com","password":"your password","device":"iPhone"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"token":{"type":"string","description":"Send as `Authorization: Bearer`"},"expires_at":{"type":"string","description":"It stops working then. ISO 8601 in UTC"},"company":{"anyOf":[{"type":"object","properties":{"slug":{"type":"string","description":"The company's address on SiteSwap, `/c/{slug}`"},"name":{"type":"string"},"kind":{"type":"string","description":"What kind of company, for example `contractor` or `supplier`"},"url":{"type":"string","description":"Its public page"}},"required":["slug","name","kind","url"],"additionalProperties":false},{"type":"null"}]}},"required":["token","expires_at","company"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]},"delete":{"operationId":"deleteSession","tags":["Sign-in tokens"],"summary":"Sign out (beta)","description":"Ends the sign-in token in the header.","x-beta":true,"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"signed_out":{"type":"boolean"}},"required":["signed_out"],"additionalProperties":false},"meta":{"type":"object","properties":{"request_id":{"type":"string","description":"The id of this request. Quote it when you write to support"},"api_version":{"type":"string","const":"v1","description":"Always `v1`"}},"required":["request_id","api_version"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"400":{"description":"bad_request, key_in_url or invalid_json: the request could not be read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"missing_key or invalid_key: no key, or a key that is not valid or was revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found: nothing here that you may see","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large: the body is over 256 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited or daily_quota: wait for Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"operationId":"getSpec","tags":["Meta"],"summary":"Get the OpenAPI spec","description":"This document. No key needed.","security":[],"responses":{"200":{"description":"The spec","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}