diff --git a/src/.vitepress/sidebars/rest-api.js b/src/.vitepress/sidebars/rest-api.js
index 91c7843..190d74b 100644
--- a/src/.vitepress/sidebars/rest-api.js
+++ b/src/.vitepress/sidebars/rest-api.js
@@ -146,9 +146,27 @@ export default [
{ text: 'Bulk Action
Welcome to our newsletter.
" + }, + "meta": { + "wp_pattern_sync_status": "unsynced" + }, + "wp_pattern_category": [ + 3 + ] + } + } + } + }, + "responses": { + "200": { + "description": "Email pattern created successfully in WordPress block format.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WpBlockEmailPattern" + }, + "example": { + "id": 13, + "date": "2026-04-28 16:20:00", + "date_gmt": "2026-04-28 16:20:00", + "modified": "2026-04-28 16:20:00", + "modified_gmt": "2026-04-28 16:20:00", + "slug": "fluentcrm/welcome-pattern-13", + "status": "publish", + "type": "wp_block", + "link": "", + "title": { + "raw": "Welcome Pattern" + }, + "content": { + "raw": "Welcome to our newsletter.
", + "protected": false + }, + "meta": {}, + "wp_pattern_sync_status": "unsynced", + "wp_pattern_category": [ + 3 + ] + } + } + } + }, + "400": { + "description": "Both title and content were empty.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "message": "Title or content is required" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + }, + "WpBlockEmailPattern": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Pattern ID." + }, + "date": { + "type": "string", + "description": "Creation timestamp." + }, + "date_gmt": { + "type": "string", + "description": "Creation timestamp in GMT." + }, + "modified": { + "type": "string", + "description": "Last modification timestamp." + }, + "modified_gmt": { + "type": "string", + "description": "Last modification timestamp in GMT." + }, + "slug": { + "type": "string", + "description": "Pattern slug." + }, + "status": { + "type": "string", + "description": "Always `publish` for this response shape." + }, + "type": { + "type": "string", + "description": "Always `wp_block`." + }, + "link": { + "type": "string", + "description": "Pattern link. Currently empty." + }, + "title": { + "type": "object", + "properties": { + "raw": { + "type": "string", + "description": "Raw pattern title." + } + } + }, + "content": { + "type": "object", + "properties": { + "raw": { + "type": "string", + "description": "Raw block content." + }, + "protected": { + "type": "boolean", + "description": "Whether the content is protected." + } + } + }, + "meta": { + "type": "object", + "description": "WordPress block metadata object." + }, + "wp_pattern_sync_status": { + "type": "string", + "description": "Pattern sync status." + }, + "wp_pattern_category": { + "type": "array", + "description": "Resolved WordPress-style category IDs.", + "items": { + "type": "integer" + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/create-email-pattern.json b/src/public/openapi/email-patterns/create-email-pattern.json new file mode 100644 index 0000000..de54432 --- /dev/null +++ b/src/public/openapi/email-patterns/create-email-pattern.json @@ -0,0 +1,231 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns": { + "post": { + "operationId": "createEmailPattern", + "summary": "POST Create Email Pattern", + "description": "Create a reusable email pattern in FluentCRM. The title and content fields are required. The pattern is stored under the current user and receives an auto-generated `fluentcrm/...` slug.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "title", + "content" + ], + "properties": { + "title": { + "type": "string", + "description": "Pattern title." + }, + "content": { + "type": "string", + "description": "Pattern HTML or block markup content." + }, + "category": { + "type": "string", + "description": "Optional category name." + }, + "description": { + "type": "string", + "description": "Optional pattern description." + }, + "sync_status": { + "type": "string", + "description": "Optional sync status value.", + "default": "unsynced" + } + } + }, + "example": { + "title": "Welcome Pattern", + "content": "Welcome to our newsletter.
", + "category": "Onboarding", + "description": "Reusable onboarding email block.", + "sync_status": "unsynced" + } + } + } + }, + "responses": { + "200": { + "description": "Email pattern created successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "pattern": { + "$ref": "#/components/schemas/EmailPattern" + } + } + }, + "example": { + "message": "Pattern saved successfully", + "pattern": { + "id": 13, + "slug": "fluentcrm/welcome-pattern-13", + "title": "Welcome Pattern", + "content": "Welcome to our newsletter.
", + "category": "Onboarding", + "description": "Reusable onboarding email block.", + "sync_status": "unsynced", + "created_at": "2026-04-28 15:20:00", + "updated_at": "2026-04-28 15:20:00" + } + } + } + } + }, + "422": { + "description": "Validation error. Returned when required fields are missing or invalid.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "errors": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "example": { + "message": "Unprocessable Entity!", + "errors": { + "title": [ + "The title field is required." + ], + "content": [ + "The content field is required." + ] + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + }, + "EmailPattern": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Pattern ID." + }, + "slug": { + "type": "string", + "description": "Generated pattern slug." + }, + "title": { + "type": "string", + "description": "Pattern title." + }, + "content": { + "type": "string", + "description": "Pattern content HTML or block markup." + }, + "category": { + "type": "string", + "description": "Assigned category name." + }, + "description": { + "type": "string", + "description": "Pattern description." + }, + "sync_status": { + "type": "string", + "description": "Pattern sync status.", + "default": "unsynced" + }, + "created_at": { + "type": "string", + "description": "Pattern creation timestamp." + }, + "updated_at": { + "type": "string", + "description": "Pattern update timestamp." + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/delete-email-pattern-category.json b/src/public/openapi/email-patterns/delete-email-pattern-category.json new file mode 100644 index 0000000..d0900a0 --- /dev/null +++ b/src/public/openapi/email-patterns/delete-email-pattern-category.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns/categories/{id}": { + "delete": { + "operationId": "deleteEmailPatternCategory", + "summary": "DELETE Delete Email Pattern Category", + "description": "Delete an email pattern category by its ID.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "The email pattern category ID.", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Category deleted successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "example": { + "message": "Category deleted successfully" + } + } + } + }, + "404": { + "description": "Category not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "message": "No query results for model" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/delete-email-pattern.json b/src/public/openapi/email-patterns/delete-email-pattern.json new file mode 100644 index 0000000..f440a58 --- /dev/null +++ b/src/public/openapi/email-patterns/delete-email-pattern.json @@ -0,0 +1,120 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns/{id}": { + "delete": { + "operationId": "deleteEmailPattern", + "summary": "DELETE Delete Email Pattern", + "description": "Delete a reusable email pattern by its ID.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "The email pattern ID.", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Email pattern deleted successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "example": { + "message": "Pattern deleted successfully" + } + } + } + }, + "404": { + "description": "Email pattern not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "message": "No query results for model" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/get-email-pattern.json b/src/public/openapi/email-patterns/get-email-pattern.json new file mode 100644 index 0000000..a2ef54e --- /dev/null +++ b/src/public/openapi/email-patterns/get-email-pattern.json @@ -0,0 +1,172 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns/{id}": { + "get": { + "operationId": "getEmailPattern", + "summary": "GET Get Email Pattern", + "description": "Retrieve a single reusable email pattern by its ID.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "The email pattern ID.", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Email pattern retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pattern": { + "$ref": "#/components/schemas/EmailPattern" + } + } + }, + "example": { + "pattern": { + "id": 12, + "slug": "fluentcrm/welcome-pattern-12", + "title": "Welcome Pattern", + "content": "Welcome to our newsletter.
", + "category": "Onboarding", + "description": "Reusable onboarding email block.", + "sync_status": "unsynced", + "created_at": "2026-04-20 09:15:00", + "updated_at": "2026-04-21 11:30:00" + } + } + } + } + }, + "404": { + "description": "Email pattern not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "message": "No query results for model" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + }, + "EmailPattern": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Pattern ID." + }, + "slug": { + "type": "string", + "description": "Generated pattern slug." + }, + "title": { + "type": "string", + "description": "Pattern title." + }, + "content": { + "type": "string", + "description": "Pattern content HTML or block markup." + }, + "category": { + "type": "string", + "description": "Assigned category name." + }, + "description": { + "type": "string", + "description": "Pattern description." + }, + "sync_status": { + "type": "string", + "description": "Pattern sync status.", + "default": "unsynced" + }, + "created_at": { + "type": "string", + "description": "Pattern creation timestamp." + }, + "updated_at": { + "type": "string", + "description": "Pattern update timestamp." + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/list-email-pattern-categories.json b/src/public/openapi/email-patterns/list-email-pattern-categories.json new file mode 100644 index 0000000..6c4b93d --- /dev/null +++ b/src/public/openapi/email-patterns/list-email-pattern-categories.json @@ -0,0 +1,105 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns/categories": { + "get": { + "operationId": "listEmailPatternCategories", + "summary": "GET List Email Pattern Categories", + "description": "Retrieve the unique category names currently used by saved email patterns. The list is sorted alphabetically.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "List of unique email pattern category names.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "categories": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Alphabetically sorted category names." + } + } + }, + "example": { + "categories": [ + "Announcements", + "Onboarding", + "Promotions" + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/list-email-patterns-wp-format.json b/src/public/openapi/email-patterns/list-email-patterns-wp-format.json new file mode 100644 index 0000000..cbe86c3 --- /dev/null +++ b/src/public/openapi/email-patterns/list-email-patterns-wp-format.json @@ -0,0 +1,195 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns/wp-format": { + "get": { + "operationId": "listEmailPatternsWpFormat", + "summary": "GET List Email Patterns (WP Format)", + "description": "Retrieve email patterns formatted like WordPress `wp_block` REST responses for the FluentCRM editor middleware.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Email patterns in WordPress block REST format.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WpBlockEmailPattern" + } + }, + "example": [ + { + "id": 12, + "date": "2026-04-20 09:15:00", + "date_gmt": "2026-04-20 09:15:00", + "modified": "2026-04-21 11:30:00", + "modified_gmt": "2026-04-21 11:30:00", + "slug": "fluentcrm/welcome-pattern-12", + "status": "publish", + "type": "wp_block", + "link": "", + "title": { + "raw": "Welcome Pattern" + }, + "content": { + "raw": "Welcome to our newsletter.
", + "protected": false + }, + "meta": {}, + "wp_pattern_sync_status": "unsynced", + "wp_pattern_category": [ + 3 + ] + } + ] + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + }, + "WpBlockEmailPattern": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Pattern ID." + }, + "date": { + "type": "string", + "description": "Creation timestamp." + }, + "date_gmt": { + "type": "string", + "description": "Creation timestamp in GMT." + }, + "modified": { + "type": "string", + "description": "Last modification timestamp." + }, + "modified_gmt": { + "type": "string", + "description": "Last modification timestamp in GMT." + }, + "slug": { + "type": "string", + "description": "Pattern slug." + }, + "status": { + "type": "string", + "description": "Always `publish` for this response shape." + }, + "type": { + "type": "string", + "description": "Always `wp_block`." + }, + "link": { + "type": "string", + "description": "Pattern link. Currently empty." + }, + "title": { + "type": "object", + "properties": { + "raw": { + "type": "string", + "description": "Raw pattern title." + } + } + }, + "content": { + "type": "object", + "properties": { + "raw": { + "type": "string", + "description": "Raw block content." + }, + "protected": { + "type": "boolean", + "description": "Whether the content is protected." + } + } + }, + "meta": { + "type": "object", + "description": "WordPress block metadata object." + }, + "wp_pattern_sync_status": { + "type": "string", + "description": "Pattern sync status." + }, + "wp_pattern_category": { + "type": "array", + "description": "Resolved WordPress-style category IDs.", + "items": { + "type": "integer" + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/list-email-patterns.json b/src/public/openapi/email-patterns/list-email-patterns.json new file mode 100644 index 0000000..3ff7a03 --- /dev/null +++ b/src/public/openapi/email-patterns/list-email-patterns.json @@ -0,0 +1,196 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns": { + "get": { + "operationId": "listEmailPatterns", + "summary": "GET List Email Patterns", + "description": "Retrieve paginated reusable email patterns stored in FluentCRM. Supports simple text search against the underlying pattern value payload and returns normalized pattern objects.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "search", + "in": "query", + "description": "Search term applied against the stored pattern value payload.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "per_page", + "in": "query", + "description": "Number of patterns per page.", + "required": false, + "schema": { + "type": "integer", + "default": 15 + } + }, + { + "name": "page", + "in": "query", + "description": "Page number for pagination.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Paginated list of email patterns.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "patterns": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmailPattern" + } + }, + "total": { + "type": "integer", + "description": "Total number of patterns matching the query." + } + } + } + } + }, + "example": { + "patterns": { + "data": [ + { + "id": 12, + "slug": "fluentcrm/welcome-pattern-12", + "title": "Welcome Pattern", + "content": "Welcome to our newsletter.
", + "category": "Onboarding", + "description": "Reusable onboarding email block.", + "sync_status": "unsynced", + "created_at": "2026-04-20 09:15:00", + "updated_at": "2026-04-21 11:30:00" + } + ], + "total": 1 + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + }, + "EmailPattern": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Pattern ID." + }, + "slug": { + "type": "string", + "description": "Generated pattern slug." + }, + "title": { + "type": "string", + "description": "Pattern title." + }, + "content": { + "type": "string", + "description": "Pattern content HTML or block markup." + }, + "category": { + "type": "string", + "description": "Assigned category name." + }, + "description": { + "type": "string", + "description": "Pattern description." + }, + "sync_status": { + "type": "string", + "description": "Pattern sync status.", + "default": "unsynced" + }, + "created_at": { + "type": "string", + "description": "Pattern creation timestamp." + }, + "updated_at": { + "type": "string", + "description": "Pattern update timestamp." + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/email-patterns/update-email-pattern.json b/src/public/openapi/email-patterns/update-email-pattern.json new file mode 100644 index 0000000..7fd909b --- /dev/null +++ b/src/public/openapi/email-patterns/update-email-pattern.json @@ -0,0 +1,256 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/email-patterns/{id}": { + "put": { + "operationId": "updateEmailPattern", + "summary": "PUT Update Email Pattern", + "description": "Update an existing reusable email pattern. Supports both the standard pattern fields and the WordPress editor-style fields used by the block editor middleware.", + "tags": [ + "Email Patterns" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "The email pattern ID.", + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "raw": { + "type": "string" + } + } + } + ], + "description": "Updated pattern title. Supports plain string or editor-style `{ raw }` object." + }, + "content": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "raw": { + "type": "string" + } + } + } + ], + "description": "Updated pattern content. Supports plain string or editor-style `{ raw }` object." + }, + "category": { + "type": "string", + "description": "Category name." + }, + "wp_pattern_category": { + "type": "array", + "description": "WordPress-style category IDs. When present, overrides the plain `category` field.", + "items": { + "type": "integer" + } + }, + "description": { + "type": "string", + "description": "Pattern description." + }, + "sync_status": { + "type": "string", + "description": "Pattern sync status." + }, + "meta": { + "type": "object", + "description": "WordPress editor metadata.", + "properties": { + "wp_pattern_sync_status": { + "type": "string", + "description": "Sync status override from the block editor middleware." + } + } + } + } + }, + "example": { + "title": "Updated Welcome Pattern", + "content": "Updated welcome message.
", + "category": "Onboarding", + "description": "Updated reusable onboarding block.", + "sync_status": "unsynced" + } + } + } + }, + "responses": { + "200": { + "description": "Email pattern updated successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "pattern": { + "$ref": "#/components/schemas/EmailPattern" + } + } + }, + "example": { + "message": "Pattern updated successfully", + "pattern": { + "id": 12, + "slug": "fluentcrm/updated-welcome-pattern-12", + "title": "Updated Welcome Pattern", + "content": "Updated welcome message.
", + "category": "Onboarding", + "description": "Updated reusable onboarding block.", + "sync_status": "unsynced", + "created_at": "2026-04-20 09:15:00", + "updated_at": "2026-04-28 16:05:00" + } + } + } + } + }, + "404": { + "description": "Email pattern not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "message": "No query results for model" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + }, + "EmailPattern": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Pattern ID." + }, + "slug": { + "type": "string", + "description": "Generated pattern slug." + }, + "title": { + "type": "string", + "description": "Pattern title." + }, + "content": { + "type": "string", + "description": "Pattern content HTML or block markup." + }, + "category": { + "type": "string", + "description": "Assigned category name." + }, + "description": { + "type": "string", + "description": "Pattern description." + }, + "sync_status": { + "type": "string", + "description": "Pattern sync status.", + "default": "unsynced" + }, + "created_at": { + "type": "string", + "description": "Pattern creation timestamp." + }, + "updated_at": { + "type": "string", + "description": "Pattern update timestamp." + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/public-bounce/handle-bounce-with-handle.json b/src/public/openapi/public-bounce/handle-bounce-with-handle.json index 4735dca..d19cbc3 100644 --- a/src/public/openapi/public-bounce/handle-bounce-with-handle.json +++ b/src/public/openapi/public-bounce/handle-bounce-with-handle.json @@ -26,8 +26,8 @@ "/public/bounce_handler/{service_name}/handle/{security_code}": { "post": { "operationId": "handleBounceWithHandle", - "summary": "POST Handle Bounce (with /handle/ path)", - "description": "Webhook endpoint for email service providers to report bounces, complaints, and unsubscribes. This is the variant with `/handle/` in the path. Accepts any HTTP method. Validates the security code and processes the bounce event for supported services. Custom services can be handled via the `fluent_crm_handle_bounce_{service_name}` filter.", + "summary": "Handle Bounce (with /handle/ path)", + "description": "Webhook endpoint for email service providers to report bounces, complaints, and unsubscribes. This is the variant with `/handle/` in the path. The FluentCRM router registers this route as `ANY`; it is represented as `POST` here because OpenAPI requires a concrete operation method. Validates the security code and processes the bounce event for built-in services. Custom services can be handled via the `fluent_crm_handle_bounce_{service_name}` filter.", "tags": [ "Public" ], @@ -36,22 +36,10 @@ { "name": "service_name", "in": "path", - "description": "Email service provider name.", + "description": "Email service provider name. Built-in handlers include `mailgun`, `pepipost`, `postmark`, `sendgrid`, `sparkpost`, `elasticemail`, `postalserver`, `smtp2go`, `brevo`, and `tosend`. Custom provider slugs are also allowed and can be handled with the `fluent_crm_handle_bounce_{service_name}` filter.", "required": true, "schema": { - "type": "string", - "enum": [ - "mailgun", - "pepipost", - "postmark", - "sendgrid", - "sparkpost", - "elasticemail", - "postalserver", - "smtp2go", - "brevo", - "tosend" - ] + "type": "string" } }, { @@ -79,42 +67,35 @@ }, "responses": { "200": { - "description": "Bounce processed successfully.", + "description": "Bounce request processed. The controller returns a success payload for valid requests, and also returns an error-shaped JSON body when the security code is invalid.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BounceResponse" - }, - "example": { - "success": 1, - "message": "recorded", - "service": "mailgun", - "result": "bounced", - "time": 1709312400 - } - } - } - }, - "401": { - "description": "Invalid security code.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "boolean", - "description": "Always false on authentication failure." + "oneOf": [ + { + "$ref": "#/components/schemas/BounceResponse" }, - "message": { - "type": "string", - "description": "Error message." + { + "$ref": "#/components/schemas/BounceErrorResponse" } - } + ] }, - "example": { - "status": false, - "message": "Invalid Data or Security Code" + "examples": { + "success": { + "value": { + "success": 1, + "message": "recorded", + "service": "mailgun", + "result": "bounced", + "time": 1709312400 + } + }, + "invalidSecurityCode": { + "value": { + "status": false, + "message": "Invalid Data or Security Code" + } + } } } } @@ -175,6 +156,23 @@ "description": "Unix timestamp when the bounce was processed." } } + }, + "BounceErrorResponse": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "False when the security code is invalid." + }, + "message": { + "type": "string", + "description": "Error message returned by the bounce controller." + } + }, + "required": [ + "status", + "message" + ] } }, "securitySchemes": { @@ -186,4 +184,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/public/openapi/public-bounce/handle-bounce.json b/src/public/openapi/public-bounce/handle-bounce.json index 56e9892..e862cc1 100644 --- a/src/public/openapi/public-bounce/handle-bounce.json +++ b/src/public/openapi/public-bounce/handle-bounce.json @@ -26,8 +26,8 @@ "/public/bounce_handler/{service_name}/{security_code}": { "post": { "operationId": "handleBounce", - "summary": "POST Handle Bounce", - "description": "Webhook endpoint for email service providers to report bounces, complaints, and unsubscribes. This is the shorter path variant without `/handle/`. Accepts any HTTP method. Validates the security code and processes the bounce event for supported services. Custom services can be handled via the `fluent_crm_handle_bounce_{service_name}` filter.", + "summary": "Handle Bounce", + "description": "Webhook endpoint for email service providers to report bounces, complaints, and unsubscribes. This is the shorter path variant without `/handle/`. The FluentCRM router registers this route as `ANY`; it is represented as `POST` here because OpenAPI requires a concrete operation method. Validates the security code and processes the bounce event for built-in services. Custom services can be handled via the `fluent_crm_handle_bounce_{service_name}` filter.", "tags": [ "Public" ], @@ -36,22 +36,10 @@ { "name": "service_name", "in": "path", - "description": "Email service provider name.", + "description": "Email service provider name. Built-in handlers include `mailgun`, `pepipost`, `postmark`, `sendgrid`, `sparkpost`, `elasticemail`, `postalserver`, `smtp2go`, `brevo`, and `tosend`. Custom provider slugs are also allowed and can be handled with the `fluent_crm_handle_bounce_{service_name}` filter.", "required": true, "schema": { - "type": "string", - "enum": [ - "mailgun", - "pepipost", - "postmark", - "sendgrid", - "sparkpost", - "elasticemail", - "postalserver", - "smtp2go", - "brevo", - "tosend" - ] + "type": "string" } }, { @@ -79,42 +67,35 @@ }, "responses": { "200": { - "description": "Bounce processed successfully.", + "description": "Bounce request processed. The controller returns a success payload for valid requests, and also returns an error-shaped JSON body when the security code is invalid.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BounceResponse" - }, - "example": { - "success": 1, - "message": "recorded", - "service": "sendgrid", - "result": "bounced", - "time": 1709312400 - } - } - } - }, - "401": { - "description": "Invalid security code.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "boolean", - "description": "Always false on authentication failure." + "oneOf": [ + { + "$ref": "#/components/schemas/BounceResponse" }, - "message": { - "type": "string", - "description": "Error message." + { + "$ref": "#/components/schemas/BounceErrorResponse" } - } + ] }, - "example": { - "status": false, - "message": "Invalid Data or Security Code" + "examples": { + "success": { + "value": { + "success": 1, + "message": "recorded", + "service": "sendgrid", + "result": "bounced", + "time": 1709312400 + } + }, + "invalidSecurityCode": { + "value": { + "status": false, + "message": "Invalid Data or Security Code" + } + } } } } @@ -175,6 +156,23 @@ "description": "Unix timestamp when the bounce was processed." } } + }, + "BounceErrorResponse": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "False when the security code is invalid." + }, + "message": { + "type": "string", + "description": "Error message returned by the bounce controller." + } + }, + "required": [ + "status", + "message" + ] } }, "securitySchemes": { @@ -186,4 +184,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/public/openapi/reports/get-automation-reports.json b/src/public/openapi/reports/get-automation-reports.json new file mode 100644 index 0000000..a5da5bf --- /dev/null +++ b/src/public/openapi/reports/get-automation-reports.json @@ -0,0 +1,359 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/automations": { + "get": { + "operationId": "getAutomationReports", + "summary": "GET Automation Reports", + "description": "Retrieve paginated published automation funnels with aggregate subscriber counts, execution progress totals, recent subscriber entries, and a top-triggered automations summary.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "per_page", + "in": "query", + "description": "Number of automation records to return per page.", + "required": false, + "schema": { + "type": "integer", + "default": 15 + } + }, + { + "name": "page", + "in": "query", + "description": "Page number for pagination.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Automation reports retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "automations": { + "type": "object", + "description": "Paginated published automation funnels.", + "properties": { + "current_page": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "published" + ] + }, + "trigger_name": { + "type": [ + "string", + "null" + ] + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "total_subscribers": { + "type": "integer" + }, + "completed_count": { + "type": "integer" + }, + "in_progress_count": { + "type": "integer" + }, + "last_run_at": { + "type": [ + "string", + "null" + ], + "format": "date-time" + }, + "recent_subscribers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "avatar": { + "type": [ + "string", + "null" + ] + }, + "entered_at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "name", + "email", + "entered_at" + ] + } + } + }, + "required": [ + "id", + "title", + "status", + "total_subscribers", + "completed_count", + "in_progress_count", + "recent_subscribers" + ] + } + }, + "from": { + "type": [ + "integer", + "null" + ] + }, + "last_page": { + "type": "integer" + }, + "next_page_url": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "per_page": { + "type": "integer" + }, + "prev_page_url": { + "type": [ + "string", + "null" + ] + }, + "to": { + "type": [ + "integer", + "null" + ] + }, + "total": { + "type": "integer" + } + }, + "required": [ + "current_page", + "data", + "last_page", + "per_page", + "total" + ] + }, + "overview": { + "type": "object", + "description": "Aggregate automation report totals.", + "properties": { + "total": { + "type": "integer" + }, + "subscribers": { + "type": "integer" + }, + "completed": { + "type": "integer" + }, + "in_progress": { + "type": "integer" + } + }, + "required": [ + "total", + "subscribers", + "completed", + "in_progress" + ] + }, + "top_automations": { + "type": "array", + "description": "Top 5 published automations ranked by trigger count.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "trigger_name": { + "type": [ + "string", + "null" + ] + }, + "trigger_count": { + "type": "integer" + } + }, + "required": [ + "id", + "title", + "trigger_count" + ] + } + } + }, + "required": [ + "automations", + "overview", + "top_automations" + ] + }, + "example": { + "automations": { + "current_page": 1, + "data": [ + { + "id": 7, + "title": "Welcome Funnel", + "status": "published", + "trigger_name": "List Applied", + "created_at": "2026-03-01 09:00:00", + "total_subscribers": 420, + "completed_count": 280, + "in_progress_count": 95, + "last_run_at": "2026-04-28 08:20:00", + "recent_subscribers": [ + { + "id": 12, + "name": "Jane Doe", + "email": "jane@example.com", + "avatar": null, + "entered_at": "2026-04-28 08:20:00" + } + ] + } + ], + "from": 1, + "last_page": 1, + "next_page_url": null, + "path": "https://yourdomain.com/wp-json/fluent-crm/v2/reports/automations", + "per_page": 15, + "prev_page_url": null, + "to": 1, + "total": 1 + }, + "overview": { + "total": 8, + "subscribers": 1640, + "completed": 950, + "in_progress": 311 + }, + "top_automations": [ + { + "id": 7, + "title": "Welcome Funnel", + "trigger_name": "List Applied", + "trigger_count": 420 + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-automation-step-report.json b/src/public/openapi/reports/get-automation-step-report.json new file mode 100644 index 0000000..e53361b --- /dev/null +++ b/src/public/openapi/reports/get-automation-step-report.json @@ -0,0 +1,251 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/automations/{id}/steps": { + "get": { + "operationId": "getAutomationStepReport", + "summary": "GET Automation Step Report", + "description": "Retrieve a published automation funnel and its step-by-step performance metrics, including counts, drop-offs, and revenue data for email steps.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Automation funnel ID.", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Automation step report retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "funnel": { + "type": "object", + "description": "Automation funnel record.", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "status": { + "type": "string" + }, + "trigger_name": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "title" + ] + }, + "stats": { + "type": "object", + "description": "Step-by-step performance metrics for the funnel.", + "properties": { + "metrics": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "count": { + "type": "integer" + }, + "sequence_id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "percent": { + "type": "integer" + }, + "percent_text": { + "type": "integer" + }, + "previous_step_count": { + "type": "integer" + }, + "drop_count": { + "type": "integer" + }, + "drop_percent": { + "type": "integer" + }, + "revenues": { + "type": "array", + "items": { + "type": "string" + } + }, + "link_clicks": { + "type": "integer" + }, + "email_opens": { + "type": "integer" + } + }, + "required": [ + "label", + "count", + "sequence_id", + "type", + "percent", + "percent_text", + "previous_step_count", + "drop_count", + "drop_percent" + ] + } + }, + "total_revenue": { + "type": "number" + }, + "total_revenue_formatted": { + "type": "string" + }, + "revenue_currency": { + "type": "string" + } + }, + "required": [ + "metrics", + "total_revenue", + "total_revenue_formatted", + "revenue_currency" + ] + } + }, + "required": [ + "funnel", + "stats" + ] + }, + "example": { + "funnel": { + "id": 7, + "title": "Welcome Funnel", + "status": "published", + "trigger_name": "List Applied" + }, + "stats": { + "metrics": [ + { + "label": "Entrance", + "count": 420, + "sequence_id": 0, + "type": "root", + "percent": 100, + "percent_text": 100, + "previous_step_count": 420, + "drop_count": 0, + "drop_percent": 0 + }, + { + "label": "Send Welcome Email", + "count": 390, + "sequence_id": 22, + "type": "email", + "percent": 93, + "percent_text": 93, + "previous_step_count": 420, + "drop_count": 30, + "drop_percent": 7, + "revenues": [ + "USD 240.00" + ], + "link_clicks": 118, + "email_opens": 260 + } + ], + "total_revenue": 240, + "total_revenue_formatted": "240.00", + "revenue_currency": "USD" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-campaign-options.json b/src/public/openapi/reports/get-campaign-options.json new file mode 100644 index 0000000..3c34b18 --- /dev/null +++ b/src/public/openapi/reports/get-campaign-options.json @@ -0,0 +1,147 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/campaign-options": { + "get": { + "operationId": "getCampaignOptions", + "summary": "GET Campaign Options", + "description": "Retrieve archived campaign options for selectors and filters. Supports optional title search and result limiting.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "search", + "in": "query", + "description": "Search archived campaigns by title.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "per_page", + "in": "query", + "description": "Maximum number of campaign options to return.", + "required": false, + "schema": { + "type": "integer", + "default": 50 + } + } + ], + "responses": { + "200": { + "description": "Campaign options retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "options": { + "type": "array", + "description": "Archived campaign option list.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Campaign ID." + }, + "title": { + "type": "string", + "description": "Campaign title." + } + }, + "required": [ + "id", + "title" + ] + } + } + }, + "required": [ + "options" + ] + }, + "example": { + "options": [ + { + "id": 14, + "title": "Spring Promotion" + }, + { + "id": 11, + "title": "Welcome Series Wrap-up" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-campaigns-list.json b/src/public/openapi/reports/get-campaigns-list.json new file mode 100644 index 0000000..660e067 --- /dev/null +++ b/src/public/openapi/reports/get-campaigns-list.json @@ -0,0 +1,268 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/campaigns-list": { + "get": { + "operationId": "getCampaignsList", + "summary": "GET Campaigns List", + "description": "Retrieve a paginated list of archived campaigns ordered by last update time. Each campaign in the response includes a computed `stats` object.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "per_page", + "in": "query", + "description": "Number of archived campaigns to return per page.", + "required": false, + "schema": { + "type": "integer", + "default": 15 + } + }, + { + "name": "page", + "in": "query", + "description": "Page number for pagination.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Archived campaigns retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "campaigns": { + "type": "object", + "description": "Paginated archived campaign results.", + "properties": { + "current_page": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "archived" + ] + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "stats": { + "type": "object", + "description": "Computed email performance summary for the campaign.", + "properties": { + "total": { + "type": "integer" + }, + "sent": { + "type": "integer" + }, + "clicks": { + "type": "integer" + }, + "views": { + "type": "integer" + }, + "unsubscribers": { + "type": "integer" + }, + "revenue": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "total": { + "type": "string" + }, + "currency": { + "type": "string" + } + } + } + }, + "required": [ + "total", + "sent", + "clicks", + "views", + "unsubscribers" + ] + } + }, + "required": [ + "id", + "title", + "status", + "updated_at", + "stats" + ] + } + }, + "from": { + "type": [ + "integer", + "null" + ] + }, + "last_page": { + "type": "integer" + }, + "next_page_url": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "per_page": { + "type": "integer" + }, + "prev_page_url": { + "type": [ + "string", + "null" + ] + }, + "to": { + "type": [ + "integer", + "null" + ] + }, + "total": { + "type": "integer" + } + }, + "required": [ + "current_page", + "data", + "last_page", + "per_page", + "total" + ] + } + }, + "required": [ + "campaigns" + ] + }, + "example": { + "campaigns": { + "current_page": 1, + "data": [ + { + "id": 14, + "title": "Spring Promotion", + "status": "archived", + "updated_at": "2026-04-18 14:12:00", + "stats": { + "total": 1200, + "sent": 1187, + "clicks": 214, + "views": 603, + "unsubscribers": 9 + } + } + ], + "from": 1, + "last_page": 2, + "next_page_url": "https://yourdomain.com/wp-json/fluent-crm/v2/reports/campaigns-list?page=2", + "path": "https://yourdomain.com/wp-json/fluent-crm/v2/reports/campaigns-list", + "per_page": 15, + "prev_page_url": null, + "to": 15, + "total": 19 + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-contacts-by-country.json b/src/public/openapi/reports/get-contacts-by-country.json new file mode 100644 index 0000000..92a063e --- /dev/null +++ b/src/public/openapi/reports/get-contacts-by-country.json @@ -0,0 +1,130 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/contacts-by-country": { + "get": { + "operationId": "getContactsByCountry", + "summary": "GET Contacts by Country", + "description": "Retrieve contact totals grouped by normalized uppercase country code.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "responses": { + "200": { + "description": "Contact counts by country retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "countries": { + "type": "array", + "description": "Contact totals grouped by country code.", + "items": { + "type": "object", + "properties": { + "country_code": { + "type": "string", + "description": "Uppercase ISO-like country code stored on the contact." + }, + "contact_count": { + "type": "integer", + "description": "Number of contacts in that country." + } + }, + "required": [ + "country_code", + "contact_count" + ] + } + } + }, + "required": [ + "countries" + ] + }, + "example": { + "countries": [ + { + "country_code": "US", + "contact_count": 320 + }, + { + "country_code": "BD", + "contact_count": 87 + }, + { + "country_code": "GB", + "contact_count": 42 + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-contacts-by-lists.json b/src/public/openapi/reports/get-contacts-by-lists.json new file mode 100644 index 0000000..6c621b1 --- /dev/null +++ b/src/public/openapi/reports/get-contacts-by-lists.json @@ -0,0 +1,217 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/contacts-by-lists": { + "get": { + "operationId": "getContactsByLists", + "summary": "GET Contacts by Lists", + "description": "Retrieve a paginated list of mailing lists with the number of contacts assigned to each list, sorted by contact count descending.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "per_page", + "in": "query", + "description": "Number of list rows to return per page.", + "required": false, + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "name": "page", + "in": "query", + "description": "Page number for pagination.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "List contact counts retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "lists": { + "type": "object", + "description": "Paginated list results.", + "properties": { + "current_page": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "List ID." + }, + "title": { + "type": "string", + "description": "List title." + }, + "contact_count": { + "type": "integer", + "description": "Number of contacts assigned to the list." + } + }, + "required": [ + "id", + "title", + "contact_count" + ] + } + }, + "from": { + "type": [ + "integer", + "null" + ] + }, + "last_page": { + "type": "integer" + }, + "next_page_url": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "per_page": { + "type": "integer" + }, + "prev_page_url": { + "type": [ + "string", + "null" + ] + }, + "to": { + "type": [ + "integer", + "null" + ] + }, + "total": { + "type": "integer" + } + }, + "required": [ + "current_page", + "data", + "last_page", + "per_page", + "total" + ] + } + }, + "required": [ + "lists" + ] + }, + "example": { + "lists": { + "current_page": 1, + "data": [ + { + "id": 2, + "title": "Customers", + "contact_count": 312 + }, + { + "id": 5, + "title": "Product Updates", + "contact_count": 146 + } + ], + "from": 1, + "last_page": 2, + "next_page_url": "https://yourdomain.com/wp-json/fluent-crm/v2/reports/contacts-by-lists?page=2", + "path": "https://yourdomain.com/wp-json/fluent-crm/v2/reports/contacts-by-lists", + "per_page": 20, + "prev_page_url": null, + "to": 20, + "total": 27 + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-contacts-by-status.json b/src/public/openapi/reports/get-contacts-by-status.json new file mode 100644 index 0000000..6ddfd92 --- /dev/null +++ b/src/public/openapi/reports/get-contacts-by-status.json @@ -0,0 +1,136 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/contacts-by-status": { + "get": { + "operationId": "getContactsByStatus", + "summary": "GET Contacts by Status", + "description": "Retrieve total contact counts grouped by subscriber status.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "responses": { + "200": { + "description": "Contact counts by status retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "stats": { + "type": "array", + "description": "Subscriber totals grouped by status.", + "items": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Subscriber status slug." + }, + "count": { + "type": "integer", + "description": "Number of contacts in that status." + } + }, + "required": [ + "status", + "count" + ] + } + }, + "total": { + "type": "integer", + "description": "Total number of contacts across all statuses." + } + }, + "required": [ + "stats", + "total" + ] + }, + "example": { + "stats": [ + { + "status": "subscribed", + "count": 1200 + }, + { + "status": "pending", + "count": 35 + }, + { + "status": "unsubscribed", + "count": 18 + } + ], + "total": 1253 + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-contacts-by-tags.json b/src/public/openapi/reports/get-contacts-by-tags.json new file mode 100644 index 0000000..0ea324f --- /dev/null +++ b/src/public/openapi/reports/get-contacts-by-tags.json @@ -0,0 +1,217 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/contacts-by-tags": { + "get": { + "operationId": "getContactsByTags", + "summary": "GET Contacts by Tags", + "description": "Retrieve a paginated list of tags with the number of contacts assigned to each tag, sorted by contact count descending.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "per_page", + "in": "query", + "description": "Number of tag rows to return per page.", + "required": false, + "schema": { + "type": "integer", + "default": 20 + } + }, + { + "name": "page", + "in": "query", + "description": "Page number for pagination.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "Tag contact counts retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tags": { + "type": "object", + "description": "Paginated tag results.", + "properties": { + "current_page": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Tag ID." + }, + "title": { + "type": "string", + "description": "Tag title." + }, + "contact_count": { + "type": "integer", + "description": "Number of contacts assigned to the tag." + } + }, + "required": [ + "id", + "title", + "contact_count" + ] + } + }, + "from": { + "type": [ + "integer", + "null" + ] + }, + "last_page": { + "type": "integer" + }, + "next_page_url": { + "type": [ + "string", + "null" + ] + }, + "path": { + "type": "string" + }, + "per_page": { + "type": "integer" + }, + "prev_page_url": { + "type": [ + "string", + "null" + ] + }, + "to": { + "type": [ + "integer", + "null" + ] + }, + "total": { + "type": "integer" + } + }, + "required": [ + "current_page", + "data", + "last_page", + "per_page", + "total" + ] + } + }, + "required": [ + "tags" + ] + }, + "example": { + "tags": { + "current_page": 1, + "data": [ + { + "id": 3, + "title": "VIP", + "contact_count": 245 + }, + { + "id": 7, + "title": "Newsletter", + "contact_count": 188 + } + ], + "from": 1, + "last_page": 3, + "next_page_url": "https://yourdomain.com/wp-json/fluent-crm/v2/reports/contacts-by-tags?page=2", + "path": "https://yourdomain.com/wp-json/fluent-crm/v2/reports/contacts-by-tags", + "per_page": 20, + "prev_page_url": null, + "to": 20, + "total": 42 + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-email-unsub-stats.json b/src/public/openapi/reports/get-email-unsub-stats.json new file mode 100644 index 0000000..43ed5a5 --- /dev/null +++ b/src/public/openapi/reports/get-email-unsub-stats.json @@ -0,0 +1,123 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/email-unsubs": { + "get": { + "operationId": "getEmailUnsubStats", + "summary": "GET Email Unsubscribe Stats", + "description": "Retrieve email unsubscribe statistics over a date range. Returns a date-keyed object where each key is a date (or month label) and the value is the count of unsubscribes recorded on that date. The frequency is automatically determined by the length of the date range.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "date_range", + "in": "query", + "description": "Date range as a two-element array `[from, to]` in `YYYY-MM-DD` format. Defaults to the last 30 days if omitted.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "date" + }, + "minItems": 2, + "maxItems": 2 + }, + "style": "form", + "explode": true + } + ], + "responses": { + "200": { + "description": "Email unsubscribe stats retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "stats": { + "type": "object", + "description": "Date-keyed object. Keys are `YYYY-MM-DD` (daily/weekly) or `Mon YYYY` (monthly). Values are unsubscribe counts.", + "additionalProperties": { + "type": "integer" + } + } + } + }, + "example": { + "stats": { + "2026-04-01": 3, + "2026-04-02": 1, + "2026-04-03": 4 + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-recent-tags.json b/src/public/openapi/reports/get-recent-tags.json new file mode 100644 index 0000000..705fe8d --- /dev/null +++ b/src/public/openapi/reports/get-recent-tags.json @@ -0,0 +1,153 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/recent-tags": { + "get": { + "operationId": "getRecentTags", + "summary": "GET Recent Tags", + "description": "Retrieve the most recently created tags along with how many contacts are assigned to each tag.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "per_page", + "in": "query", + "description": "Maximum number of recent tags to return.", + "required": false, + "schema": { + "type": "integer", + "default": 5 + } + } + ], + "responses": { + "200": { + "description": "Recent tags retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tags": { + "type": "array", + "description": "Most recently created tags.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Tag ID." + }, + "title": { + "type": "string", + "description": "Tag title." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Tag creation timestamp." + }, + "contact_count": { + "type": "integer", + "description": "Number of contacts assigned to the tag." + } + }, + "required": [ + "id", + "title", + "created_at", + "contact_count" + ] + } + } + }, + "required": [ + "tags" + ] + }, + "example": { + "tags": [ + { + "id": 21, + "title": "New Leads", + "created_at": "2026-04-20 11:32:00", + "contact_count": 43 + }, + { + "id": 20, + "title": "Webinar April", + "created_at": "2026-04-18 09:10:00", + "contact_count": 112 + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/reports/get-top-campaigns.json b/src/public/openapi/reports/get-top-campaigns.json new file mode 100644 index 0000000..9f79081 --- /dev/null +++ b/src/public/openapi/reports/get-top-campaigns.json @@ -0,0 +1,184 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/reports/top-campaigns": { + "get": { + "operationId": "getTopCampaigns", + "summary": "GET Top Campaigns", + "description": "Retrieve the top archived campaigns ranked by `open_rate`, `click_rate`, or `total_sent`. Requires FluentCampaign Pro.", + "tags": [ + "Reports" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "sort_by", + "in": "query", + "description": "Ranking metric. Any unsupported value falls back to `open_rate`.", + "required": false, + "schema": { + "type": "string", + "default": "open_rate", + "enum": [ + "open_rate", + "click_rate", + "total_sent" + ] + } + }, + { + "name": "per_page", + "in": "query", + "description": "Maximum number of top campaigns to return.", + "required": false, + "schema": { + "type": "integer", + "default": 10 + } + } + ], + "responses": { + "200": { + "description": "Top campaign report retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "campaigns": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "total_sent": { + "type": "integer", + "description": "Total number of sent emails counted for the campaign." + }, + "open_rate": { + "type": "number", + "description": "Open rate percentage." + }, + "click_rate": { + "type": "number", + "description": "Click rate percentage." + } + }, + "required": [ + "id", + "title", + "updated_at", + "total_sent", + "open_rate", + "click_rate" + ] + } + }, + "available": { + "type": "boolean", + "description": "Always `true` when the Pro report is available." + } + }, + "required": [ + "campaigns", + "available" + ] + }, + "example": { + "campaigns": [ + { + "id": 14, + "title": "Spring Promotion", + "updated_at": "2026-04-18 14:12:00", + "total_sent": 1187, + "open_rate": 54.43, + "click_rate": 18.03 + }, + { + "id": 11, + "title": "Welcome Series Wrap-up", + "updated_at": "2026-04-09 11:05:00", + "total_sent": 930, + "open_rate": 48.17, + "click_rate": 15.91 + } + ], + "available": true + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/sequences/update-sequence-email-delay.json b/src/public/openapi/sequences/update-sequence-email-delay.json new file mode 100644 index 0000000..517c421 --- /dev/null +++ b/src/public/openapi/sequences/update-sequence-email-delay.json @@ -0,0 +1,206 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/sequences/{id}/email/{email_id}/delay": { + "patch": { + "operationId": "updateSequenceEmailDelay", + "summary": "PATCH Update Sequence Email Delay", + "description": "Update the wait time for a sequence email. The route accepts top-level `delay` and `delay_unit` values and stores them in `email.settings.timings`. Requires FluentCampaign Pro.", + "tags": [ + "Sequences" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Parent sequence ID.", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "email_id", + "in": "path", + "description": "Sequence email ID.", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "delay": { + "type": "string", + "description": "Delay amount to store in `settings.timings.delay`. The controller sanitizes this as text and defaults to `0` when omitted." + }, + "delay_unit": { + "type": "string", + "description": "Delay unit to store in `settings.timings.delay_unit`. Allowed values in code are `minutes`, `hours`, `days`, `weeks`, and `Months`. Any other value falls back to `days`.", + "enum": [ + "minutes", + "hours", + "days", + "weeks", + "Months" + ] + } + } + }, + "example": { + "delay": "3", + "delay_unit": "days" + } + } + } + }, + "responses": { + "200": { + "description": "Sequence email delay updated successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "email": { + "$ref": "#/components/schemas/SequenceEmail" + } + }, + "required": [ + "message", + "email" + ] + }, + "example": { + "message": "Wait time has been updated", + "email": { + "id": 12, + "parent_id": 4, + "email_subject": "Day 3 Follow-up", + "settings": { + "timings": { + "delay": "3", + "delay_unit": "days" + } + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SequenceEmail": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "parent_id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "email_subject": { + "type": "string" + }, + "email_pre_header": { + "type": "string" + }, + "email_body": { + "type": "string" + }, + "design_template": { + "type": "string" + }, + "template_id": { + "type": "integer" + }, + "settings": { + "type": "object", + "additionalProperties": true + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/sms/un-schedule-sms-campaign.json b/src/public/openapi/sms/un-schedule-sms-campaign.json new file mode 100644 index 0000000..36e3148 --- /dev/null +++ b/src/public/openapi/sms/un-schedule-sms-campaign.json @@ -0,0 +1,116 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/sms/campaigns/{id}/un-schedule": { + "post": { + "operationId": "unScheduleSmsCampaignLegacy", + "summary": "POST Un-schedule SMS Campaign", + "description": "Legacy alias for unscheduling a previously scheduled SMS campaign. This route calls the same controller action as `POST /sms/campaigns/{id}/unschedule`, reverting the campaign to `draft` status and deleting generated SMS messages. **PRO** (requires FluentCampaign Pro SMS module).", + "tags": [ + "SMS" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "SMS campaign ID.", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Campaign unscheduled successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + }, + "example": { + "message": "SMS Campaign has been successfully un-scheduled" + } + } + } + }, + "404": { + "description": "Campaign not found." + }, + "422": { + "description": "Campaign is not in a valid state for unscheduling." + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/subscribers-export/get-subscribers-export-page.json b/src/public/openapi/subscribers-export/get-subscribers-export-page.json new file mode 100644 index 0000000..8ab1274 --- /dev/null +++ b/src/public/openapi/subscribers-export/get-subscribers-export-page.json @@ -0,0 +1,362 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/subscribers-export": { + "get": { + "operationId": "getSubscribersExportPage", + "summary": "GET Subscribers Export Page", + "description": "Retrieve one page of export-ready subscriber rows. This legacy `GET` route is kept for backward compatibility, but `POST /subscribers-export` is preferred because filter payloads can exceed URL limits. Requires FluentCampaign Pro.", + "tags": [ + "Subscribers Export" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "parameters": [ + { + "name": "columns[]", + "in": "query", + "description": "Columns to export. Must be a non-empty array.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "custom_fields[]", + "in": "query", + "description": "Custom field keys to include in the export.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "commerce_columns[]", + "in": "query", + "description": "Commerce-related export columns.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "company_ids[]", + "in": "query", + "description": "Company IDs to filter by.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + { + "name": "page", + "in": "query", + "description": "Export page number. Each page contains up to 500 rows.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "filter_type", + "in": "query", + "description": "Filter mode. Use `simple` for tags/lists/statuses filters or `advanced` for raw filter groups.", + "required": false, + "schema": { + "type": "string", + "default": "simple", + "enum": [ + "simple", + "advanced" + ] + } + }, + { + "name": "search", + "in": "query", + "description": "Search term for subscriber lookup.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sort_by", + "in": "query", + "description": "Sort column.", + "required": false, + "schema": { + "type": "string", + "default": "id" + } + }, + { + "name": "sort_type", + "in": "query", + "description": "Sort direction.", + "required": false, + "schema": { + "type": "string", + "default": "DESC", + "enum": [ + "ASC", + "DESC" + ] + } + }, + { + "name": "has_commerce", + "in": "query", + "description": "Whether to restrict the export to contacts with commerce data.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "contact_ids[]", + "in": "query", + "description": "Specific contact IDs to export.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + { + "name": "advanced_filters", + "in": "query", + "description": "Raw advanced filter groups when `filter_type=advanced`.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "tags[]", + "in": "query", + "description": "Tag filters for simple mode.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + { + "name": "statuses[]", + "in": "query", + "description": "Subscriber statuses for simple mode.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "lists[]", + "in": "query", + "description": "List filters for simple mode.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + { + "name": "limit", + "in": "query", + "description": "Optional user-facing export limit, capped at 100000 rows.", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "offset", + "in": "query", + "description": "Optional starting offset.", + "required": false, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Export page retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "total": { + "type": "integer", + "description": "Total exportable contacts. Returned on page 1." + }, + "headers": { + "type": "array", + "description": "Export column labels. Returned on page 1.", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + } + } + }, + "has_more": { + "type": "boolean" + } + }, + "required": [ + "page", + "rows", + "has_more" + ] + }, + "example": { + "page": 1, + "total": 1225, + "headers": [ + "ID", + "Email", + "First Name", + "Tags" + ], + "rows": [ + [ + 42, + "jane@example.com", + "Jane", + "VIP, Customers" + ], + [ + 43, + "john@example.com", + "John", + "Newsletter" + ] + ], + "has_more": true + } + } + } + }, + "400": { + "description": "Invalid export request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "No contacts matched the export query.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/subscribers-export/post-subscribers-export-page.json b/src/public/openapi/subscribers-export/post-subscribers-export-page.json new file mode 100644 index 0000000..645cb49 --- /dev/null +++ b/src/public/openapi/subscribers-export/post-subscribers-export-page.json @@ -0,0 +1,290 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/subscribers-export": { + "post": { + "operationId": "postSubscribersExportPage", + "summary": "POST Subscribers Export Page", + "description": "Retrieve one page of export-ready subscriber rows using a request body. This is the preferred export endpoint because filter payloads can exceed URL limits. Requires FluentCampaign Pro.", + "tags": [ + "Subscribers Export" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "columns": { + "type": "array", + "description": "Columns to export. Must be a non-empty array.", + "items": { + "type": "string" + } + }, + "custom_fields": { + "type": "array", + "description": "Custom field keys to include in the export.", + "items": { + "type": "string" + } + }, + "commerce_columns": { + "type": "array", + "description": "Commerce-related export columns.", + "items": { + "type": "string" + } + }, + "company_ids": { + "type": "array", + "description": "Company IDs to filter by.", + "items": { + "type": "integer" + } + }, + "page": { + "type": "integer", + "default": 1 + }, + "filter_type": { + "type": "string", + "default": "simple", + "enum": [ + "simple", + "advanced" + ] + }, + "search": { + "type": "string" + }, + "sort_by": { + "type": "string", + "default": "id" + }, + "sort_type": { + "type": "string", + "default": "DESC", + "enum": [ + "ASC", + "DESC" + ] + }, + "has_commerce": { + "type": "boolean" + }, + "contact_ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "advanced_filters": { + "type": "string", + "description": "Raw advanced filter groups when `filter_type=advanced`." + }, + "tags": { + "type": "array", + "items": { + "type": "integer" + } + }, + "statuses": { + "type": "array", + "items": { + "type": "string" + } + }, + "lists": { + "type": "array", + "items": { + "type": "integer" + } + }, + "limit": { + "type": "integer", + "description": "Optional user-facing export limit, capped at 100000 rows." + }, + "offset": { + "type": "integer", + "description": "Optional starting offset." + } + }, + "required": [ + "columns" + ] + }, + "example": { + "columns": [ + "id", + "email", + "first_name", + "tags" + ], + "page": 1, + "filter_type": "simple", + "statuses": [ + "subscribed" + ], + "lists": [ + 3 + ] + } + } + } + }, + "responses": { + "200": { + "description": "Export page retrieved successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "total": { + "type": "integer", + "description": "Total exportable contacts. Returned on page 1." + }, + "headers": { + "type": "array", + "description": "Export column labels. Returned on page 1.", + "items": { + "type": "string" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + } + } + }, + "has_more": { + "type": "boolean" + } + }, + "required": [ + "page", + "rows", + "has_more" + ] + }, + "example": { + "page": 1, + "total": 1225, + "headers": [ + "ID", + "Email", + "First Name", + "Tags" + ], + "rows": [ + [ + 42, + "jane@example.com", + "Jane", + "VIP, Customers" + ] + ], + "has_more": true + } + } + } + }, + "400": { + "description": "Invalid export request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "No contacts matched the export query.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "description": "Error code" + }, + "data": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" + } + } + } + } + } + }, + "securitySchemes": { + "ApplicationPasswords": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password" + } + } + } +} diff --git a/src/public/openapi/templates/get-built-in-template.json b/src/public/openapi/templates/get-built-in-template.json new file mode 100644 index 0000000..bf6a0a8 --- /dev/null +++ b/src/public/openapi/templates/get-built-in-template.json @@ -0,0 +1,250 @@ +{ + "openapi": "3.0.4", + "info": { + "title": "FluentCRM API", + "description": "Complete REST API documentation for FluentCRM — a self-hosted email marketing and CRM plugin for WordPress.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://{website}/wp-json/fluent-crm/v2", + "description": "Your WordPress website", + "variables": { + "website": { + "default": "YourWebsite.com", + "description": "Your WordPress website domain (without https://)" + } + } + } + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "paths": { + "/templates/built-in-template": { + "post": { + "operationId": "getBuiltInTemplate", + "summary": "POST Fetch Built-In Template", + "description": "Download a single built-in template from an allowed remote FluentCRM template URL and return it in FluentCRM's local template payload shape without saving it as a WordPress template.", + "tags": [ + "Templates" + ], + "security": [ + { + "ApplicationPasswords": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "file" + ], + "properties": { + "file": { + "type": "string", + "format": "uri", + "description": "HTTPS URL of the remote built-in template JSON file. Only trusted FluentCRM template hosts are accepted." + } + } + }, + "example": { + "file": "https://fluentcrm.com/wp-content/templates/welcome.json" + } + } + } + }, + "responses": { + "200": { + "description": "Built-in template downloaded and normalized successfully.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "template": { + "$ref": "#/components/schemas/BuiltInTemplatePayload" + } + } + }, + "example": { + "message": "Template has been inserted", + "template": { + "post_title": "Welcome Series - Day 1", + "post_content": "WelcomeHello ##subscriber.first_name## |