{
    "openapi": "3.0.0",
    "info": {
        "title": "Digiclose API",
        "description": "Die Digiclose API ermöglicht die Integration externer Anwendungen mit der Digiclose-Plattform.\n\n## Authentifizierung\n\nAlle API-Aufrufe müssen authentifiziert werden. Verwenden Sie einen API-Schlüssel im Header:\n\n```\nAuthorization: YOUR_API_KEY\n```\n\noder\n\n```\nX-API-KEY: YOUR_API_KEY\n```\n\nAPI-Schlüssel können in den [Einstellungen](/settings/integration#/api-tab) verwaltet werden.\n\n## Rate Limiting\n\nDie API ist auf 100 Anfragen pro Minute limitiert.\n\n## Fehlerbehandlung\n\nBei Fehlern gibt die API einen entsprechenden HTTP-Status-Code zurück:\n\n- `400` - Ungültige Anfrage\n- `401` - Nicht authentifiziert\n- `403` - Keine Berechtigung\n- `404` - Ressource nicht gefunden\n- `429` - Zu viele Anfragen\n- `500` - Serverfehler\n",
        "contact": {
            "name": "Digiclose Support",
            "email": "support@digiclose.ai"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://app.digiclose.ai/api/v1",
            "description": "Production Server"
        },
        {
            "url": "https://digiclose.ddev.site/api/v1",
            "description": "Development Server"
        }
    ],
    "paths": {
        "/contacts": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "List contacts",
                "description": "Returns a paginated list of contacts for the company. Supports search and filtering.",
                "operationId": "970b5ecd77deb827f293c797ef3ae72f",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination (default: 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "results",
                        "in": "query",
                        "description": "Number of results per page (default: 25, max: 25)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 25,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term to filter contacts by name, email, phone, or company",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "exact",
                        "in": "query",
                        "description": "Set to 1 for exact match search (default: 0 for partial match)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 0,
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of contacts retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 123
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "full_name": {
                                                "type": "string",
                                                "example": "John Doe"
                                            },
                                            "email": {
                                                "type": "string",
                                                "format": "email",
                                                "example": "john@example.com"
                                            },
                                            "phone": {
                                                "type": "string",
                                                "example": "+4915123456789"
                                            },
                                            "company": {
                                                "type": "string",
                                                "example": "Acme Corp"
                                            },
                                            "formatted": {
                                                "type": "string",
                                                "example": "John Doe (Acme Corp) E-Mail: john@example.com"
                                            },
                                            "creator_id": {
                                                "type": "integer",
                                                "nullable": true
                                            },
                                            "creator_name": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "operator_id": {
                                                "type": "integer",
                                                "nullable": true
                                            },
                                            "operator_name": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "tags": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            },
                                            "pipelines": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            },
                                            "fields": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            },
                                            "values": {
                                                "type": "object"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Create contact",
                "description": "Creates a new contact with the provided field values. If a contact with the same email or phone already exists, the existing contact will be updated instead. At least an email or phone number is required.",
                "operationId": "bd61fd8b2581fdfdcb7c83b232572623",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "fields"
                                ],
                                "properties": {
                                    "fields": {
                                        "description": "Contact field values (use field internal names)",
                                        "properties": {
                                            "firstname": {
                                                "type": "string",
                                                "example": "John"
                                            },
                                            "lastname": {
                                                "type": "string",
                                                "example": "Doe"
                                            },
                                            "email": {
                                                "type": "string",
                                                "format": "email",
                                                "example": "john@example.com"
                                            },
                                            "phone": {
                                                "type": "string",
                                                "example": "+4915123456789"
                                            },
                                            "company": {
                                                "type": "string",
                                                "example": "Acme Corp"
                                            },
                                            "country": {
                                                "type": "string",
                                                "example": "DE"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "source": {
                                        "description": "Source of the contact",
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "pipeline_id": {
                                        "description": "Pipeline to add contact to",
                                        "type": "integer"
                                    },
                                    "deal_phase_id": {
                                        "description": "Deal phase within the pipeline",
                                        "type": "integer"
                                    },
                                    "team_id": {
                                        "description": "Team to assign contact to",
                                        "type": "integer"
                                    },
                                    "member_id": {
                                        "description": "Specific team member to assign",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Contact created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "description": "Created contact ID",
                                            "type": "integer"
                                        },
                                        "pipeline_id": {
                                            "type": "integer",
                                            "nullable": true
                                        },
                                        "_links": {
                                            "properties": {
                                                "contact": {
                                                    "type": "object"
                                                },
                                                "pipeline": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Invalid data or missing required fields"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/contacts/{contact_id}": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Get contact",
                "description": "Retrieves details of a specific contact by ID.",
                "operationId": "e32c25c623bee29fe29022b39c33e907",
                "parameters": [
                    {
                        "name": "contact_id",
                        "in": "path",
                        "description": "Unique identifier for the contact",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "contact": {
                                            "description": "Contact field values",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Contact not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Update contact",
                "description": "Updates an existing contact with the provided field values. Use \"OC_DELETE_COLUMN\" as value to clear a field. Empty strings are ignored.",
                "operationId": "d352c5daf3d6a87bea91b502b7d34ba8",
                "parameters": [
                    {
                        "name": "contact_id",
                        "in": "path",
                        "description": "Unique identifier for the contact",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "fields"
                                ],
                                "properties": {
                                    "fields": {
                                        "description": "Contact field values to update (use field internal names). Use \"OC_DELETE_COLUMN\" to clear a field.",
                                        "properties": {
                                            "firstname": {
                                                "type": "string",
                                                "example": "John"
                                            },
                                            "lastname": {
                                                "type": "string",
                                                "example": "Doe"
                                            },
                                            "email": {
                                                "type": "string",
                                                "format": "email",
                                                "example": "john@example.com"
                                            },
                                            "phone": {
                                                "type": "string",
                                                "example": "+4915123456789"
                                            },
                                            "company": {
                                                "type": "string",
                                                "example": "Acme Corp"
                                            },
                                            "country": {
                                                "type": "string",
                                                "example": "DE"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "pipeline_id": {
                                        "description": "Pipeline to add/move contact to",
                                        "type": "integer"
                                    },
                                    "deal_phase_id": {
                                        "description": "Deal phase within the pipeline",
                                        "type": "integer"
                                    },
                                    "team_id": {
                                        "description": "Team to assign contact to",
                                        "type": "integer"
                                    },
                                    "member_id": {
                                        "description": "Specific team member to assign",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Contact updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "description": "Updated contact ID",
                                            "type": "integer"
                                        },
                                        "fields": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "_links": {
                                            "properties": {
                                                "contact": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Invalid data or missing required fields"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Contact not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/contacts/{contact_id}/notices": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Get contact notices",
                "description": "Retrieves all notes/notices associated with a specific contact.",
                "operationId": "bfadfa7e62a34c9b674c94b865317522",
                "parameters": [
                    {
                        "name": "contact_id",
                        "in": "path",
                        "description": "Unique identifier for the contact",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notices retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "by_user_id": {
                                                "type": "integer",
                                                "nullable": true
                                            },
                                            "by_user_name": {
                                                "type": "string",
                                                "example": "John Doe"
                                            },
                                            "notice_type": {
                                                "type": "string",
                                                "example": "Note"
                                            },
                                            "notice_text": {
                                                "type": "string",
                                                "example": "Customer called about order"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Contact or notices not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/contacts/{contact_id}/tasks": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Get contact tasks",
                "description": "Retrieves all tasks associated with a specific contact.",
                "operationId": "93b4273d8591627c1bef85b3a6546714",
                "parameters": [
                    {
                        "name": "contact_id",
                        "in": "path",
                        "description": "Unique identifier for the contact",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tasks retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "description": "Task object",
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Contact or tasks not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/contacts/fieldset": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Get contact field definitions",
                "description": "Returns all available contact fields for the company, including field types, options, and validation rules. Use these field internal names when creating or updating contacts.",
                "operationId": "2fb79e89b3adbb5ade4d0ac6af9d2408",
                "responses": {
                    "200": {
                        "description": "Field definitions retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "First Name"
                                            },
                                            "internal_name": {
                                                "description": "Use this name in API requests",
                                                "type": "string",
                                                "example": "firstname"
                                            },
                                            "type": {
                                                "type": "string",
                                                "enum": [
                                                    "text",
                                                    "email",
                                                    "phone",
                                                    "date",
                                                    "number",
                                                    "dropdown",
                                                    "textarea",
                                                    "url",
                                                    "currency"
                                                ],
                                                "example": "text"
                                            },
                                            "is_required": {
                                                "type": "boolean",
                                                "example": false
                                            },
                                            "options": {
                                                "description": "Available options for dropdown fields",
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/pipelines": {
            "get": {
                "tags": [
                    "Pipelines"
                ],
                "summary": "List pipelines",
                "description": "Returns a list of all pipelines for the company.",
                "operationId": "26c39f495f00e2e710f2ae70353af694",
                "responses": {
                    "200": {
                        "description": "List of pipelines retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Sales Pipeline"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "No pipelines found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/pipelines/{pipeline_id}": {
            "get": {
                "tags": [
                    "Pipelines"
                ],
                "summary": "Get pipeline",
                "description": "Retrieves details of a specific pipeline including its deal phases.",
                "operationId": "4afe100c2559b5cd416a5ed7ea796726",
                "parameters": [
                    {
                        "name": "pipeline_id",
                        "in": "path",
                        "description": "Unique identifier for the pipeline",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Pipeline retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "pipeline": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Sales Pipeline"
                                                },
                                                "deal_phases": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "name": {
                                                                "type": "string",
                                                                "example": "New Lead"
                                                            },
                                                            "position": {
                                                                "type": "integer",
                                                                "example": 1
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Pipeline not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/pipelines/{pipeline_id}/deal-phases": {
            "get": {
                "tags": [
                    "Pipelines"
                ],
                "summary": "Get pipeline deal phases",
                "description": "Retrieves all deal phases for a specific pipeline.",
                "operationId": "c0cc837256e81ec364f9a6ebd0e4bf1f",
                "parameters": [
                    {
                        "name": "pipeline_id",
                        "in": "path",
                        "description": "Unique identifier for the pipeline",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deal phases retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "New Lead"
                                            },
                                            "position": {
                                                "type": "integer",
                                                "example": 1
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing pipeline_id parameter"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "No deal phases found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/products": {
            "get": {
                "tags": [
                    "Products"
                ],
                "summary": "List products",
                "description": "Returns a paginated list of all products for the company.",
                "operationId": "12ebd985f779faca741ae1603515ac98",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination (default: 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "results",
                        "in": "query",
                        "description": "Number of results per page (default: 25, max: 50)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 50,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of products retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Premium Package"
                                            },
                                            "short_description": {
                                                "type": "string",
                                                "example": "Our best product"
                                            },
                                            "description": {
                                                "type": "string",
                                                "example": "Full product description"
                                            },
                                            "price": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 99.99
                                            },
                                            "vat": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 19
                                            },
                                            "total_price": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 118.99
                                            },
                                            "currency": {
                                                "type": "string",
                                                "example": "eur"
                                            },
                                            "active": {
                                                "type": "boolean",
                                                "example": true
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Products"
                ],
                "summary": "Create product",
                "description": "Creates a new product with the provided details.",
                "operationId": "93091590fd39dfbbd242fc70774070c7",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "short_description",
                                    "description",
                                    "price",
                                    "vat"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Premium Package"
                                    },
                                    "short_description": {
                                        "type": "string",
                                        "example": "Our best product"
                                    },
                                    "description": {
                                        "type": "string",
                                        "example": "Full product description with all features"
                                    },
                                    "price": {
                                        "description": "Net price",
                                        "type": "number",
                                        "format": "float",
                                        "example": 99.99
                                    },
                                    "vat": {
                                        "description": "VAT percentage",
                                        "type": "number",
                                        "format": "float",
                                        "example": 19
                                    },
                                    "currency": {
                                        "description": "Currency (defaults to company currency)",
                                        "type": "string",
                                        "enum": [
                                            "eur",
                                            "usd"
                                        ],
                                        "example": "eur"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Product created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "product_id": {
                                            "type": "integer",
                                            "example": 123
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required fields or invalid values"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/products/recent": {
            "get": {
                "tags": [
                    "Products"
                ],
                "summary": "List recent products",
                "description": "Returns the 25 most recent products for the company.",
                "operationId": "8c41fa51c1a307ac3966d47637d5432d",
                "responses": {
                    "200": {
                        "description": "List of recent products retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Premium Package"
                                            },
                                            "price": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 99.99
                                            },
                                            "currency": {
                                                "type": "string",
                                                "example": "eur"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "No products found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/products/{product_id}": {
            "get": {
                "tags": [
                    "Products"
                ],
                "summary": "Get product",
                "description": "Retrieves details of a specific product by ID.",
                "operationId": "33e38b6cf284dab3a2ebf755c455a706",
                "parameters": [
                    {
                        "name": "product_id",
                        "in": "path",
                        "description": "Unique identifier for the product",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Product retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "product": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Premium Package"
                                                },
                                                "short_description": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "price": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 99.99
                                                },
                                                "vat": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 19
                                                },
                                                "total_price": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 118.99
                                                },
                                                "currency": {
                                                    "type": "string",
                                                    "example": "eur"
                                                },
                                                "active": {
                                                    "type": "boolean",
                                                    "example": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Product not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/tasks": {
            "get": {
                "tags": [
                    "Tasks"
                ],
                "summary": "List tasks",
                "description": "Returns a list of all tasks for the company.",
                "operationId": "7fc9b13e39ac09ab621b8d504e8dadcf",
                "responses": {
                    "200": {
                        "description": "List of tasks retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "category_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "category_name": {
                                                "type": "string",
                                                "example": "Follow-up"
                                            },
                                            "description": {
                                                "type": "string",
                                                "example": "Call customer about proposal"
                                            },
                                            "contact_id": {
                                                "type": "integer",
                                                "example": 123
                                            },
                                            "assignee_id": {
                                                "type": "integer",
                                                "example": 456
                                            },
                                            "assignee_name": {
                                                "type": "string",
                                                "example": "John Doe"
                                            },
                                            "due_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "status": {
                                                "type": "string",
                                                "example": "open"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "No tasks found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Create task",
                "description": "Creates a new task with the provided details. Triggers a webhook event when successfully created.",
                "operationId": "5761764a8972bc8db6087f4b77dc1748",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "creator_id",
                                    "category_id",
                                    "description",
                                    "assignee_id",
                                    "due_at",
                                    "contact_id"
                                ],
                                "properties": {
                                    "creator_id": {
                                        "description": "ID of the user creating the task",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "category_id": {
                                        "description": "ID of the task category",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "description": {
                                        "description": "Task description",
                                        "type": "string",
                                        "example": "Call customer about proposal"
                                    },
                                    "assignee_id": {
                                        "description": "ID of the user assigned to the task",
                                        "type": "integer",
                                        "example": 2
                                    },
                                    "due_at": {
                                        "description": "Due date and time",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2024-12-31 10:00:00"
                                    },
                                    "contact_id": {
                                        "description": "ID of the associated contact",
                                        "type": "integer",
                                        "example": 123
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Task created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "task_id": {
                                            "type": "integer",
                                            "example": 789
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required fields"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/tasks/recent": {
            "get": {
                "tags": [
                    "Tasks"
                ],
                "summary": "List recent tasks",
                "description": "Returns the most recent tasks. Useful for Zapier integrations.",
                "operationId": "ccef3ade94a73c1be73a40ca387ffcb8",
                "parameters": [
                    {
                        "name": "results",
                        "in": "query",
                        "description": "Number of results to return (default: 10)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of recent tasks retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "description": {
                                                "type": "string",
                                                "example": "Call customer"
                                            },
                                            "due_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/tasks/{task_id}": {
            "get": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Get task",
                "description": "Retrieves details of a specific task by ID.",
                "operationId": "bd42de28e04c658d5812c081b8385ca5",
                "parameters": [
                    {
                        "name": "task_id",
                        "in": "path",
                        "description": "Unique identifier for the task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "task": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "category_id": {
                                                    "type": "integer"
                                                },
                                                "category_name": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "contact_id": {
                                                    "type": "integer"
                                                },
                                                "assignee_id": {
                                                    "type": "integer"
                                                },
                                                "assignee_name": {
                                                    "type": "string"
                                                },
                                                "due_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Task not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/tasks/categories": {
            "get": {
                "tags": [
                    "Tasks"
                ],
                "summary": "List task categories",
                "description": "Returns a list of all task categories for the company.",
                "operationId": "1e9367f821d0d1fc9300aa1846b0b8ea",
                "responses": {
                    "200": {
                        "description": "List of task categories retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Follow-up"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "No task categories found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Create task category",
                "description": "Creates a new task category with the provided name.",
                "operationId": "61880a51d734e61c51d56285e68f6cd0",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "description": "Name of the task category",
                                        "type": "string",
                                        "example": "Follow-up"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Task category created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "category_id": {
                                            "type": "integer",
                                            "example": 123
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required fields"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/teams": {
            "get": {
                "tags": [
                    "Teams"
                ],
                "summary": "List teams",
                "description": "Returns a list of all teams for the company.",
                "operationId": "26ed00643355c56b2ce89f9dc688abda",
                "responses": {
                    "200": {
                        "description": "List of teams retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Sales Team"
                                            },
                                            "assignment_method": {
                                                "type": "string",
                                                "example": "round_robin"
                                            },
                                            "members": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "No teams found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Teams"
                ],
                "summary": "Create team",
                "description": "Creates a new team with the provided name. Assignment method defaults to round-robin.",
                "operationId": "6fbcc238197bee08e78602d99a798678",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "team_name"
                                ],
                                "properties": {
                                    "team_name": {
                                        "description": "Name of the team",
                                        "type": "string",
                                        "example": "Sales Team"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Team created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "team_id": {
                                            "type": "integer",
                                            "example": 123
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required fields"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/teams/deal-phase/{phase_id}": {
            "get": {
                "tags": [
                    "Teams"
                ],
                "summary": "List teams for deal phase",
                "description": "Returns a list of teams that have permission to access a specific deal phase.",
                "operationId": "8594d00f900b56159afc7d55247f22d8",
                "parameters": [
                    {
                        "name": "phase_id",
                        "in": "path",
                        "description": "Unique identifier for the deal phase",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of teams retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Sales Team"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/teams/{team_id}": {
            "get": {
                "tags": [
                    "Teams"
                ],
                "summary": "Get team",
                "description": "Retrieves details of a specific team including its members.",
                "operationId": "65ae758b3f5dbe70cf90d79bb4df68d5",
                "parameters": [
                    {
                        "name": "team_id",
                        "in": "path",
                        "description": "Unique identifier for the team",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "team": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Sales Team"
                                                },
                                                "assignment_method": {
                                                    "type": "string",
                                                    "example": "round_robin"
                                                },
                                                "members": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Team not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/teams/{team_id}/members": {
            "get": {
                "tags": [
                    "Teams"
                ],
                "summary": "Get team members",
                "description": "Retrieves all members of a specific team.",
                "operationId": "05694c11f71c78862882df2093dc17db",
                "parameters": [
                    {
                        "name": "team_id",
                        "in": "path",
                        "description": "Unique identifier for the team",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team members retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "John Doe"
                                            },
                                            "email": {
                                                "type": "string",
                                                "format": "email",
                                                "example": "john@example.com"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Team not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/transactions": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "List transactions",
                "description": "Returns a paginated list of all transactions for the company.",
                "operationId": "ed45dd74cbcce360fee7c918d2d1feef",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination (default: 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "results",
                        "in": "query",
                        "description": "Number of results per page (default: 25, max: 50)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 50,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of transactions retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "contact_id": {
                                                "type": "integer",
                                                "example": 123
                                            },
                                            "product_id": {
                                                "type": "integer",
                                                "example": 456
                                            },
                                            "net_amount": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 99.99
                                            },
                                            "vat": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 19
                                            },
                                            "gross_amount": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 118.99
                                            },
                                            "currency": {
                                                "type": "string",
                                                "example": "eur"
                                            },
                                            "quantity": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "No transactions found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Create transaction",
                "description": "Creates a new transaction. Requires either contact_id or contact_email to identify the customer.",
                "operationId": "be854fd10d63ae10543644d5a84b8168",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "user_id",
                                    "product_id",
                                    "net_amount",
                                    "vat"
                                ],
                                "properties": {
                                    "user_id": {
                                        "description": "ID of the user who processed the transaction",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "contact_id": {
                                        "description": "ID of the contact (customer). Either contact_id or contact_email is required.",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "contact_email": {
                                        "description": "Email of the contact (customer). Either contact_id or contact_email is required.",
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@example.com"
                                    },
                                    "product_id": {
                                        "description": "ID of the product",
                                        "type": "integer",
                                        "example": 456
                                    },
                                    "net_amount": {
                                        "description": "Net amount of the transaction",
                                        "type": "number",
                                        "format": "float",
                                        "example": 99.99
                                    },
                                    "vat": {
                                        "description": "VAT percentage",
                                        "type": "number",
                                        "format": "float",
                                        "example": 19
                                    },
                                    "currency": {
                                        "description": "Currency (defaults to EUR)",
                                        "type": "string",
                                        "enum": [
                                            "eur",
                                            "usd"
                                        ],
                                        "example": "eur"
                                    },
                                    "quantity": {
                                        "description": "Quantity (defaults to 1)",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Transaction created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "transaction_id": {
                                            "type": "integer",
                                            "example": 789
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required fields or invalid contact"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/transactions/recent": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "List recent transactions",
                "description": "Returns the 25 most recent transactions. Useful for Zapier integrations.",
                "operationId": "6773fdefa1f158cdacf7566f2d12f6e9",
                "responses": {
                    "200": {
                        "description": "List of recent transactions retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "contact_id": {
                                                "type": "integer",
                                                "example": 123
                                            },
                                            "product_id": {
                                                "type": "integer",
                                                "example": 456
                                            },
                                            "net_amount": {
                                                "type": "number",
                                                "format": "float",
                                                "example": 99.99
                                            },
                                            "currency": {
                                                "type": "string",
                                                "example": "eur"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/transactions/{transaction_id}": {
            "get": {
                "tags": [
                    "Transactions"
                ],
                "summary": "Get transaction",
                "description": "Retrieves details of a specific transaction by ID.",
                "operationId": "62c5cbd50b506bf057c628c0901211d2",
                "parameters": [
                    {
                        "name": "transaction_id",
                        "in": "path",
                        "description": "Unique identifier for the transaction",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Transaction retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "transaction": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "contact_id": {
                                                    "type": "integer",
                                                    "example": 123
                                                },
                                                "product_id": {
                                                    "type": "integer",
                                                    "example": 456
                                                },
                                                "net_amount": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 99.99
                                                },
                                                "vat": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 19
                                                },
                                                "gross_amount": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 118.99
                                                },
                                                "currency": {
                                                    "type": "string",
                                                    "example": "eur"
                                                },
                                                "quantity": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Transaction not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/users/{user_id}": {
            "get": {
                "tags": [
                    "Benutzer"
                ],
                "summary": "Benutzer abrufen",
                "description": "Ruft Details zu einem bestimmten Benutzer ab.",
                "operationId": "2a7eb101363f24da08e7c18a3b1faffb",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "description": "Eindeutiger Bezeichner für den Benutzer",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Benutzer erfolgreich abgerufen",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "example": "max@mustermann.de"
                                                },
                                                "firstname": {
                                                    "type": "string",
                                                    "example": "Max"
                                                },
                                                "lastname": {
                                                    "type": "string",
                                                    "example": "Mustermann"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "status": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "role": {
                                                    "type": "string",
                                                    "example": "Mitarbeiter"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Nicht authentifiziert"
                    },
                    "404": {
                        "description": "Benutzer nicht gefunden"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/users": {
            "get": {
                "tags": [
                    "Benutzer"
                ],
                "summary": "Benutzer auflisten",
                "description": "Gibt eine Liste aller Benutzer des Unternehmens zurück.",
                "operationId": "8d92f5cb0996368688c9a5125f384707",
                "responses": {
                    "200": {
                        "description": "Benutzerliste erfolgreich abgerufen",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "email": {
                                                "type": "string",
                                                "example": "max@mustermann.de"
                                            },
                                            "firstname": {
                                                "type": "string",
                                                "example": "Max"
                                            },
                                            "lastname": {
                                                "type": "string",
                                                "example": "Mustermann"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "status": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "role": {
                                                "type": "string",
                                                "example": "Mitarbeiter"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Nicht authentifiziert"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/webhooks/subscribe": {
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Create webhook subscription",
                "description": "Creates a new webhook subscription. The specified URL will receive HTTP POST requests when subscribed events occur. See the [Webhook Events Documentation](/api/v1/docs/webhooks) for available events and payload structures.",
                "operationId": "webhookSubscribe",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "url",
                                    "events"
                                ],
                                "properties": {
                                    "title": {
                                        "description": "Name for the webhook subscription",
                                        "type": "string",
                                        "example": "My Integration Webhook"
                                    },
                                    "url": {
                                        "description": "URL to receive webhook POST requests",
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://example.com/webhook"
                                    },
                                    "events": {
                                        "description": "List of events to subscribe to. Available events: contact_created, contact_updated, contact_deleted, contact_field_changed, contact_deal_phase_changed, deal_created, deal_updated, pipeline_created, pipeline_updated, task_created, task_completed, tag_created, tag_added_to_contact, tag_removed_from_contact, offer_seen, offer_accepted",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "example": ["contact_created", "contact_updated", "deal_created"]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Webhook subscription created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "description": "Unique webhook identifier (UUID)",
                                            "type": "string",
                                            "format": "uuid",
                                            "example": "550e8400-e29b-41d4-a716-446655440000"
                                        },
                                        "title": {
                                            "type": "string",
                                            "example": "My Integration Webhook"
                                        },
                                        "url": {
                                            "type": "string",
                                            "example": "https://example.com/webhook"
                                        },
                                        "events": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": ["contact_created", "contact_updated", "deal_created"]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing required fields or invalid URL"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/webhooks/unsubscribe": {
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Delete webhook subscription",
                "description": "Deletes an existing webhook subscription. After deletion, no further events will be sent to the webhook URL.",
                "operationId": "webhookUnsubscribe",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Unique webhook identifier (UUID) returned when creating the subscription",
                                        "type": "string",
                                        "format": "uuid",
                                        "example": "550e8400-e29b-41d4-a716-446655440000"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Webhook subscription deleted successfully (empty response)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Missing webhook ID"
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    },
                    "404": {
                        "description": "Webhook not found"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/webhooks/recent": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Get recent webhook events",
                "description": "Returns a list of recent webhook events. Useful for testing and debugging webhook integrations, especially for Zapier.",
                "operationId": "webhookRecent",
                "parameters": [
                    {
                        "name": "event",
                        "in": "query",
                        "description": "Filter by specific event type (e.g., contact_created, task_completed)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "results",
                        "in": "query",
                        "description": "Number of results to return (default: 10, max: 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "maximum": 100,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of recent webhook events",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "token": {
                                                "description": "Webhook identifier (UUID)",
                                                "type": "string",
                                                "format": "uuid",
                                                "example": "550e8400-e29b-41d4-a716-446655440000"
                                            },
                                            "event": {
                                                "description": "Event type",
                                                "type": "string",
                                                "example": "contact_created"
                                            },
                                            "timestamp": {
                                                "description": "Unix timestamp when the event occurred",
                                                "type": "integer",
                                                "example": 1704067200
                                            },
                                            "data": {
                                                "description": "Event-specific payload data",
                                                "type": "object"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - Invalid or missing API key"
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "description": "API-Schlüssel für die Authentifizierung",
                "name": "Authorization",
                "in": "header"
            },
            "XApiKeyAuth": {
                "type": "apiKey",
                "description": "Alternativer API-Schlüssel Header",
                "name": "X-API-KEY",
                "in": "header"
            }
        }
    },
    "tags": [
        {
            "name": "Benutzer",
            "description": "Benutzerverwaltung"
        },
        {
            "name": "Pipelines",
            "description": "Pipeline- und Deal-Phase-Verwaltung"
        },
        {
            "name": "Teams",
            "description": "Teamverwaltung"
        },
        {
            "name": "Contacts",
            "description": "Contacts"
        },
        {
            "name": "Products",
            "description": "Products"
        },
        {
            "name": "Tasks",
            "description": "Tasks"
        },
        {
            "name": "Transactions",
            "description": "Transactions"
        },
        {
            "name": "Webhooks",
            "description": "Webhook management - subscribe to events, manage subscriptions, and view recent webhook activity. See the [Webhook Events Documentation](/api/v1/docs/webhooks) for payload structures."
        }
    ]
}