{
    "openapi": "3.0.0",
    "info": {
        "title": "stromcom.cz | API",
        "description": "OpenAPI documentation. For more information visit https://www.stromcom.cz",
        "version": "0.1"
    },
    "paths": {
        "/api/customer/v1/threads/{code}/messages/": {
            "get": {
                "tags": [
                    "Message"
                ],
                "description": "List messages for a thread identified by its code. Supports `lastMessageHash` for cursor-style pagination.",
                "operationId": "23b882c77a0c57f9dffd38d570920966",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Thread code",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "ORDER-123"
                        }
                    },
                    {
                        "name": "lastMessageHash",
                        "in": "query",
                        "description": "Return messages starting from this hash (inclusive) — cursor pagination.",
                        "required": false,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:Message:Hash"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "messages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "messagesAttachments": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Response:Meta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/threads/{code}/messages/{messageHash}/": {
            "delete": {
                "tags": [
                    "Message"
                ],
                "description": "Delete a message (admin operation). If the project has `allowMessageFullDelete` enabled the row is permanently removed; otherwise it is soft-deleted. Message-owner and time-window checks are not enforced for customer credentials.",
                "operationId": "931fac9245403fd480bfe4bb904d73fb",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Thread code",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "ORDER-123"
                        }
                    },
                    {
                        "name": "messageHash",
                        "in": "path",
                        "description": "Message hash",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:Message:Hash"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "thread_hash": {
                                                    "type": "string"
                                                },
                                                "message_hash": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "meta": {
                                            "properties": {
                                                "state": {
                                                    "type": "string",
                                                    "enum": [
                                                        "deleted",
                                                        "marked",
                                                        "error"
                                                    ]
                                                },
                                                "lastMessageHash": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/threads/{code}/messages/{messageHash}/attachments/": {
            "get": {
                "tags": [
                    "Message"
                ],
                "description": "List attachments of a single message.",
                "operationId": "f6165e4f36e02c1fc4f3a8a385277460",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Thread code",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "ORDER-123"
                        }
                    },
                    {
                        "name": "messageHash",
                        "in": "path",
                        "description": "Message hash",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:Message:Hash"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/MessageAttachment"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "meta": {
                                            "properties": {
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "threadHash": {
                                                    "type": "string"
                                                },
                                                "messageHash": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/threads/{code}/messages/{messageHash}/attachments/{attachmentHash}/download/": {
            "get": {
                "tags": [
                    "Message"
                ],
                "description": "Get a time-limited download URL for a single attachment. The URL does not require authentication and expires shortly after generation.",
                "operationId": "2d2145023b5118dd4dcf25113398588b",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Thread code",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "ORDER-123"
                        }
                    },
                    {
                        "name": "messageHash",
                        "in": "path",
                        "description": "Message hash",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:Message:Hash"
                        }
                    },
                    {
                        "name": "attachmentHash",
                        "in": "path",
                        "description": "Attachment hash",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "fb609c1842f1519afef975a34ccb4b8f"
                        }
                    },
                    {
                        "name": "inline",
                        "in": "query",
                        "description": "When truthy, the download URL is generated for inline rendering (Content-Disposition: inline).",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "url": {
                                                    "type": "string"
                                                },
                                                "contentType": {
                                                    "type": "string"
                                                },
                                                "file": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "meta": {
                                            "properties": {
                                                "inline": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/project/": {
            "get": {
                "tags": [
                    "Project"
                ],
                "description": "Get the project bound to the current credential.",
                "operationId": "92b6e314d67a743a68c0f49d389da0a0",
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Entity:Project"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Response:Meta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Project"
                ],
                "summary": "Úprava projektu — akceptuje JSON body s libovolnou podmnožinou editovatelných\npolí (viz ProjectSettingService::EDITABLE_PROJECT_KEYS). Pole mimo\nsubscription whitelist se tiše ignorují, nevrací error.",
                "description": "Partially update project settings. Accepts any subset of the editable fields; fields outside the subscription whitelist are silently ignored. The `meta.updated` array lists the keys that were actually applied.",
                "operationId": "739703d3250e10a53ef4e54a2e5d6aed",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "description": "Project name",
                                        "type": "string",
                                        "example": "Company ltd."
                                    },
                                    "customCSSPath": {
                                        "description": "URL of a custom CSS file",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "allowThreadSubscribe": {
                                        "type": "boolean"
                                    },
                                    "allowThreadAlert": {
                                        "type": "boolean"
                                    },
                                    "allowThreadAttachment": {
                                        "type": "boolean"
                                    },
                                    "allowThreadInlineImages": {
                                        "type": "boolean"
                                    },
                                    "allowMessageFullDelete": {
                                        "type": "boolean"
                                    },
                                    "allowMessageDeleteIn": {
                                        "description": "Time window (seconds) within which a message can be deleted. `0` disables deletion.",
                                        "type": "integer",
                                        "example": 120
                                    },
                                    "allowUserImmediatelyCreate": {
                                        "type": "boolean"
                                    },
                                    "allowUserAutoCreate": {
                                        "type": "boolean"
                                    },
                                    "allowUserAutoUpdate": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Entity:Project"
                                        },
                                        "meta": {
                                            "properties": {
                                                "updated": {
                                                    "description": "Keys that were actually applied (after subscription whitelist).",
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/threads/{code}/": {
            "get": {
                "tags": [
                    "Thread"
                ],
                "summary": "GET /threads/{code}/ — detail vlákna podle code. Podporuje volitelné\n`?expand=messages` pro plný detail včetně zpráv a příloh.",
                "description": "Get a thread by its `code`. Pass `?expand=messages` to include the full message list and attachments in a single response.",
                "operationId": "5d0b9cb347f4144930043452481529a8",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Thread code — the client-side primary identifier (e.g. \"ORDER-123\").",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "ORDER-123"
                        }
                    },
                    {
                        "name": "expand",
                        "in": "query",
                        "description": "Comma-separated list of resources to expand. Supported: `messages`.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "messages"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Entity:Thread"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Response:Meta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/users/": {
            "get": {
                "tags": [
                    "User"
                ],
                "description": "List project users. Filter by `state` (default = active). Pass `code` to look up a single user by their project-local code; result is still returned as an array (empty if not found).",
                "operationId": "b1b9c2941b1c2aa4f753cc4c575d40e4",
                "parameters": [
                    {
                        "name": "state",
                        "in": "query",
                        "description": "User state filter: `active` | `suspended` | `deleted` | `demo` | `all`. Defaults to `active` when omitted.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "active"
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Exact user code lookup. Takes precedence over `state` filter. Returns an array with 0 or 1 item.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "employee-42"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Entity:User"
                                            }
                                        },
                                        "meta": {
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "example": 3
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "User"
                ],
                "description": "Create a new project user. If the active user limit for the current subscription is reached, the account is created in `suspended` state and `meta.warning` is set.",
                "operationId": "bcaca60656a485531c92a5be8ebf303e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "code",
                                    "name"
                                ],
                                "properties": {
                                    "code": {
                                        "description": "Unique user code within the project",
                                        "type": "string"
                                    },
                                    "name": {
                                        "description": "Display name",
                                        "type": "string"
                                    },
                                    "emailAddress": {
                                        "description": "Email address",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "avatarURL": {
                                        "description": "Avatar URL",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "readOnly": {
                                        "description": "Read-only account (cannot create messages)",
                                        "type": "boolean",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "409": {
                        "$ref": "#/components/responses/409"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "user": {
                                                    "$ref": "#/components/schemas/Entity:User"
                                                },
                                                "account": {
                                                    "$ref": "#/components/schemas/Entity:UserAccount"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Response:Meta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/users/{hash}/": {
            "get": {
                "tags": [
                    "User"
                ],
                "description": "Get a user by hash.",
                "operationId": "c5fa9119ec300a89b61201729c97e9ee",
                "parameters": [
                    {
                        "name": "hash",
                        "in": "path",
                        "description": "User hash",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:User:Hash"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Entity:User"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Response:Meta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "User"
                ],
                "description": "Soft-delete a user: sets state to `deleted`, records `deletedAt`, and anonymises `code`. Idempotent — repeated calls return `alreadyDeleted: true`.",
                "operationId": "9426a9b7e3750417cf92ff2f54c61179",
                "parameters": [
                    {
                        "name": "hash",
                        "in": "path",
                        "description": "User hash",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:User:Hash"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "alreadyDeleted": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "User"
                ],
                "description": "Partially update a user. Accepts any subset of `code`, `name`, `emailAddress`, `avatarURL`, `readOnly`. Demo users cannot be modified.",
                "operationId": "2523e8731c79e057ec1c58333c96e4d0",
                "parameters": [
                    {
                        "name": "hash",
                        "in": "path",
                        "description": "User hash",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:User:Hash"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "code": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "name": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "emailAddress": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "avatarURL": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "readOnly": {
                                        "type": "boolean",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "409": {
                        "$ref": "#/components/responses/409"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Entity:User"
                                        },
                                        "meta": {
                                            "properties": {
                                                "updated": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/customer/v1/users/{hash}/restore/": {
            "post": {
                "tags": [
                    "User"
                ],
                "description": "Restore a previously deleted or suspended user back to `active` state. Returns 409 when the active user limit for the current subscription would be exceeded.",
                "operationId": "4e4f09225be55c81c604679d93dc9255",
                "parameters": [
                    {
                        "name": "hash",
                        "in": "path",
                        "description": "User hash",
                        "required": true,
                        "schema": {
                            "$ref": "#/components/schemas/Entity:User:Hash"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/401"
                    },
                    "404": {
                        "$ref": "#/components/responses/404"
                    },
                    "409": {
                        "$ref": "#/components/responses/409"
                    },
                    "500": {
                        "$ref": "#/components/responses/500"
                    },
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "data": {
                                            "properties": {
                                                "restored": {
                                                    "type": "boolean"
                                                },
                                                "alreadyActive": {
                                                    "type": "boolean"
                                                },
                                                "user": {
                                                    "$ref": "#/components/schemas/Entity:User"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Response:Model:Thread": {
                "properties": {
                    "thread": {
                        "$ref": "#/components/schemas/Entity:Thread"
                    },
                    "messages": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Response:Model:Message"
                        }
                    }
                },
                "type": "object"
            },
            "Response:Model:Message": {
                "properties": {
                    "hash": {
                        "type": "string",
                        "example": "eVO6SY5kf5"
                    },
                    "message": {
                        "type": "string",
                        "example": "<p>Content of message in HTML</p>"
                    },
                    "user_hash": {
                        "$ref": "#/components/schemas/Entity:User:Hash"
                    },
                    "userName": {
                        "type": "string",
                        "example": "John Doe"
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "DateTimeInterface": {
                "properties": {
                    "date": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2025-05-01 14:30:00"
                    },
                    "timezone_type": {
                        "type": "integer",
                        "example": 3
                    },
                    "timezone": {
                        "type": "string",
                        "example": "UTC"
                    }
                },
                "type": "object"
            },
            "Timestamp": {
                "type": "number",
                "default": 1741210981
            },
            "Response:Status": {
                "type": "string",
                "default": "success",
                "enum": [
                    "success",
                    "error"
                ]
            },
            "Response:Data": {
                "type": "object"
            },
            "Response:Error": {
                "properties": {
                    "code": {
                        "type": "string",
                        "example": "ERROR_CODE"
                    },
                    "message": {
                        "type": "string",
                        "example": "Human error description"
                    },
                    "details": {
                        "type": "object",
                        "example": "{}",
                        "nullable": true
                    }
                },
                "type": "object",
                "nullable": true
            },
            "Response:Meta": {
                "properties": {
                    "correlation_id": {
                        "type": "string",
                        "example": "5c239d31-5f19-4592-8c47-6d86ce848518"
                    },
                    "timestamp": {
                        "type": "integer",
                        "example": 1741210981
                    }
                },
                "type": "object"
            },
            "Response:Meta:Paginator": {
                "properties": {
                    "currentPage": {
                        "type": "integer",
                        "example": 1
                    },
                    "perPage": {
                        "type": "integer",
                        "example": 10
                    },
                    "totalPages": {
                        "type": "integer",
                        "example": 3
                    },
                    "totalItems": {
                        "type": "integer",
                        "example": 25
                    }
                },
                "type": "object"
            },
            "Entity:CustomerAccount": {
                "description": "Customer account",
                "properties": {
                    "displayName": {
                        "title": "User name",
                        "type": "string"
                    },
                    "emailAddress": {
                        "title": "Email address",
                        "type": "string",
                        "example": "john.doe@example.com",
                        "nullable": true
                    },
                    "isEmailAddressVerified": {
                        "title": "Verified address",
                        "type": "boolean"
                    },
                    "phoneNumber": {
                        "title": "Email address",
                        "type": "string",
                        "example": "john.doe@example.com",
                        "nullable": true
                    },
                    "avatarURL": {
                        "type": "string",
                        "nullable": true
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:Customer": {
                "description": "Customer",
                "properties": {
                    "displayName": {
                        "title": "User name",
                        "type": "string",
                        "example": "John Doe"
                    },
                    "emailAddress": {
                        "title": "Email address",
                        "type": "string",
                        "example": "john.doe@example.com",
                        "nullable": true
                    },
                    "isEmailAddressVerified": {
                        "title": "Verified address",
                        "type": "boolean"
                    },
                    "phoneNumber": {
                        "title": "Phone number",
                        "type": "string",
                        "nullable": true
                    },
                    "avatarURL": {
                        "type": "string",
                        "nullable": true
                    },
                    "addressStreet": {
                        "title": "Street address",
                        "type": "string",
                        "nullable": true
                    },
                    "addressCity": {
                        "title": "City",
                        "type": "string",
                        "nullable": true
                    },
                    "addressZip": {
                        "title": "ZIP code",
                        "type": "string",
                        "nullable": true
                    },
                    "addressCountry": {
                        "title": "Country code",
                        "nullable": true
                    },
                    "contactName": {
                        "title": "First name",
                        "type": "string",
                        "nullable": true
                    },
                    "contactSurname": {
                        "title": "Last name",
                        "type": "string",
                        "nullable": true
                    },
                    "contactCompany": {
                        "title": "Company name or full name",
                        "type": "string",
                        "nullable": true
                    },
                    "idNumber": {
                        "title": "Registration number",
                        "type": "string",
                        "nullable": true
                    },
                    "vatNumber": {
                        "title": "VAT number",
                        "type": "string",
                        "nullable": true
                    },
                    "vatStatus": {
                        "title": "VAT payer"
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:Message": {
                "properties": {
                    "thread_hash": {
                        "type": "string"
                    },
                    "user_hash": {
                        "type": "string"
                    },
                    "hash": {
                        "$ref": "#/components/schemas/Entity:Message:Hash"
                    },
                    "state": {
                        "description": "Message state",
                        "type": "string",
                        "example": "message|deleted"
                    },
                    "message": {
                        "description": "Message content in HTML format",
                        "type": "string",
                        "example": "<p>This is a message</p>"
                    },
                    "messagePreview": {
                        "description": "Message preview in HTML format",
                        "type": "string",
                        "example": "<span data-tag='p'>This is a message</span>"
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:Message:Hash": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9]{10}$",
                "example": "eVO6SY5kf5"
            },
            "MessageAttachment": {
                "properties": {
                    "message_hash": {
                        "type": "string",
                        "example": "PgGt86YqZv"
                    },
                    "hash": {
                        "type": "string",
                        "example": "d972d36742e555d09501a01afadd17dd"
                    },
                    "state": {
                        "$ref": "#/components/schemas/StorageItemStateEnum"
                    },
                    "fileName": {
                        "type": "string",
                        "example": "144000000144822565.pdf"
                    },
                    "fileSize": {
                        "type": "integer",
                        "example": 190938
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/DateTimeInterface"
                    }
                },
                "type": "object"
            },
            "Entity:Order": {
                "description": "Order",
                "properties": {
                    "customer_id": {
                        "title": "Customer ID",
                        "type": "integer"
                    },
                    "emailAddress": {
                        "title": "Email address",
                        "type": "string",
                        "example": "john.doe@example.com"
                    },
                    "phoneNumber": {
                        "title": "Phone number",
                        "type": "string",
                        "nullable": true
                    },
                    "addressStreet": {
                        "title": "Street address",
                        "type": "string",
                        "nullable": true
                    },
                    "addressCity": {
                        "title": "City",
                        "type": "string",
                        "nullable": true
                    },
                    "addressZip": {
                        "title": "ZIP code",
                        "type": "string",
                        "nullable": true
                    },
                    "addressCountry": {
                        "title": "Country code (ISO 3166-1 alpha-2)",
                        "nullable": true
                    },
                    "contactName": {
                        "title": "Contact first name",
                        "type": "string",
                        "nullable": true
                    },
                    "contactSurname": {
                        "title": "Contact last name",
                        "type": "string",
                        "nullable": true
                    },
                    "contactCompany": {
                        "title": "Company name",
                        "type": "string",
                        "nullable": true
                    },
                    "idNumber": {
                        "title": "Registration number",
                        "type": "string",
                        "nullable": true
                    },
                    "vatNumber": {
                        "title": "VAT number",
                        "type": "string",
                        "nullable": true
                    },
                    "vatStatus": {
                        "title": "VAT status"
                    },
                    "priceBase": {
                        "title": "Price base (without VAT)",
                        "type": "number",
                        "format": "float",
                        "example": "100.00"
                    },
                    "priceVat": {
                        "title": "VAT amount",
                        "type": "number",
                        "format": "float",
                        "example": "21.00"
                    },
                    "priceTotal": {
                        "title": "Total price (with VAT)",
                        "type": "number",
                        "format": "float",
                        "example": "121.00"
                    },
                    "createdAt": {
                        "title": "Created at",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "Entity:OrderItem": {
                "description": "Order item",
                "properties": {
                    "order_id": {
                        "title": "Order ID",
                        "type": "integer"
                    },
                    "project_id": {
                        "title": "Project ID",
                        "type": "integer",
                        "nullable": true
                    },
                    "subscription_id": {
                        "title": "Subscription ID",
                        "type": "integer",
                        "nullable": true
                    },
                    "subscriptionAddon_id": {
                        "title": "Subscription Addon ID",
                        "type": "integer",
                        "nullable": true
                    },
                    "title": {
                        "title": "Item title",
                        "type": "string",
                        "nullable": true
                    },
                    "amount": {
                        "title": "Amount",
                        "type": "number",
                        "format": "float",
                        "example": "1.00"
                    },
                    "vatRate": {
                        "title": "VAT rate (%)",
                        "type": "number",
                        "format": "float",
                        "example": "21.00"
                    },
                    "price": {
                        "title": "Unit price",
                        "type": "number",
                        "format": "float",
                        "example": "100.00"
                    },
                    "priceType": {
                        "title": "Price type"
                    },
                    "priceBase": {
                        "title": "Price base (without VAT)",
                        "type": "number",
                        "format": "float",
                        "example": "100.00"
                    },
                    "priceVat": {
                        "title": "VAT amount",
                        "type": "number",
                        "format": "float",
                        "example": "21.00"
                    },
                    "priceTotal": {
                        "title": "Total price (with VAT)",
                        "type": "number",
                        "format": "float",
                        "example": "121.00"
                    }
                },
                "type": "object"
            },
            "Entity:Project": {
                "properties": {
                    "name": {
                        "title": "Project name",
                        "type": "string",
                        "example": "Company ltd."
                    },
                    "state": {
                        "title": "Project state"
                    },
                    "subscriptionState": {
                        "title": "Project subscriptioin state"
                    },
                    "customCSSPath": {
                        "title": "URL of custom CSS file",
                        "type": "string",
                        "example": "//www.example.com/css/style.css",
                        "nullable": true
                    },
                    "allowThreadSubscribe": {
                        "title": "allowThreadSubscribe",
                        "type": "boolean"
                    },
                    "allowThreadAlert": {
                        "title": "allowThreadAlert",
                        "type": "boolean"
                    },
                    "allowThreadAttachment": {
                        "title": "allowThreadAttachment",
                        "type": "boolean"
                    },
                    "allowThreadInlineImages": {
                        "title": "allowThreadInlineImages",
                        "type": "boolean"
                    },
                    "allowMessageFullDelete": {
                        "title": "allowMessageFullDelete",
                        "type": "boolean"
                    },
                    "allowMessageDeleteIn": {
                        "title": "allowMessageDeleteIn",
                        "type": "number"
                    },
                    "attachmentMaxSize": {
                        "title": "Max. size of a single attachment in MB",
                        "type": "number"
                    },
                    "allowUserAutoCreate": {
                        "title": "allowUserAutoCreate",
                        "type": "boolean"
                    },
                    "allowUserImmediatelyCreate": {
                        "title": "allowUserImmediatelyCreate",
                        "type": "boolean"
                    },
                    "allowUserAutoUpdate": {
                        "title": "allowUserAutoUpdate",
                        "type": "boolean"
                    },
                    "allowAPI": {
                        "title": "allowAPI",
                        "type": "boolean"
                    },
                    "isActive": {
                        "description": "true = active account, false = disabled account",
                        "type": "boolean"
                    },
                    "isDeleted": {
                        "description": "if a project is marked as deleted",
                        "type": "boolean"
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:ProjectMeta": {
                "properties": {
                    "description": {
                        "title": "Custom description",
                        "type": "string",
                        "nullable": true
                    },
                    "tagName": {
                        "title": "Tag label",
                        "type": "string",
                        "nullable": true
                    },
                    "tagColor": {
                        "title": "Tag color",
                        "type": "integer",
                        "nullable": true
                    },
                    "userDefaultAvatar": {
                        "title": "Avatar",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "Entity:SubscriptionAddon": {
                "description": "Subscription addon",
                "type": "object"
            },
            "Entity:SubscriptionAddonPricingEntity": {
                "description": "Subscription addon price",
                "type": "object"
            },
            "Entity:Subscription": {
                "description": "Subscription",
                "type": "object"
            },
            "Entity:SubscriptionPricing": {
                "description": "Subscription price",
                "type": "object"
            },
            "Entity:Thread": {
                "properties": {
                    "code": {
                        "description": "Unique thread code from the application (max length 100). Allowed characters: a-z A-Z 0-9 _-",
                        "type": "string",
                        "example": "ORDER-1234-A"
                    },
                    "name": {
                        "description": "Thread name",
                        "type": "string",
                        "example": "Order 1234"
                    },
                    "url": {
                        "description": "URL of the object the thread refers to (e.g. link to the order detail)",
                        "type": "string",
                        "example": "http://www.example.com/order/1234/",
                        "nullable": true
                    },
                    "hash": {
                        "$ref": "#/components/schemas/Entity:Thread:Hash"
                    },
                    "attributes": {
                        "description": "Thread attributes (max 20)",
                        "type": "array",
                        "items": {
                            "properties": {
                                "key": {
                                    "type": "string"
                                },
                                "value": {
                                    "type": "string"
                                },
                                "type": {
                                    "type": "integer"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:Thread:Hash": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9]{10}$",
                "example": "eVO6SY5kf5"
            },
            "Entity:ThreadNotification": {
                "properties": {
                    "userDescription": {
                        "description": "User note",
                        "type": "string",
                        "nullable": true
                    },
                    "scheduledAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:UserAccount": {
                "description": "Authenticated project user.",
                "properties": {
                    "name": {
                        "title": "User name",
                        "type": "string"
                    },
                    "code": {
                        "title": "Unique code of user in project",
                        "type": "string"
                    },
                    "hash": {
                        "$ref": "#/components/schemas/Entity:User:Hash"
                    },
                    "emailAddress": {
                        "title": "Email address",
                        "type": "string",
                        "nullable": true
                    },
                    "avatarURL": {
                        "title": "URL of avatar",
                        "type": "string",
                        "nullable": true
                    },
                    "readOnly": {
                        "title": "Read-only flag. All users except active accounts (state=active) are readOnly",
                        "type": "boolean"
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:User": {
                "description": "Project user.",
                "properties": {
                    "name": {
                        "title": "User name",
                        "type": "string",
                        "example": "John Doe"
                    },
                    "code": {
                        "title": "Unique code of user in project. (max lenght is 100). Allowed chars: a-z A-Z 0-9 _-",
                        "description": "Can be visible only for administrator",
                        "type": "string",
                        "example": "USER-1"
                    },
                    "hash": {
                        "$ref": "#/components/schemas/Entity:User:Hash"
                    },
                    "emailAddress": {
                        "title": "Email address",
                        "type": "string",
                        "example": "john.doe@example.com",
                        "nullable": true
                    },
                    "avatarURL": {
                        "title": "URL of avatar",
                        "type": "string",
                        "example": "https://gravatar.com/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3?s=400&d=robohash&r=x",
                        "nullable": true
                    },
                    "readOnly": {
                        "title": "Read-only flag. All users except active accounts (state=active) are readOnly",
                        "type": "boolean"
                    },
                    "createdAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    },
                    "deletedAt": {
                        "$ref": "#/components/schemas/Timestamp"
                    }
                },
                "type": "object"
            },
            "Entity:User:Hash": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_-]{10}$",
                "example": "dZ8x9XcVTx"
            },
            "Entity:UserMeta": {
                "properties": {
                    "internalNote": {
                        "title": "Internal note for administration",
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "StorageItemStateEnum": {
                "description": "Storage item state",
                "type": "string",
                "enum": [
                    "waiting",
                    "error",
                    "done",
                    "deleted"
                ]
            }
        },
        "responses": {
            "200": {
                "description": "OK",
                "content": {
                    "application/json": {
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "error"
                                },
                                "error": {
                                    "type": "object",
                                    "allOf": [
                                        {
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/Response:Error"
                                                },
                                                {
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "example": "UNAUTHORIZED"
                                                        },
                                                        "message": {
                                                            "type": "string",
                                                            "example": "Missing authorization token"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            },
                            "type": "object"
                        }
                    }
                }
            },
            "404": {
                "description": "Not Found",
                "content": {
                    "application/json": {
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "error"
                                },
                                "error": {
                                    "type": "object",
                                    "allOf": [
                                        {
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/Response:Error"
                                                },
                                                {
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "example": "NOT_FOUND"
                                                        },
                                                        "message": {
                                                            "type": "string",
                                                            "example": "Resource not found"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            },
                            "type": "object"
                        }
                    }
                }
            },
            "401": {
                "description": "Unauthorized",
                "content": {
                    "application/json": {
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "error"
                                },
                                "error": {
                                    "type": "object",
                                    "allOf": [
                                        {
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/Response:Error"
                                                },
                                                {
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "example": "UNAUTHORIZED"
                                                        },
                                                        "message": {
                                                            "type": "string",
                                                            "example": "Missing authorization token"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            },
                            "type": "object"
                        }
                    }
                }
            },
            "409": {
                "description": "Conflict",
                "content": {
                    "application/json": {
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "error"
                                },
                                "error": {
                                    "type": "object",
                                    "allOf": [
                                        {
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/Response:Error"
                                                },
                                                {
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "example": "USER_ALREADY_EXISTS"
                                                        },
                                                        "message": {
                                                            "type": "string",
                                                            "example": "User with this code already exists"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            },
                            "type": "object"
                        }
                    }
                }
            },
            "500": {
                "description": "Internal server error",
                "content": {
                    "application/json": {
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "error"
                                },
                                "error": {
                                    "type": "object",
                                    "allOf": [
                                        {
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/Response:Error"
                                                },
                                                {
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "example": "INTERNAL_SERVER_ERROR"
                                                        },
                                                        "message": {
                                                            "type": "string",
                                                            "example": "Internal server error"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            },
                            "type": "object"
                        }
                    }
                }
            }
        },
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "description": "Client and user authorization. Format 'bearerToken:userCode@origin'. Minimum required is bearerToken",
                "scheme": "bearer"
            }
        }
    },
    "security": [
        {
            "BearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Message",
            "description": "Message"
        },
        {
            "name": "Project",
            "description": "Project"
        },
        {
            "name": "Thread",
            "description": "Thread"
        },
        {
            "name": "User",
            "description": "User"
        }
    ]
}