{"openapi":"3.1.0","info":{"title":"Plausa Public API","version":"1.0.0","description":"Read and create Plausa data from your own systems. Business plan only. Authenticate with `x-api-key: plausa_sk_…` (or `Authorization: Bearer plausa_sk_…`). Rate limit: 120 requests per minute per key. Every response is scoped to the key owner."},"servers":[{"url":"/api/public/v1","description":"Same origin (used by Try it out)"},{"url":"https://plausa.lovable.app/api/public/v1","description":"Production"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"tags":[{"name":"Testimonials"},{"name":"Forms"},{"name":"Walls"},{"name":"Stats"},{"name":"Webhooks"}],"paths":{"/testimonials":{"get":{"tags":["Testimonials"],"summary":"List testimonials","description":"Cursor pagination: pass `cursor` from `page.next_cursor` (or `links.next`). `offset` remains supported for backwards compatibility.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"status","in":"query","schema":{"type":"string","enum":["new","approved","hidden"]}},{"name":"sentiment","in":"query","schema":{"type":"string","enum":["very_positive","positive","neutral","mixed"]}},{"name":"medium","in":"query","schema":{"type":"string","enum":["text","video"]}},{"name":"theme","in":"query","description":"Stable theme key returned in `themes[].key`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated testimonials","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"author_name":{"type":"string","nullable":true},"author_role":{"type":"string","nullable":true},"rating":{"type":"integer","nullable":true,"minimum":1,"maximum":5},"medium":{"type":"string","enum":["text","video"]},"source":{"type":"string","example":"form"},"body_original":{"type":"string","nullable":true},"body_polished":{"type":"string","nullable":true},"published_version":{"type":"string","enum":["original","polished"]},"source_locale":{"type":"string","enum":["fr","en","es"]},"translations":{"type":"object","additionalProperties":{"type":"string"}},"sentiment":{"type":"string","nullable":true,"enum":["very_positive","positive","neutral","mixed"]},"sentiment_summary":{"type":"string","nullable":true},"themes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"customer_support"},"labels":{"type":"object","additionalProperties":{"type":"string"}}}}},"status":{"type":"string","enum":["new","approved","hidden"]},"created_at":{"type":"string","format":"date-time"}}}},"count":{"type":"integer"},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"page":{"type":"object","description":"Cursor pagination state for this response.","properties":{"limit":{"type":"integer","example":50},"count":{"type":"integer","description":"Number of items in `data`."},"total":{"type":"integer","nullable":true,"description":"Total matching rows when known."},"has_more":{"type":"boolean"},"next_cursor":{"type":"string","nullable":true,"description":"Opaque cursor to pass as `cursor` for the next page."}}},"links":{"type":"object","description":"Absolute pagination links, consistent across endpoints.","properties":{"self":{"type":"string","format":"uri"},"next":{"type":"string","format":"uri","nullable":true},"first":{"type":"string","format":"uri"}}}}}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"403":{"description":"Business plan required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}}}}},"/forms":{"get":{"tags":["Forms"],"summary":"List collection forms (or one, with `slug`)","parameters":[{"name":"slug","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Forms","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"intro":{"type":"string","nullable":true},"accent_color":{"type":"string","example":"#0F4C43"},"questions":{"type":"array","items":{"type":"string"},"maxItems":5},"locale":{"type":"string","enum":["fr","en","es"]},"is_active":{"type":"boolean"},"testimonial_count":{"type":"integer"},"public_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}}},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"intro":{"type":"string","nullable":true},"accent_color":{"type":"string","example":"#0F4C43"},"questions":{"type":"array","items":{"type":"string"},"maxItems":5},"locale":{"type":"string","enum":["fr","en","es"]},"is_active":{"type":"boolean"},"testimonial_count":{"type":"integer"},"public_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}}]},"count":{"type":"integer"}}}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"403":{"description":"Business plan required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"404":{"description":"Form not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}}}},"post":{"tags":["Forms"],"summary":"Create a collection form","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","title"],"properties":{"name":{"type":"string"},"title":{"type":"string"},"intro":{"type":"string"},"accentColor":{"type":"string","example":"#0F4C43"},"questions":{"type":"array","items":{"type":"string"},"maxItems":5},"locale":{"type":"string","enum":["fr","en","es"]},"isActive":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Form created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"intro":{"type":"string","nullable":true},"accent_color":{"type":"string","example":"#0F4C43"},"questions":{"type":"array","items":{"type":"string"},"maxItems":5},"locale":{"type":"string","enum":["fr","en","es"]},"is_active":{"type":"boolean"},"testimonial_count":{"type":"integer"},"public_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Invalid JSON body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"402":{"description":"Plan quota reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}}}}},"/walls":{"get":{"tags":["Walls"],"summary":"List walls, or one wall with its approved testimonials","parameters":[{"name":"slug","in":"query","schema":{"type":"string"}},{"name":"locale","in":"query","schema":{"type":"string","enum":["fr","en","es"]}}],"responses":{"200":{"description":"Walls","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string","nullable":true},"brand_name":{"type":"string","nullable":true},"accent_color":{"type":"string"},"background_color":{"type":"string"},"layout":{"type":"string","enum":["grid","masonry"]},"locale":{"type":"string","enum":["fr","en","es"]},"is_active":{"type":"boolean"},"public_url":{"type":"string","format":"uri"},"embed_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}}},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string","nullable":true},"brand_name":{"type":"string","nullable":true},"accent_color":{"type":"string"},"background_color":{"type":"string"},"layout":{"type":"string","enum":["grid","masonry"]},"locale":{"type":"string","enum":["fr","en","es"]},"is_active":{"type":"boolean"},"public_url":{"type":"string","format":"uri"},"embed_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}}]},"count":{"type":"integer"}}}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"404":{"description":"Wall not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}}}}},"/stats":{"get":{"tags":["Stats"],"summary":"Account statistics with cursor-paginated themes","parameters":[{"name":"limit","in":"query","description":"Themes per page.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"testimonials":{"type":"object"},"themes":{"type":"array","items":{"type":"object"}},"top_themes":{"type":"array","items":{"type":"object"}},"forms":{"type":"integer"},"walls":{"type":"integer"}}},"page":{"type":"object","description":"Cursor pagination state for this response.","properties":{"limit":{"type":"integer","example":50},"count":{"type":"integer","description":"Number of items in `data`."},"total":{"type":"integer","nullable":true,"description":"Total matching rows when known."},"has_more":{"type":"boolean"},"next_cursor":{"type":"string","nullable":true,"description":"Opaque cursor to pass as `cursor` for the next page."}}},"links":{"type":"object","description":"Absolute pagination links, consistent across endpoints.","properties":{"self":{"type":"string","format":"uri"},"next":{"type":"string","format":"uri","nullable":true},"first":{"type":"string","format":"uri"}}}}}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]}}}}}}}},"webhooks":{"form.created":{"post":{"summary":"Sent when a collection form is created","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"event":{"type":"string","const":"form.created"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"form_id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"public_url":{"type":"string","format":"uri"}}}}}}}},"responses":{"200":{"description":"Acknowledged"}}}},"testimonial.approved":{"post":{"summary":"Sent when a testimonial is approved","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"event":{"type":"string","const":"testimonial.approved"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"testimonial_id":{"type":"string","format":"uuid"},"author_name":{"type":"string","nullable":true},"rating":{"type":"integer","nullable":true},"medium":{"type":"string","enum":["text","video"]},"sentiment":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"source_locale":{"type":"string","enum":["fr","en","es"]}}}}}}}},"responses":{"200":{"description":"Acknowledged"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"},"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Human readable error message"}},"required":["error"]},"Page":{"type":"object","description":"Cursor pagination state for this response.","properties":{"limit":{"type":"integer","example":50},"count":{"type":"integer","description":"Number of items in `data`."},"total":{"type":"integer","nullable":true,"description":"Total matching rows when known."},"has_more":{"type":"boolean"},"next_cursor":{"type":"string","nullable":true,"description":"Opaque cursor to pass as `cursor` for the next page."}}},"Links":{"type":"object","description":"Absolute pagination links, consistent across endpoints.","properties":{"self":{"type":"string","format":"uri"},"next":{"type":"string","format":"uri","nullable":true},"first":{"type":"string","format":"uri"}}},"Testimonial":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"author_name":{"type":"string","nullable":true},"author_role":{"type":"string","nullable":true},"rating":{"type":"integer","nullable":true,"minimum":1,"maximum":5},"medium":{"type":"string","enum":["text","video"]},"source":{"type":"string","example":"form"},"body_original":{"type":"string","nullable":true},"body_polished":{"type":"string","nullable":true},"published_version":{"type":"string","enum":["original","polished"]},"source_locale":{"type":"string","enum":["fr","en","es"]},"translations":{"type":"object","additionalProperties":{"type":"string"}},"sentiment":{"type":"string","nullable":true,"enum":["very_positive","positive","neutral","mixed"]},"sentiment_summary":{"type":"string","nullable":true},"themes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","example":"customer_support"},"labels":{"type":"object","additionalProperties":{"type":"string"}}}}},"status":{"type":"string","enum":["new","approved","hidden"]},"created_at":{"type":"string","format":"date-time"}}},"Form":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"intro":{"type":"string","nullable":true},"accent_color":{"type":"string","example":"#0F4C43"},"questions":{"type":"array","items":{"type":"string"},"maxItems":5},"locale":{"type":"string","enum":["fr","en","es"]},"is_active":{"type":"boolean"},"testimonial_count":{"type":"integer"},"public_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}},"Wall":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string","nullable":true},"brand_name":{"type":"string","nullable":true},"accent_color":{"type":"string"},"background_color":{"type":"string"},"layout":{"type":"string","enum":["grid","masonry"]},"locale":{"type":"string","enum":["fr","en","es"]},"is_active":{"type":"boolean"},"public_url":{"type":"string","format":"uri"},"embed_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"}}}}}}