{"openapi":"3.1.0","info":{"title":"LynBro PBX — partner API used by plugins","version":"1.0.0","x-contract":"partner/v1","description":"Authenticate with the site owner's key: `Authorization: Bearer pbx_…`. Server-to-server only (no CORS). Error envelope `{\"error\":{\"code\",\"message\",\"details\"}}`, `message` in da/en/uk by Accept-Language. Codes: `invalid_key` 401, `scope_missing` 403, `quota_exceeded` 402, `rate_limited` 429, `validation_error` 422, `not_found` 404."},"servers":[{"url":"https://pbx-app.lynbro.dk/api/v1"}],"security":[{"PbxKey":[]}],"paths":{"/partner/me":{"get":{"operationId":"me","summary":"Who am I — the plugin's Test button","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["account_name","plan","quota","scopes","key","contract"],"properties":{"account_name":{"type":"string"},"tenant":{"type":"string"},"plan":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"stops_at_limit":{"type":"boolean"}}},"quota":{"type":"object","required":["used","limit","resets_at"],"properties":{"unit":{"type":"string","enum":["minutes"]},"used":{"type":"integer"},"limit":{"type":["integer","null"]},"resets_at":{"type":"string","format":"date-time"},"exhausted":{"type":"boolean"}}},"scopes":{"type":"array","items":{"type":"string"}},"origins":{"type":"array","items":{"type":"string"}},"key":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":"string"},"last4":{"type":"string"},"expires_at":{"type":["string","null"]}}},"sandbox":{"type":"boolean"},"contract":{"type":"string","enum":["partner/v1"]},"settings":{"$ref":"#/components/schemas/Settings"},"site":{"type":["object","null"],"properties":{"url":{"type":"string"},"status":{"type":"string"},"signature":{"type":"string"},"verified_at":{"type":["string","null"]}}},"links":{"type":"object"}}}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/ping":{"get":{"operationId":"ping","summary":"Legacy liveness of the key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/settings":{"get":{"operationId":"getSettings","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settings"}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"putSettings","summary":"Needs bookings.write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settings"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settings"}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/site/verify":{"post":{"operationId":"verifySite","summary":"We run the read-only conformance suite against the connected site and switch the connection on when it passes","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/sync/services":{"post":{"operationId":"sync_services","summary":"Services (as Part A Service)","description":"Up to 500 items per call; the same `id` updates, never duplicates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"saved":{"type":"integer"}}}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/sync/staff":{"post":{"operationId":"sync_staff","summary":"Staff (as Part A Staff)","description":"Up to 500 items per call; the same `id` updates, never duplicates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"saved":{"type":"integer"}}}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/sync/locations":{"post":{"operationId":"sync_locations","summary":"Locations","description":"Up to 500 items per call; the same `id` updates, never duplicates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"saved":{"type":"integer"}}}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/sync/appointments":{"post":{"operationId":"sync_appointments","summary":"Bookings made on the site","description":"Up to 500 items per call; the same `id` updates, never duplicates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"saved":{"type":"integer"}}}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/sync/customers":{"post":{"operationId":"sync_customers","summary":"Customers {phone, name, email, notes, tags}","description":"Up to 500 items per call; the same `id` updates, never duplicates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","maxItems":500,"items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"saved":{"type":"integer"}}}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/sync/kb":{"post":{"operationId":"sync_kb","summary":"Knowledge base: pages and links","description":"Up to 500 items per call; the same `id` updates, never duplicates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"}}}},"links":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"saved":{"type":"integer"}}}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/calls":{"get":{"operationId":"calls","parameters":[{"name":"since","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"phone","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/events":{"get":{"operationId":"events","parameters":[{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"invalid_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"scope_missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited — Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"PbxKey":{"type":"http","scheme":"bearer","bearerFormat":"pbx_…"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object"}}}}},"Settings":{"type":"object","properties":{"confirmations_by_site":{"type":"boolean","description":"Booking confirmations are sent by the site: Part A writes carry notify_customer=true, booking events carry data.confirmation_by=\"site\", the PBX sends none."}}}}}}