{"openapi":"3.1.0","info":{"title":"Swiss NewCo Feed API","version":"1.0.0","description":"Every company newly registered in the Swiss commercial register (SHAB, rubric HR01), with postal address, people and, where published on the company website, website, e-mail and phone.","contact":{"url":"https://swissnewco.tollwyn.com/docs"}},"servers":[{"url":"https://swissnewco.tollwyn.com"}],"security":[{"bearer":[]}],"paths":{"/v1/signup":{"post":{"summary":"Create an account and get an API key","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password","accept_terms"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":10},"via":{"type":"string","description":"Attribution code, e.g. partner-x"},"accept_terms":{"const":true,"description":"Accepts the terms (https://swissnewco.tollwyn.com/terms) on behalf of your business"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object"},"api_key":{"type":"string"},"next":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/companies":{"get":{"summary":"New entries, newest first","parameters":[{"name":"published_from","in":"query","schema":{"type":"string","format":"date"}},{"name":"published_to","in":"query","schema":{"type":"string","format":"date"}},{"name":"canton","in":"query","description":"Comma-separated canton codes (AG, AI, AR, BE, BL, BS, FR, GE, GL, GR, JU, LU, NE, NW, OW, SG, SH, SO, SZ, TG, TI, UR, VD, VS, ZG, ZH)","schema":{"type":"string"}},{"name":"zip","in":"query","description":"Comma-separated postcode prefixes of 1 to 4 digits","schema":{"type":"string"}},{"name":"legal_form","in":"query","description":"Comma-separated legal form codes, e.g. 0107,0106","schema":{"type":"string"}},{"name":"has_website","in":"query","schema":{"type":"boolean"}},{"name":"has_email","in":"query","schema":{"type":"boolean"}},{"name":"has_care_of","in":"query","schema":{"type":"boolean"}},{"name":"is_branch","in":"query","schema":{"type":"boolean"}},{"name":"checks_min","in":"query","schema":{"type":"integer","minimum":1,"maximum":3}},{"name":"q","in":"query","description":"A word in name or purpose","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of records","headers":{"X-Quota-Limit":{"schema":{"type":"integer"},"description":"Records per month of the plan"},"X-Quota-Remaining":{"schema":{"type":"integer"},"description":"Records left this month"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/companies.csv":{"get":{"summary":"The same records as CSV","parameters":[{"name":"published_from","in":"query","schema":{"type":"string","format":"date"}},{"name":"published_to","in":"query","schema":{"type":"string","format":"date"}},{"name":"canton","in":"query","description":"Comma-separated canton codes (AG, AI, AR, BE, BL, BS, FR, GE, GL, GR, JU, LU, NE, NW, OW, SG, SH, SO, SZ, TG, TI, UR, VD, VS, ZG, ZH)","schema":{"type":"string"}},{"name":"zip","in":"query","description":"Comma-separated postcode prefixes of 1 to 4 digits","schema":{"type":"string"}},{"name":"legal_form","in":"query","description":"Comma-separated legal form codes, e.g. 0107,0106","schema":{"type":"string"}},{"name":"has_website","in":"query","schema":{"type":"boolean"}},{"name":"has_email","in":"query","schema":{"type":"boolean"}},{"name":"has_care_of","in":"query","schema":{"type":"boolean"}},{"name":"is_branch","in":"query","schema":{"type":"boolean"}},{"name":"checks_min","in":"query","schema":{"type":"integer","minimum":1,"maximum":3}},{"name":"q","in":"query","description":"A word in name or purpose","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000},"description":"Without limit: up to 10000 rows"},{"name":"delimiter","in":"query","schema":{"enum":["comma","semicolon"]}},{"name":"include","in":"query","schema":{"enum":["publication_text"]}}],"responses":{"200":{"description":"CSV, UTF-8 with byte order mark","headers":{"X-Quota-Limit":{"schema":{"type":"integer"},"description":"Records per month of the plan"},"X-Quota-Remaining":{"schema":{"type":"integer"},"description":"Records left this month"},"X-Next-Cursor":{"schema":{"type":"string"}}},"content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/companies/{uid}":{"get":{"summary":"The newest entry of a UID","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^CHE-\\d{3}\\.\\d{3}\\.\\d{3}$"}}],"responses":{"200":{"description":"The record","headers":{"X-Quota-Limit":{"schema":{"type":"integer"},"description":"Records per month of the plan"},"X-Quota-Remaining":{"schema":{"type":"integer"},"description":"Records left this month"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/events":{"get":{"summary":"The change list","parameters":[{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000}}],"responses":{"200":{"description":"Events after the given id","headers":{"X-Quota-Limit":{"schema":{"type":"integer"},"description":"Records per month of the plan"},"X-Quota-Remaining":{"schema":{"type":"integer"},"description":"Records left this month"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next_after":{"type":["integer","null"]}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/account":{"get":{"summary":"Plan, limits and usage","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object"},"plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"history_days":{"type":["integer","null"]},"history_from":{"type":["string","null"],"format":"date"},"event_days":{"type":["integer","null"]},"records_per_month":{"type":"integer"},"webhook_endpoints":{"type":"integer"},"contacts":{"type":"boolean"},"license":{"type":"string"}}},"usage":{"type":"object","properties":{"month":{"type":"string"},"limit":{"type":"integer"},"used":{"type":"integer"},"remaining":{"type":"integer"}}},"subscription":{"type":["object","null"]}}}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/checkout":{"post":{"summary":"A Stripe Checkout URL for a plan","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"enum":["starter","pro","agency","platform"]},"interval":{"enum":["month","year"],"default":"month"},"renew":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/portal":{"post":{"summary":"A Stripe customer portal URL","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks":{"get":{"summary":"Webhook endpoints","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Add a webhook endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/test":{"post":{"summary":"Send a webhook.test event to any URL","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"},"secret":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"status":{"type":["integer","null"]},"error":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"patch":{"summary":"Change a webhook endpoint","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"filters":{"$ref":"#/components/schemas/WebhookFilters"},"enabled":{"type":"boolean"},"rotate_secret":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The endpoint"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"summary":"Delete a webhook endpoint","responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/test":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"summary":"Send a webhook.test event to a saved endpoint","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"status":{"type":["integer","null"]},"error":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key snf_…"}},"responses":{"Error":{"description":"An error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"schemas":{"Company":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"uid":{"type":"string"},"name":{"type":"string"},"name_translations":{"type":"array","items":{"type":"string"}},"legal_form":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"short":{"type":"string"}}},"is_branch":{"type":"boolean"},"head_office":{"type":["object","null"],"properties":{"name":{"type":"string"},"uid":{"type":["string","null"]}}},"seat":{"type":"string"},"canton":{"enum":["AG","AI","AR","BE","BL","BS","FR","GE","GL","GR","JU","LU","NE","NW","OW","SG","SH","SO","SZ","TG","TI","UR","VD","VS","ZG","ZH"]},"address":{"type":"object","properties":{"care_of":{"type":["string","null"]},"supplement":{"type":["string","null"]},"street":{"type":["string","null"]},"house_number":{"type":["string","null"]},"po_box":{"type":["string","null"]},"zip":{"type":["string","null"]},"town":{"type":["string","null"]}}},"purpose":{"type":["string","null"]},"capital":{"type":["object","null"],"properties":{"amount":{"type":"number"},"currency":{"type":"string"}}},"persons":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"family_name":{"type":["string","null"]},"given_names":{"type":["string","null"]},"residence":{"type":["string","null"]},"role":{"type":["string","null"]},"signature":{"type":["string","null"]}}}},"persons_parsed":{"type":"boolean"},"published_on":{"type":"string","format":"date"},"registered_on":{"type":["string","null"],"format":"date"},"language":{"type":"string"},"publication_text":{"type":"string"},"source":{"type":"object","properties":{"publication_number":{"type":"string"},"url":{"type":"string"}}},"contact":{"type":"object","properties":{"website":{"type":["string","null"]},"website_verified_by":{"enum":["uid","name","name_and_address",null]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"contact_page":{"type":["string","null"]},"has_website":{"type":"boolean"},"has_email":{"type":"boolean"},"has_phone":{"type":"boolean"},"masked":{"type":"boolean"},"status":{"enum":["pending","found","not_found","suppressed"]},"checks":{"type":"integer"},"checked_at":{"type":["string","null"],"format":"date-time"}}}}},"Event":{"type":"object","properties":{"id":{"type":"integer"},"type":{"enum":["company.registered","company.enriched","company.suppressed","company.redacted","webhook.test"]},"created_at":{"type":"string","format":"date-time"},"data":{"$ref":"#/components/schemas/Company"}}},"WebhookFilters":{"type":"object","properties":{"canton":{"type":"array","items":{"type":"string"}},"zip":{"type":"array","items":{"type":"string"}},"legal_form":{"type":"array","items":{"type":"string"}}}},"WebhookInput":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"https URL of your receiver"},"filters":{"$ref":"#/components/schemas/WebhookFilters"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"secret":{"type":"string"},"filters":{"$ref":"#/components/schemas/WebhookFilters"},"enabled":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}}}}}