{
    "openapi": "3.1.0",
    "info": {
        "title": "MARREK Integration API",
        "version": "v1",
        "description": "Read and edit your MARREK data from your own product: dialogs and messages, leads, products, categories, the knowledge base, AI settings and analytics. New messages can also be pushed to you as [webhooks](https:\/\/marrek.app\/developers#webhooks).\n\n**Start here:** the [integration guide](https:\/\/marrek.app\/developers) explains keys, projects, webhooks and signature verification with examples.\n\n## Authentication\nSend an API key as a bearer token: `Authorization: Bearer mk_live_\u2026`. Keys are created by the account owner in the dashboard and limited to the areas (scopes) and projects they choose. Each operation below lists the scope it needs.\n\n## Projects\nAn account can have several projects. Pass the project you mean in the `X-Project-Id` header; if the key can reach exactly one project it is picked automatically. `GET \/projects` lists the ids you can use.\n\n## Errors\nErrors are JSON. `401` \u2014 key missing, invalid, revoked or expired (`error.code` says which). `402` \u2014 the account's plan does not include the API (`error.limit = api_access`). `403` \u2014 the key lacks the scope (`insufficient_scope`) or the project (`project_forbidden`). `404` \u2014 no such resource in this project. `409 project_required` \u2014 send `X-Project-Id`. `422` \u2014 validation, with an `errors` object per field. `429` \u2014 slow down; see `Retry-After`.\n\n## Pagination\nList endpoints take `page` and `per_page` (1\u2013100). Message history uses `before_id` and `limit` instead.\n\n## Availability\nThe public API is included in the Business and Pro plans. Requests from an account on another plan answer `402`.\n\n## Rate limits\n120 requests per minute per key by default. Every response carries `X-RateLimit-Limit` and `X-RateLimit-Remaining`."
    },
    "servers": [
        {
            "url": "https:\/\/marrek.app\/api\/public\/v1"
        }
    ],
    "security": [
        {
            "ApiKey": []
        }
    ],
    "paths": {
        "\/ai-settings": {
            "get": {
                "operationId": "aiSettings.show",
                "description": "**Required scope:** `ai_settings:read` (also granted by `ai_settings:write`).",
                "summary": "Get AI settings",
                "tags": [
                    "AI settings"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`AiSettingsResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/AiSettingsResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "aiSettings.update",
                "description": "Changes how the AI talks to your customers in this project. Takes effect on the next reply. Send only the fields you want to change.\n\n**Required scope:** `ai_settings:write`.",
                "summary": "Update AI settings",
                "tags": [
                    "AI settings"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateAiSettingsRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`AiSettingsResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/AiSettingsResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/analytics": {
            "get": {
                "operationId": "analytics.index",
                "description": "`period` is `today`, `7d` (default), `30d` or `90d`. Send an `X-Timezone` header (an IANA name such as `Europe\/Kyiv`) to bucket by your own calendar day; the default is UTC. A time zone the key's owner has pinned in their dashboard settings takes precedence over the header.\n\n**Required scope:** `analytics:read`.",
                "summary": "Get analytics",
                "tags": [
                    "Analytics"
                ],
                "parameters": [
                    {
                        "name": "period",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "today",
                                "7d",
                                "30d",
                                "90d"
                            ]
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`OwnerAnalyticsResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/OwnerAnalyticsResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/threads": {
            "get": {
                "operationId": "thread.index",
                "description": "Newest activity first. Filter by `channel` (`telegram`, `instagram`, `web`, `olx`), `status`, `lead_status`, a customer-name search `q`, and `date_from` \/ `date_to` (ISO timestamps, applied to the last message).\n\n**Required scope:** `dialogs:read` (also granted by `dialogs:write`).",
                "summary": "List dialogs",
                "tags": [
                    "Dialogs"
                ],
                "parameters": [
                    {
                        "name": "channel",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "telegram",
                                "instagram",
                                "web",
                                "olx",
                                "test",
                                null
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 32
                        }
                    },
                    {
                        "name": "lead_status",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 32
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page, 1\u2013100. Each list has its own default (dialogs 50, leads 25, products and documents 20).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `ThreadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/ThreadResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "assigned_user",
                                                            "crm_push"
                                                        ]
                                                    }
                                                ]
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/threads\/{thread}": {
            "get": {
                "operationId": "thread.show",
                "description": "**Required scope:** `dialogs:read` (also granted by `dialogs:write`).",
                "summary": "Get a dialog",
                "tags": [
                    "Dialogs"
                ],
                "parameters": [
                    {
                        "name": "thread",
                        "in": "path",
                        "required": true,
                        "description": "The thread ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ThreadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ThreadResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "assigned_user",
                                                        "crm_push"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "thread.update",
                "description": "Only `ai_enabled` and `lead_status` can be changed. Turning the AI on fails with `409 ai_enable_conflict` while a manager is assigned.\n\n**Required scope:** `dialogs:write`.",
                "summary": "Update a dialog",
                "tags": [
                    "Dialogs"
                ],
                "parameters": [
                    {
                        "name": "thread",
                        "in": "path",
                        "required": true,
                        "description": "The thread ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateThreadRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ThreadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ThreadResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Cannot enable AI while a manager is assigned. Release the thread first."
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "ai_enable_conflict"
                                                }
                                            },
                                            "required": [
                                                "code"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/threads\/{thread}\/messages": {
            "get": {
                "operationId": "thread.messages",
                "description": "Newest first. Page backwards with `before_id` (the id of the oldest message you already have) and `limit` (default 50, max 100). Attachment `url`s are signed and expire after 6 hours; fetch the message again for a fresh one.\n\n**Required scope:** `dialogs:read` (also granted by `dialogs:write`).",
                "summary": "List messages of a dialog",
                "tags": [
                    "Dialogs"
                ],
                "parameters": [
                    {
                        "name": "thread",
                        "in": "path",
                        "required": true,
                        "description": "The thread ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "before_id",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 0
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 50
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `MessageResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/MessageResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "read_by",
                                                            "attachments"
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "thread.sendMessage",
                "description": "Queues the message for delivery to the customer's channel (Telegram, Instagram, OLX or web widget). Answers `201` with `delivery_status: pending`; the final status arrives as a `message.updated` webhook. The message is tagged `metadata.source = api`, so your own webhook subscription can tell it apart from replies typed in the dashboard.\n\nTo send an attachment: call `POST \/media\/upload-url`, `PUT` the file to the returned `url` with the returned `headers`, then send `attachment_key`, `attachment_kind` and `attachment_mime_type` from that response together with the file's `attachment_size_bytes`.\n\n**Required scope:** `dialogs:write`.",
                "summary": "Send a message",
                "tags": [
                    "Dialogs"
                ],
                "parameters": [
                    {
                        "name": "thread",
                        "in": "path",
                        "required": true,
                        "description": "The thread ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/SendMessageRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`MessageResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/MessageResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "attachments"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/threads\/{thread}\/read": {
            "post": {
                "operationId": "thread.read",
                "description": "**Required scope:** `dialogs:write`.",
                "summary": "Mark a dialog as read",
                "tags": [
                    "Dialogs"
                ],
                "parameters": [
                    {
                        "name": "thread",
                        "in": "path",
                        "required": true,
                        "description": "The thread ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Thread marked as read"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/media\/upload-url": {
            "post": {
                "operationId": "media.uploadUrl",
                "description": "Returns a pre-signed URL valid for 15 minutes. Upload the file to it with an HTTP `PUT`, sending exactly the returned `headers`, then reference the returned `key` when sending the message.\n\n**Required scope:** `dialogs:write`.",
                "summary": "Get an upload URL for an attachment",
                "tags": [
                    "Dialogs"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/MediaUploadUrlRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "url": {
                                            "type": "string"
                                        },
                                        "headers": {
                                            "type": "object",
                                            "additionalProperties": {
                                                "type": "string"
                                            }
                                        },
                                        "key": {
                                            "type": "string"
                                        },
                                        "kind": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "url",
                                        "headers",
                                        "key",
                                        "kind"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/knowledge-documents": {
            "get": {
                "operationId": "knowledgeDocument.index",
                "description": "**Required scope:** `knowledge:read` (also granted by `knowledge:write`).",
                "summary": "List knowledge base documents",
                "tags": [
                    "Knowledge base"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page, 1\u2013100. Each list has its own default (dialogs 50, leads 25, products and documents 20).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `KnowledgeDocumentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/KnowledgeDocumentResource"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "knowledgeDocument.store",
                "description": "Answers `202`: the text is split and embedded in the background, and the document's `status` shows the progress. A file upload (`file`, PDF or text) is accepted as `multipart\/form-data`.\n\n**Required scope:** `knowledge:write`.",
                "summary": "Create a knowledge base document",
                "tags": [
                    "Knowledge base"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreKnowledgeDocumentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "`KnowledgeDocumentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/KnowledgeDocumentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/knowledge-documents\/{knowledgeDocument}": {
            "get": {
                "operationId": "knowledgeDocument.show",
                "description": "**Required scope:** `knowledge:read` (also granted by `knowledge:write`).",
                "summary": "Get a knowledge base document",
                "tags": [
                    "Knowledge base"
                ],
                "parameters": [
                    {
                        "name": "knowledgeDocument",
                        "in": "path",
                        "required": true,
                        "description": "The knowledge document ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`KnowledgeDocumentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/KnowledgeDocumentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "knowledgeDocument.update",
                "description": "Changing the text re-processes the document and answers `202`; a rename alone answers `200`.\n\n**Required scope:** `knowledge:write`.",
                "summary": "Update a knowledge base document",
                "tags": [
                    "Knowledge base"
                ],
                "parameters": [
                    {
                        "name": "knowledgeDocument",
                        "in": "path",
                        "required": true,
                        "description": "The knowledge document ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateKnowledgeDocumentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`KnowledgeDocumentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/KnowledgeDocumentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "`KnowledgeDocumentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/KnowledgeDocumentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "knowledgeDocument.destroy",
                "description": "**Required scope:** `knowledge:write`.",
                "summary": "Delete a knowledge base document",
                "tags": [
                    "Knowledge base"
                ],
                "parameters": [
                    {
                        "name": "knowledgeDocument",
                        "in": "path",
                        "required": true,
                        "description": "The knowledge document ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/leads": {
            "get": {
                "operationId": "lead.index",
                "description": "Filter by `q` (name, phone or e-mail), `channel`, `lead_status` (the status of the dialog), `has_contacts`, and `date_from` \/ `date_to` (days in the `X-Timezone` you send). Sort with `sort=created_at` (default) or `updated_at`.\n\n**Required scope:** `leads:read` (also granted by `leads:write`).",
                "summary": "List leads",
                "tags": [
                    "Leads"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page, 1\u2013100. Each list has its own default (dialogs 50, leads 25, products and documents 20).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `LeadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/LeadResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "thread"
                                                        ]
                                                    }
                                                ]
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/leads\/export": {
            "get": {
                "operationId": "lead.export",
                "description": "Streams a CSV (UTF-8 with BOM) of every lead matching the same filters as `GET \/leads`. Not paginated.\n\n**Required scope:** `leads:read` (also granted by `leads:write`).",
                "summary": "Export leads as CSV",
                "tags": [
                    "Leads"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "text\/csv; charset=UTF-8": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        },
                        "headers": {
                            "Transfer-Encoding": {
                                "required": true,
                                "schema": {
                                    "type": "string",
                                    "enum": [
                                        "chunked"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/leads\/{lead}": {
            "get": {
                "operationId": "lead.show",
                "description": "**Required scope:** `leads:read` (also granted by `leads:write`).",
                "summary": "Get a lead",
                "tags": [
                    "Leads"
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "The lead ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`LeadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/LeadResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "thread"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "lead.update",
                "description": "Every field you send is marked as manually set (`field_sources`), after which neither the AI nor the web form will overwrite it. `lead_status` is stored on the dialog, not on the lead.\n\n**Required scope:** `leads:write`.",
                "summary": "Update a lead",
                "tags": [
                    "Leads"
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "The lead ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateLeadRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`LeadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/LeadResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "lead.destroy",
                "description": "Soft delete: the lead disappears from the API and the dashboard. A `lead.deleted` webhook is sent.\n\n**Required scope:** `leads:write`.",
                "summary": "Delete a lead",
                "tags": [
                    "Leads"
                ],
                "parameters": [
                    {
                        "name": "lead",
                        "in": "path",
                        "required": true,
                        "description": "The lead ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Lead deleted"
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/product-categories": {
            "get": {
                "operationId": "productCategory.index",
                "description": "**Required scope:** `catalog:read` (also granted by `catalog:write`).",
                "summary": "List product categories",
                "tags": [
                    "Product categories"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ProductCategoryResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ProductCategoryResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "productCategory.store",
                "description": "**Required scope:** `catalog:write`.",
                "summary": "Create a product category",
                "tags": [
                    "Product categories"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "name_en": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "parent_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "sort_order": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ProductCategoryResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ProductCategoryResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/product-categories\/{productCategory}": {
            "patch": {
                "operationId": "productCategory.update",
                "description": "**Required scope:** `catalog:write`.",
                "summary": "Update a product category",
                "tags": [
                    "Product categories"
                ],
                "parameters": [
                    {
                        "name": "productCategory",
                        "in": "path",
                        "required": true,
                        "description": "The product category ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "name_en": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "parent_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "minimum": 0
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ProductCategoryResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ProductCategoryResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "productCategory.destroy",
                "description": "Permanent. Products in the category are kept and become uncategorised; its sub-categories become top-level.\n\n**Required scope:** `catalog:write`.",
                "summary": "Delete a product category",
                "tags": [
                    "Product categories"
                ],
                "parameters": [
                    {
                        "name": "productCategory",
                        "in": "path",
                        "required": true,
                        "description": "The product category ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/products": {
            "get": {
                "operationId": "product.index",
                "description": "`category_id` matches the category and all of its subcategories.\n\n**Required scope:** `catalog:read` (also granted by `catalog:write`).",
                "summary": "List products",
                "tags": [
                    "Products"
                ],
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 0
                        }
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page, 1\u2013100. Each list has its own default (dialogs 50, leads 25, products and documents 20).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `ProductResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#\/components\/schemas\/ProductResource"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "required": [
                                                            "category"
                                                        ]
                                                    }
                                                ]
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "product.store",
                "description": "**Required scope:** `catalog:write`.",
                "summary": "Create a product",
                "tags": [
                    "Products"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreProductRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ProductResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ProductResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/products\/{product}": {
            "get": {
                "operationId": "product.show",
                "description": "**Required scope:** `catalog:read` (also granted by `catalog:write`).",
                "summary": "Get a product",
                "tags": [
                    "Products"
                ],
                "parameters": [
                    {
                        "name": "product",
                        "in": "path",
                        "required": true,
                        "description": "The product ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ProductResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ProductResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "category"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "product.update",
                "description": "**Required scope:** `catalog:write`.",
                "summary": "Update a product",
                "tags": [
                    "Products"
                ],
                "parameters": [
                    {
                        "name": "product",
                        "in": "path",
                        "required": true,
                        "description": "The product ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateProductRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ProductResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/ProductResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "category"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "product.destroy",
                "description": "Soft delete: the product stops being offered by the AI and disappears from lists.\n\n**Required scope:** `catalog:write`.",
                "summary": "Delete a product",
                "tags": [
                    "Products"
                ],
                "parameters": [
                    {
                        "name": "product",
                        "in": "path",
                        "required": true,
                        "description": "The product ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/products\/{product}\/toggle-active": {
            "post": {
                "operationId": "product.toggleActive",
                "description": "**Required scope:** `catalog:write`.",
                "summary": "Activate or deactivate a product",
                "tags": [
                    "Products"
                ],
                "parameters": [
                    {
                        "name": "product",
                        "in": "path",
                        "required": true,
                        "description": "The product ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ProductResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ProductResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/products\/bulk-action": {
            "post": {
                "operationId": "product.bulkAction",
                "description": "**Required scope:** `catalog:write`.",
                "summary": "Activate, deactivate or delete several products",
                "tags": [
                    "Products"
                ],
                "parameters": [
                    {
                        "name": "X-Project-Id",
                        "in": "header",
                        "description": "The project to act in. Optional when the key can reach exactly one project; otherwise the request fails with `409 project_required`. List the ids with `GET \/projects`.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/BulkActionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "const": "Bulk action applied"
                                        },
                                        "count": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "message",
                                        "count"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "No project selected: send `X-Project-Id`. `error.code` is `project_required`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/projects": {
            "get": {
                "operationId": "public.",
                "description": "Returns the projects this key can reach \u2014 the ids that are valid for `X-Project-Id`. Works without `X-Project-Id`.\n\n**Required scope:** none \u2014 any valid API key.",
                "summary": "List projects",
                "tags": [
                    "Projects"
                ],
                "responses": {
                    "200": {
                        "description": "Array of `PublicProjectResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/PublicProjectResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "The key is missing, invalid, revoked or expired. `error.code` is `invalid_api_key`, `api_key_revoked`, `api_key_expired` or `api_key_disabled`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "The account's plan does not include the public API (`error.code` is `plan_limit_exceeded`, `error.limit` is `api_access`). Upgrade the plan; keys are kept.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests. Wait for the number of seconds in `Retry-After`.",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The key lacks the required scope (`insufficient_scope`) or cannot reach the project (`project_forbidden`).",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKey": {
                "type": "http",
                "description": "Create a key in the dashboard under **Developers \u2192 API keys**. Send it as `Authorization: Bearer mk_live_\u2026`.",
                "scheme": "bearer",
                "bearerFormat": "API key (mk_live_\u2026)"
            }
        },
        "schemas": {
            "AiSettingsResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "tone": {
                        "type": "string"
                    },
                    "language": {
                        "type": "string"
                    },
                    "company_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "content_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "business_context": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "business_context_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "lead_keywords": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "id",
                    "tone",
                    "language",
                    "company_name",
                    "content",
                    "content_en",
                    "business_context",
                    "business_context_en",
                    "lead_keywords"
                ],
                "title": "AiSettingsResource"
            },
            "BulkActionRequest": {
                "type": "object",
                "properties": {
                    "action": {
                        "type": "string",
                        "enum": [
                            "activate",
                            "deactivate",
                            "delete"
                        ]
                    },
                    "ids": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "minItems": 1
                    }
                },
                "required": [
                    "action",
                    "ids"
                ],
                "title": "BulkActionRequest"
            },
            "KnowledgeDocumentResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "title_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source_type": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "chunks_count": {
                        "type": "integer"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "content_preview": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "content_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "title",
                    "title_en",
                    "source_type",
                    "status",
                    "chunks_count",
                    "is_active",
                    "content_preview",
                    "created_at",
                    "updated_at"
                ],
                "title": "KnowledgeDocumentResource"
            },
            "LeadResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "thread_id": {
                        "type": "integer"
                    },
                    "channel": {
                        "type": "string"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone_e164": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "delivery_method": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "delivery_address": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "preferred_contact": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "products": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "product_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "name": {
                                    "type": "string"
                                },
                                "quantity": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "product_id",
                                "name",
                                "quantity"
                            ]
                        }
                    },
                    "summary": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "custom_fields": {
                        "type": "object",
                        "additionalProperties": {}
                    },
                    "field_sources": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "manager_note": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "first_captured_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "last_ai_update_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "thread": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "lead_status": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "lead_status_updated_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "status": {
                                "type": "string"
                            },
                            "last_message_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "assigned_user_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "lead_status",
                            "lead_status_updated_at",
                            "status",
                            "last_message_at",
                            "assigned_user_id"
                        ]
                    }
                },
                "required": [
                    "id",
                    "thread_id",
                    "channel",
                    "name",
                    "phone",
                    "phone_e164",
                    "email",
                    "city",
                    "country",
                    "delivery_method",
                    "delivery_address",
                    "preferred_contact",
                    "products",
                    "summary",
                    "custom_fields",
                    "field_sources",
                    "manager_note",
                    "first_captured_at",
                    "last_ai_update_at",
                    "created_at",
                    "updated_at"
                ],
                "title": "LeadResource"
            },
            "MediaUploadUrlRequest": {
                "type": "object",
                "properties": {
                    "filename": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "content_type": {
                        "type": "string",
                        "enum": [
                            "image\/jpeg",
                            "image\/png",
                            "image\/webp",
                            "image\/gif",
                            "video\/mp4",
                            "video\/quicktime",
                            "video\/webm",
                            "application\/pdf"
                        ]
                    },
                    "size_bytes": {
                        "type": "integer",
                        "minimum": 1
                    }
                },
                "required": [
                    "filename",
                    "content_type",
                    "size_bytes"
                ],
                "title": "MediaUploadUrlRequest"
            },
            "MessageAttachmentResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "url": {
                        "type": "null"
                    },
                    "mime_type": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "size_bytes": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "download_status": {
                        "type": "string"
                    },
                    "download_error": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "url",
                    "mime_type",
                    "size_bytes",
                    "download_status",
                    "download_error"
                ],
                "title": "MessageAttachmentResource"
            },
            "MessageResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "thread_id": {
                        "type": "integer"
                    },
                    "direction": {
                        "type": "string"
                    },
                    "sender_type": {
                        "type": "string"
                    },
                    "sender_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "reply_to_message_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "external_message_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_attachments": {
                        "type": "boolean"
                    },
                    "is_read": {
                        "type": "boolean"
                    },
                    "read_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "read_by": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name"
                        ]
                    },
                    "delivery_status": {
                        "type": "string"
                    },
                    "metadata": {
                        "type": "array",
                        "items": {}
                    },
                    "attachments": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/MessageAttachmentResource"
                        }
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "thread_id",
                    "direction",
                    "sender_type",
                    "sender_user_id",
                    "content",
                    "reply_to_message_id",
                    "external_message_id",
                    "has_attachments",
                    "is_read",
                    "read_at",
                    "delivery_status",
                    "metadata",
                    "created_at",
                    "updated_at"
                ],
                "title": "MessageResource"
            },
            "OwnerAnalyticsResource": {
                "type": "object",
                "properties": {
                    "totals": {
                        "type": "string"
                    },
                    "by_day": {
                        "type": "string"
                    },
                    "by_channel": {
                        "type": "string"
                    },
                    "leads_by_day": {
                        "type": "string"
                    },
                    "peak_hours": {
                        "type": "string"
                    },
                    "role_distribution": {
                        "type": "string"
                    },
                    "top_dialogs": {
                        "type": "string"
                    },
                    "meta": {
                        "type": "string"
                    }
                },
                "required": [
                    "totals",
                    "by_day",
                    "by_channel",
                    "leads_by_day",
                    "peak_hours",
                    "role_distribution",
                    "top_dialogs",
                    "meta"
                ],
                "title": "OwnerAnalyticsResource"
            },
            "ProductCategory": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "sort_order": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "name_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "tenant_id",
                    "name",
                    "parent_id",
                    "sort_order",
                    "created_at",
                    "updated_at",
                    "name_en"
                ],
                "title": "ProductCategory"
            },
            "ProductCategoryResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "name_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "parent_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "sort_order": {
                        "type": "integer"
                    },
                    "children": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/ProductCategoryResource"
                        }
                    }
                },
                "required": [
                    "id",
                    "name",
                    "name_en",
                    "parent_id",
                    "sort_order"
                ],
                "title": "ProductCategoryResource"
            },
            "ProductResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "tenant_id": {
                        "type": "integer"
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "external_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sku": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "name_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "price_cents": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": "string"
                    },
                    "attributes": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "tenant_id": {
                                "type": "integer"
                            },
                            "category_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "external_id": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "sku": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": "string"
                            },
                            "description": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "price_cents": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "currency": {
                                "type": "string"
                            },
                            "attributes": {
                                "type": "string"
                            },
                            "media": {
                                "type": "string"
                            },
                            "is_active": {
                                "type": "string"
                            },
                            "embedding": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "embedding_updated_at": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "embedding_text_hash": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "created_at": {
                                "type": "string"
                            },
                            "updated_at": {
                                "type": "string"
                            },
                            "deleted_at": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "name_en": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "description_en": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "media": {
                        "type": "array",
                        "items": {}
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "embedding_status": {
                        "type": "string",
                        "enum": [
                            "embedded",
                            "pending"
                        ]
                    },
                    "category": {
                        "anyOf": [
                            {
                                "$ref": "#\/components\/schemas\/ProductCategory"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "tenant_id",
                    "category_id",
                    "external_id",
                    "sku",
                    "name",
                    "name_en",
                    "description",
                    "description_en",
                    "price_cents",
                    "currency",
                    "attributes",
                    "media",
                    "is_active",
                    "embedding_status",
                    "created_at",
                    "updated_at"
                ],
                "title": "ProductResource"
            },
            "PublicProjectResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "ai_enabled": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "slug",
                    "ai_enabled"
                ],
                "title": "PublicProjectResource"
            },
            "SendMessageRequest": {
                "type": "object",
                "properties": {
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 4096
                    },
                    "attachment_key": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Must be a key MediaController::uploadUrl minted for THIS workspace.\nWithout the prefix check anyone able to send a message could point it\nat another tenant's file in the shared bucket (docs\/03 \u00a710.3) \u2014 a\nhole that matters far more once the endpoint is on the public API.",
                        "maxLength": 512
                    },
                    "attachment_kind": {
                        "type": "string",
                        "description": "The three attachment_* fields all come from MediaController::uploadUrl's\nresponse (see MediaUploadUrlRequest) \u2014 the frontend passes them straight\nthrough, so they're either all present or all absent alongside the key.",
                        "enum": [
                            "image",
                            "video",
                            "document"
                        ]
                    },
                    "attachment_mime_type": {
                        "type": "string",
                        "maxLength": 128
                    },
                    "attachment_size_bytes": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    }
                },
                "title": "SendMessageRequest"
            },
            "StoreKnowledgeDocumentRequest": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "title_en": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "file": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "binary",
                        "contentMediaType": "application\/octet-stream",
                        "description": "Maximum file size: 10240 kilobytes."
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "content_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "title"
                ],
                "title": "StoreKnowledgeDocumentRequest"
            },
            "StoreProductRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "name_en": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "sku": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "external_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 128
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "price_cents": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 3,
                        "maxLength": 3
                    },
                    "attributes": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "media": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "uri"
                        }
                    },
                    "is_active": {
                        "type": [
                            "boolean",
                            "null"
                        ]
                    }
                },
                "required": [
                    "name"
                ],
                "title": "StoreProductRequest"
            },
            "ThreadResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "channel": {
                        "type": "string"
                    },
                    "external_user_id": {
                        "type": "string"
                    },
                    "external_chat_id": {
                        "type": "string"
                    },
                    "customer_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "customer_username": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "ai_enabled": {
                        "type": "boolean"
                    },
                    "ai_status": {
                        "type": "string"
                    },
                    "lead_status": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "unread_count": {
                        "type": "integer"
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "last_message_content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_message_direction": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "assigned_user_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "assigned_user": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name"
                        ]
                    },
                    "assigned_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "crm_push": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "No real-time channel for this yet (decision Q9) \u2014 the frontend\nrefetches after a manual push instead of listening for an event.",
                        "properties": {
                            "status": {
                                "type": "string"
                            },
                            "external_url": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "error": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "status",
                            "external_url",
                            "error"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "channel",
                    "external_user_id",
                    "external_chat_id",
                    "customer_name",
                    "customer_username",
                    "status",
                    "ai_enabled",
                    "ai_status",
                    "lead_status",
                    "unread_count",
                    "last_message_at",
                    "last_message_content",
                    "last_message_direction",
                    "assigned_user_id",
                    "assigned_at",
                    "created_at",
                    "updated_at"
                ],
                "title": "ThreadResource"
            },
            "UpdateAiSettingsRequest": {
                "type": "object",
                "properties": {
                    "tone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "friendly",
                            "professional",
                            "sales",
                            null
                        ]
                    },
                    "language": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "uk",
                            "en",
                            null
                        ]
                    },
                    "company_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 120
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000
                    },
                    "content_en": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000
                    },
                    "business_context": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000
                    },
                    "business_context_en": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 2000
                    },
                    "lead_keywords": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                },
                "title": "UpdateAiSettingsRequest"
            },
            "UpdateKnowledgeDocumentRequest": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "title_en": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "content_en": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Unlike `content`, the English translation is always owner-authored\nrather than extracted from an uploaded file, so it is editable\nregardless of source_type \u2014 see withValidator() below."
                    }
                },
                "title": "UpdateKnowledgeDocumentRequest"
            },
            "UpdateLeadRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 32
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "maxLength": 255
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "delivery_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "delivery_address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500
                    },
                    "preferred_contact": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "phone",
                            "email",
                            "telegram",
                            "instagram",
                            "whatsapp",
                            null
                        ]
                    },
                    "summary": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000
                    },
                    "manager_note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000
                    },
                    "products": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "product_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "name": {
                                    "type": "string",
                                    "maxLength": 255
                                },
                                "quantity": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                }
                            }
                        },
                        "maxItems": 50
                    },
                    "lead_status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "lead_status lives on the thread, not the lead \u2014 proxied to\nUpdateThreadAction by the controller, validated the same way\nUpdateThreadRequest validates it.",
                        "enum": [
                            "interested",
                            "ready_to_close",
                            "closed",
                            "lost",
                            null
                        ]
                    }
                },
                "title": "UpdateLeadRequest"
            },
            "UpdateProductRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "name_en": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "sku": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 64
                    },
                    "external_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 128
                    },
                    "category_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description_en": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "price_cents": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0
                    },
                    "currency": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 3,
                        "maxLength": 3
                    },
                    "attributes": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "media": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "uri"
                        }
                    },
                    "is_active": {
                        "type": [
                            "boolean",
                            "null"
                        ]
                    }
                },
                "title": "UpdateProductRequest"
            },
            "UpdateThreadRequest": {
                "type": "object",
                "properties": {
                    "ai_enabled": {
                        "type": "boolean"
                    },
                    "lead_status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "interested",
                            "ready_to_close",
                            "closed",
                            "lost",
                            null
                        ]
                    }
                },
                "title": "UpdateThreadRequest"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}