{"openapi":"3.0.0","info":{"title":"Whitespace Data API","version":"1.0.0","description":"This is our client data. All /api/* endpoints require an API key."},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Organization":{"type":"object","required":["name","client"],"properties":{"id":{"type":"string","nullable":true,"description":"Whitespace customer ID, format WS-XXXXXXXX.","example":"WS-K7RMX9W2"},"name":{"type":"string"},"client":{"type":"boolean","description":"Whether the organization is an active client."},"type":{"type":"string","nullable":true,"description":"Engagement type, e.g. Matomo, Agency."},"date":{"type":"string","format":"date","nullable":true,"description":"First-invoice / onboarding date."},"pipedrive":{"type":"integer","nullable":true,"description":"Pipedrive organization ID."},"domains":{"type":"array","items":{"type":"string"},"description":"Email domains associated with the organization.","example":["example.se"]}}}}},"paths":{"/api/organizations":{"get":{"summary":"List organizations","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"client","in":"query","required":false,"schema":{"type":"boolean"},"description":"Filter by active-client flag."},{"name":"type","in":"query","required":false,"schema":{"type":"string"},"description":"Exact match on engagement type, e.g. `Matomo`."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"401":{"description":"Missing or invalid API key"}}},"post":{"summary":"Create an organization","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"},"example":{"id":"WS-K7RMX9W2","name":"Example AB","client":true,"type":"Matomo","date":"2026-05-19","pipedrive":12345,"domains":["example.se"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Organization"},{"type":"object","required":["rowid"],"properties":{"rowid":{"type":"integer","description":"SQLite rowid of the new row."}}}]}}}},"400":{"description":"Invalid JSON body or missing required fields"},"401":{"description":"Missing or invalid API key"},"409":{"description":"Organization with this id already exists"}}}}}}