{ "swagger": "2.0", "info": { "description": "Go BFF for users, business workflows, and localized Strapi editorial content.", "title": "Aphrodite API", "contact": {}, "version": "0.1.0" }, "basePath": "/", "paths": { "/healthz": { "get": { "produces": [ "application/json" ], "tags": [ "health" ], "summary": "Health check", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.HealthResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/handlers.HealthResponse" } } } } }, "/v1/articles": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "List articles (paginated)", "parameters": [ { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (defaults to CONTENT_DEFAULT_LIMIT, capped by CONTENT_MAX_LIMIT)", "name": "pageSize", "in": "query" }, { "type": "string", "description": "Locale (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "type": "string", "description": "Sort field, e.g. title:asc or createdAt:desc (repeatable)", "name": "sort", "in": "query" }, { "type": "string", "description": "Filter by main category slug", "name": "mainCategory", "in": "query" }, { "type": "string", "description": "Filter by author slug", "name": "author", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ContentListResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Create an article (admin only)", "parameters": [ { "type": "string", "description": "Locale for the new entry (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "description": "Strapi article attributes (name, slug, content, relations)", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/articles/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Update an article (admin or editor)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Locale of the entry to update", "name": "locale", "in": "query" }, { "description": "Strapi article attributes to change", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "content" ], "summary": "Delete an article (admin only)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/articles/{slug}": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Get an article", "parameters": [ { "type": "string", "description": "Article slug", "name": "slug", "in": "path", "required": true }, { "type": "string", "description": "Locale (defaults to configured Persian locale)", "name": "locale", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/categories": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "List categories (paginated)", "parameters": [ { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (defaults to CONTENT_DEFAULT_LIMIT, capped by CONTENT_MAX_LIMIT)", "name": "pageSize", "in": "query" }, { "type": "string", "description": "Locale (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "type": "string", "description": "Sort field, e.g. name:asc (repeatable)", "name": "sort", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ContentListResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Create a category (admin only)", "parameters": [ { "type": "string", "description": "Locale for the new entry (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "description": "Strapi main-category attributes (name, slug, description)", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/categories/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Update a category (admin or editor)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Locale of the entry to update", "name": "locale", "in": "query" }, { "description": "Strapi main-category attributes to change", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "content" ], "summary": "Delete a category (admin only)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/categories/{slug}": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Get a category", "parameters": [ { "type": "string", "description": "Category slug", "name": "slug", "in": "path", "required": true }, { "type": "string", "description": "Locale", "name": "locale", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/comments/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "comments" ], "summary": "Update a comment (author or admin)", "parameters": [ { "type": "string", "description": "Comment UUID", "name": "id", "in": "path", "required": true }, { "description": "Comment payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.UpdateCommentRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.CommentResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "comments" ], "summary": "Delete a comment (author or admin)", "parameters": [ { "type": "string", "description": "Comment UUID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } } } } }, "/v1/newsletters": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "List newsletters (paginated)", "parameters": [ { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (defaults to CONTENT_DEFAULT_LIMIT, capped by CONTENT_MAX_LIMIT)", "name": "pageSize", "in": "query" }, { "type": "string", "description": "Locale (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "type": "string", "description": "Sort field, e.g. subject:asc (repeatable)", "name": "sort", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ContentListResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Create a newsletter (admin only)", "parameters": [ { "type": "string", "description": "Locale for the new entry (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "description": "Strapi newsletter attributes (subject, body, heroImage)", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/newsletters/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Update a newsletter (admin or editor)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Locale of the entry to update", "name": "locale", "in": "query" }, { "description": "Strapi newsletter attributes to change", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "content" ], "summary": "Delete a newsletter (admin only)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/newsletters/{slug}": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Get a newsletter", "parameters": [ { "type": "string", "description": "Newsletter slug", "name": "slug", "in": "path", "required": true }, { "type": "string", "description": "Locale", "name": "locale", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/posts": { "get": { "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "List posts (paginated)", "parameters": [ { "type": "integer", "description": "Page size (defaults to POST_DEFAULT_LIMIT, capped by POST_MAX_LIMIT)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.PostListResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Create a post", "parameters": [ { "description": "Post payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.CreatePostRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/http.PostResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } } } } }, "/v1/posts/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Get a post", "parameters": [ { "type": "string", "description": "Post UUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.PostResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Update a post (author or admin)", "parameters": [ { "type": "string", "description": "Post UUID", "name": "id", "in": "path", "required": true }, { "description": "Post payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.UpdatePostRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.PostResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "posts" ], "summary": "Delete a post (author or admin)", "parameters": [ { "type": "string", "description": "Post UUID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/post_transport_http.ErrorResponse" } } } } }, "/v1/posts/{id}/comments": { "get": { "produces": [ "application/json" ], "tags": [ "comments" ], "summary": "List comments for a post", "parameters": [ { "type": "string", "description": "Post UUID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "Page size (defaults to COMMENT_DEFAULT_LIMIT, capped by COMMENT_MAX_LIMIT)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.CommentListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "comments" ], "summary": "Add a comment to a post", "parameters": [ { "type": "string", "description": "Post UUID", "name": "id", "in": "path", "required": true }, { "description": "Comment payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.AddCommentRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/http.CommentResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/comment_transport_http.ErrorResponse" } } } } }, "/v1/products": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "List products (paginated)", "parameters": [ { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (defaults to CONTENT_DEFAULT_LIMIT, capped by CONTENT_MAX_LIMIT)", "name": "pageSize", "in": "query" }, { "type": "string", "description": "Locale (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "type": "string", "description": "Sort field, e.g. name:asc (repeatable)", "name": "sort", "in": "query" }, { "type": "string", "description": "Filter by brand slug", "name": "brand", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ContentListResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Create a product (admin only)", "parameters": [ { "type": "string", "description": "Locale for the new entry (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "description": "Strapi product attributes (name, slug, brand, relations)", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/products/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Update a product (admin or editor)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Locale of the entry to update", "name": "locale", "in": "query" }, { "description": "Strapi product attributes to change", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "content" ], "summary": "Delete a product (admin only)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/products/{slug}": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Get a product", "parameters": [ { "type": "string", "description": "Product slug", "name": "slug", "in": "path", "required": true }, { "type": "string", "description": "Locale", "name": "locale", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/recipes": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "List recipes (paginated)", "parameters": [ { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (defaults to CONTENT_DEFAULT_LIMIT, capped by CONTENT_MAX_LIMIT)", "name": "pageSize", "in": "query" }, { "type": "string", "description": "Locale (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "type": "string", "description": "Sort field, e.g. title:asc or createdAt:desc (repeatable)", "name": "sort", "in": "query" }, { "type": "string", "description": "Filter by main category slug", "name": "mainCategory", "in": "query" }, { "type": "string", "description": "Filter by author slug", "name": "author", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.ContentListResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Create a recipe (admin only)", "parameters": [ { "type": "string", "description": "Locale for the new entry (defaults to configured Persian locale)", "name": "locale", "in": "query" }, { "description": "Strapi recipe attributes (title, slug, ingredients, steps, relations)", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "201": { "description": "Created", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/recipes/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Update a recipe (admin or editor)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Locale of the entry to update", "name": "locale", "in": "query" }, { "description": "Strapi recipe attributes to change", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "content" ], "summary": "Delete a recipe (admin only)", "parameters": [ { "type": "string", "description": "Strapi documentId", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/recipes/{slug}": { "get": { "produces": [ "application/json" ], "tags": [ "content" ], "summary": "Get a recipe", "parameters": [ { "type": "string", "description": "Recipe slug", "name": "slug", "in": "path", "required": true }, { "type": "string", "description": "Locale", "name": "locale", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "502": { "description": "Bad Gateway", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/content_transport_http.ErrorResponse" } } } } }, "/v1/users": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "List users (admin)", "parameters": [ { "type": "integer", "description": "Page size (defaults to USER_DEFAULT_LIMIT, capped by USER_MAX_LIMIT)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.UserListResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } } }, "/v1/users/login": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Authenticate (login)", "parameters": [ { "description": "Login payload — identifier accepts username or email", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.AuthenticateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.AuthenticateResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } } }, "/v1/users/me": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Get current user profile", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.UserResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Update current user profile", "parameters": [ { "description": "Profile payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.UpdateMeRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.UserResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } } }, "/v1/users/me/password": { "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Change current user password", "parameters": [ { "description": "Password payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.ChangePasswordRequest" } } ], "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } } }, "/v1/users/register": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Register a new user", "parameters": [ { "description": "Registration payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.RegisterRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/http.UserResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } } }, "/v1/users/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Get user by ID (admin)", "parameters": [ { "type": "string", "description": "User UUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.UserResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Update user by ID (admin)", "parameters": [ { "type": "string", "description": "User UUID", "name": "id", "in": "path", "required": true }, { "description": "Profile payload", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.AdminUpdateUserRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/http.UserResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/user_transport_http.ErrorResponse" } } } } } }, "definitions": { "comment_transport_http.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "content_transport_http.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string", "example": "content not found" } } }, "handlers.HealthResponse": { "type": "object", "properties": { "postgres": { "type": "string", "example": "up" }, "redis": { "type": "string", "example": "up" }, "status": { "type": "string", "example": "healthy" } } }, "http.AddCommentRequest": { "type": "object", "required": [ "content" ], "properties": { "content": { "type": "string", "example": "Great post!" } } }, "http.AdminUpdateUserRequest": { "type": "object", "required": [ "email", "username" ], "properties": { "disabled": { "type": "boolean", "example": false }, "email": { "type": "string", "example": "alice@example.com" }, "phone_number": { "type": "string", "example": "+15551234567" }, "role": { "type": "string", "enum": [ "user", "admin", "editor" ], "example": "user" }, "username": { "type": "string", "example": "alice" } } }, "http.AuthenticateRequest": { "type": "object", "required": [ "identifier", "password" ], "properties": { "identifier": { "type": "string", "example": "alice" }, "password": { "type": "string", "example": "correct-horse-battery-staple" } } }, "http.AuthenticateResponse": { "type": "object", "properties": { "token": { "type": "string" }, "user": { "$ref": "#/definitions/http.UserResponse" } } }, "http.ChangePasswordRequest": { "type": "object", "required": [ "current_password", "new_password" ], "properties": { "current_password": { "type": "string", "example": "correct-horse-battery-staple" }, "new_password": { "type": "string", "example": "new-correct-horse-battery-staple" } } }, "http.CommentListResponse": { "type": "object", "properties": { "comments": { "type": "array", "items": { "$ref": "#/definitions/http.CommentResponse" } }, "limit": { "type": "integer" }, "page": { "type": "integer" }, "total": { "type": "integer" } } }, "http.CommentResponse": { "type": "object", "properties": { "author_id": { "type": "string" }, "content": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "post_id": { "type": "string" }, "updated_at": { "type": "string" } } }, "http.ContentListResponse": { "type": "object", "properties": { "items": { "type": "array", "items": {} }, "limit": { "type": "integer", "example": 15 }, "page": { "type": "integer", "example": 1 }, "page_count": { "type": "integer", "example": 3 }, "total": { "type": "integer", "example": 42 } } }, "http.CreatePostRequest": { "type": "object", "required": [ "content", "title" ], "properties": { "content": { "type": "string", "example": "This is my first post." }, "title": { "type": "string", "example": "Hello, world" } } }, "http.PostListResponse": { "type": "object", "properties": { "limit": { "type": "integer" }, "page": { "type": "integer" }, "posts": { "type": "array", "items": { "$ref": "#/definitions/http.PostResponse" } }, "total": { "type": "integer" } } }, "http.PostResponse": { "type": "object", "properties": { "author_id": { "type": "string" }, "content": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" } } }, "http.RegisterRequest": { "type": "object", "required": [ "email", "password", "username" ], "properties": { "email": { "type": "string", "example": "alice@example.com" }, "password": { "type": "string", "example": "correct-horse-battery-staple" }, "phone_number": { "type": "string", "example": "+15551234567" }, "role": { "type": "string", "enum": [ "user", "admin", "editor" ], "example": "user" }, "super_admin_key": { "type": "string", "example": "bootstrap-secret" }, "username": { "type": "string", "example": "alice" } } }, "http.UpdateCommentRequest": { "type": "object", "required": [ "content" ], "properties": { "content": { "type": "string", "example": "Updated comment." } } }, "http.UpdateMeRequest": { "type": "object", "required": [ "email", "username" ], "properties": { "email": { "type": "string", "example": "alice@example.com" }, "phone_number": { "type": "string", "example": "+15551234567" }, "username": { "type": "string", "example": "alice" } } }, "http.UpdatePostRequest": { "type": "object", "required": [ "content", "title" ], "properties": { "content": { "type": "string", "example": "Updated post content." }, "title": { "type": "string", "example": "Updated title" } } }, "http.UserListResponse": { "type": "object", "properties": { "limit": { "type": "integer" }, "page": { "type": "integer" }, "total": { "type": "integer" }, "users": { "type": "array", "items": { "$ref": "#/definitions/http.UserResponse" } } } }, "http.UserResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "disabled": { "type": "boolean" }, "email": { "type": "string" }, "id": { "type": "string" }, "phone_number": { "type": "string" }, "role": { "type": "string", "enum": [ "user", "admin", "editor" ] }, "updated_at": { "type": "string" }, "username": { "type": "string" } } }, "post_transport_http.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "user_transport_http.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Aphrodite session token from POST /v1/users/login — send as \"Bearer \u003ctoken\u003e\"", "type": "apiKey", "name": "Authorization", "in": "header" } } }