{
  "openapi": "3.0.3",
  "info": {
    "title": "emyCRM API",
    "version": "v1",
    "description": "Token authentication: `Authorization: Token <key>` — create the key in your workspace (Settings → API & apps). Pages, filters, errors and examples: https://emycrm.com/developers. Covers the documented part of the API; custom fields of your workspace are not listed — see `GET /api/v1/<entity>/schema/`."
  },
  "servers": [
    {
      "url": "https://{workspace}",
      "variables": {
        "workspace": {
          "default": "your-workspace.emycrm.com",
          "description": "Your workspace address, as in the browser."
        }
      }
    }
  ],
  "security": [
    {
      "TokenAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "TokenAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "`Token <key>`"
      }
    },
    "schemas": {
      "Activity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "entity_type": {
            "type": "string",
            "maxLength": 16
          },
          "entity_id": {
            "type": "integer"
          },
          "kind": {
            "enum": [
              "comment",
              "call",
              "task",
              "note",
              "callback"
            ]
          },
          "author": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "author_name": {
            "type": "string",
            "readOnly": true
          },
          "author_avatar_url": {
            "readOnly": true
          },
          "body": {
            "type": "string",
            "description": "Plain text body for comments / summaries."
          },
          "payload": {
            "description": "Kind-specific extra data: call duration, recording URL, etc."
          },
          "pinned": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "entity_type",
          "entity_id"
        ]
      },
      "Call": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "employee_name": {
            "readOnly": true
          },
          "related_label": {
            "readOnly": true
          },
          "related_type": {
            "readOnly": true
          },
          "related_id": {
            "readOnly": true
          },
          "employee": {
            "type": "integer",
            "nullable": true
          },
          "sip_account": {
            "type": "integer",
            "nullable": true
          },
          "sip_account_name": {
            "readOnly": true
          },
          "direction": {
            "enum": [
              "in",
              "out"
            ]
          },
          "status": {
            "enum": [
              "answered",
              "missed",
              "no_answer",
              "rejected",
              "failed"
            ]
          },
          "greeting_abandoned": {
            "type": "boolean",
            "readOnly": true
          },
          "remote_number": {
            "type": "string",
            "maxLength": 64,
            "description": "The other party's phone number, normalized as best we can."
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "duration_seconds": {
            "type": "integer"
          },
          "related_company": {
            "type": "integer",
            "nullable": true
          },
          "related_contact": {
            "type": "integer",
            "nullable": true
          },
          "related_lead": {
            "type": "integer",
            "nullable": true
          },
          "related_deal": {
            "type": "integer",
            "nullable": true
          },
          "related_custom_type": {
            "type": "string",
            "maxLength": 32
          },
          "related_custom_id": {
            "type": "integer",
            "nullable": true
          },
          "call_token": {
            "type": "string",
            "maxLength": 64,
            "description": "UUID set by the browser at call start; ties the SIP session to this Call row so the recording uploader knows which DB record to update."
          },
          "recording_url": {
            "type": "string",
            "format": "uri",
            "description": "Legacy: URL of a provider-side recording (e.g. Zadarma API response). New self-hosted recordings live in S3 and use recording_s3_key + a per-request presigned URL."
          },
          "recording_status": {
            "enum": [
              "none",
              "pending",
              "uploaded",
              "failed"
            ],
            "readOnly": true
          },
          "recording_uploaded_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "recording_transcript": {
            "type": "string",
            "readOnly": true,
            "description": "Full speech-to-text of the recording. Empty until the recording is processed (or if transcription is skipped)."
          },
          "recording_transcript_lang": {
            "type": "string",
            "readOnly": true,
            "description": "ISO 639-1 language Whisper detected (ru / uz / en / …)."
          },
          "recording_transcript_status": {
            "enum": [
              "none",
              "done",
              "no_speech",
              "failed",
              "skipped",
              "autodial"
            ],
            "readOnly": true
          },
          "recording_transcript_segments": {
            "readOnly": true,
            "description": "Diarized turns [{start,end,speaker,text}] from the manager/client legs. Empty → render the flat transcript."
          },
          "ai_insight": {
            "readOnly": true,
            "description": "Structured AI coaching: summary / good / improve / recommendation / next_step. Empty until generated."
          },
          "ai_insight_status": {
            "enum": [
              "none",
              "done",
              "skipped",
              "failed",
              "over_limit",
              "autodial"
            ],
            "readOnly": true
          },
          "ai_insight_generated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "ai_tags": {
            "readOnly": true,
            "description": "Auto-tags from the transcript, e.g. [\"жалоба\", \"ценовое возражение\"]. Empty until generated."
          },
          "ai_sentiment": {
            "enum": [
              "positive",
              "neutral",
              "negative"
            ],
            "readOnly": true,
            "description": "Overall conversation tone. Blank until generated."
          },
          "ai_quality_score": {
            "type": "integer",
            "nullable": true,
            "readOnly": true,
            "description": "AI call-quality score 0-100. Null until generated."
          },
          "ai_criteria_results": {
            "nullable": true,
            "readOnly": true,
            "description": "Per-success-criterion result from the prompt scorecard. Null until generated / no criteria on the prompt."
          },
          "ai_criteria_score": {
            "type": "integer",
            "nullable": true,
            "readOnly": true,
            "description": "Weighted percent of success criteria met (0-100). Null until generated / no criteria."
          },
          "raw_event": {
            "description": "Any extra context from the browser SIP stack — sip codes, headers, etc. — kept for debugging."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "has_pbx_log": {
            "readOnly": true
          },
          "browser_log": {
            "writeOnly": true
          }
        },
        "required": [
          "direction",
          "status",
          "remote_number",
          "started_at"
        ]
      },
      "Company": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "legal_name": {
            "type": "string",
            "maxLength": 255
          },
          "tax_id": {
            "type": "string",
            "maxLength": 32
          },
          "address": {
            "type": "string",
            "maxLength": 500
          },
          "phone": {
            "type": "string",
            "maxLength": 64
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "website": {
            "type": "string",
            "format": "uri"
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "email"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "notes": {
            "type": "string"
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "contact_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "writeOnly": true
          },
          "new_contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "full_name": {
                  "type": "string",
                  "maxLength": 200
                },
                "phone": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "full_name"
              ]
            },
            "writeOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "is_favorite": {
            "readOnly": true
          },
          "last_activity_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "last_call_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "next_call": {
            "readOnly": true
          },
          "deals_summary": {
            "readOnly": true
          },
          "status": {
            "readOnly": true
          },
          "contacts": {
            "readOnly": true
          },
          "cabinets": {
            "readOnly": true
          },
          "wazzup_client": {
            "readOnly": true
          },
          "client_group_root": {
            "type": "integer",
            "nullable": true
          },
          "client_group": {
            "readOnly": true
          },
          "client_group_brief": {
            "readOnly": true
          },
          "dialer": {
            "readOnly": true
          },
          "clinic": {
            "readOnly": true
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "full_name": {
            "type": "string",
            "maxLength": 200
          },
          "phone": {
            "type": "string",
            "maxLength": 64
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "email"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "notes": {
            "type": "string"
          },
          "birthday": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "company_links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "contact": {
                  "type": "integer"
                },
                "company": {
                  "type": "integer"
                },
                "company_name": {
                  "type": "string",
                  "readOnly": true
                },
                "position": {
                  "type": "string",
                  "maxLength": 120
                },
                "is_primary": {
                  "type": "boolean"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                }
              },
              "required": [
                "contact",
                "company"
              ]
            },
            "readOnly": true
          },
          "company": {
            "type": "integer",
            "nullable": true,
            "writeOnly": true
          },
          "extra_fields": {},
          "deals_count": {
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "is_favorite": {
            "readOnly": true
          }
        }
      },
      "Conversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "kind": {
            "enum": [
              "direct",
              "group",
              "channel"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Group/channel name. For direct chats the UI derives the title from the other party's full_name, so this stays empty."
          },
          "avatar": {},
          "is_private": {
            "type": "boolean",
            "description": "Каналы и ГРУППЫ (issue #3214; до него — только каналы). Закрытый не виден в каталоге «куда я могу вступить» и войти в него можно только по приглашению; открытый виден всем сотрудникам и открыт для вступления. ⚠️ Дефолт ЗАКРЫТО — намеренно, и это единственная безопасная сторона: переписки заводит не только API (чат задачи, конференция, «Создатель чатов»), и любая такая точка при дефолте False молча выставила бы чат в каталог «куда я могу вступить». Существующим группам True проставила миграция 0024: до неё поле у них не значило ничего, и без бэкфилла вся переписка компании разом стала бы публичной."
          },
          "created_by": {
            "type": "integer",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "last_message_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "member_ids": {
            "readOnly": true
          },
          "members": {
            "readOnly": true
          },
          "member_count": {
            "readOnly": true
          },
          "others_read_at": {
            "readOnly": true
          },
          "last_message": {
            "readOnly": true
          },
          "unread_count": {
            "readOnly": true
          },
          "mentions_count": {
            "readOnly": true
          },
          "unread_reactions": {
            "readOnly": true
          },
          "is_pinned": {
            "readOnly": true
          },
          "pinned_at": {
            "readOnly": true
          },
          "is_muted": {
            "readOnly": true
          },
          "notification_level": {
            "readOnly": true
          },
          "who_invites": {
            "enum": [
              "owner",
              "admins",
              "everyone"
            ],
            "description": "Кто может добавлять и исключать участников. Дефолт — все участники (#3214, открыто миграцией 0025); владелец может сузить до админов или только себя."
          },
          "who_edits": {
            "enum": [
              "owner",
              "admins",
              "everyone"
            ],
            "description": "Кто может менять название и аватар чата."
          },
          "who_posts": {
            "type": "string"
          },
          "owner_id": {
            "readOnly": true
          },
          "viewer_role": {
            "readOnly": true
          },
          "viewer_can": {
            "readOnly": true
          },
          "task": {
            "type": "integer",
            "nullable": true,
            "readOnly": true,
            "description": "Задача, чьё обсуждение живёт в этой переписке."
          },
          "task_state": {
            "readOnly": true
          }
        },
        "required": [
          "kind"
        ]
      },
      "CustomEntityRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "entity_type": {
            "type": "integer"
          },
          "entity_type_slug": {
            "type": "string",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255,
            "description": "Auto-derived from CustomEntityType.title_field_code on save. Surfaced in list views."
          },
          "data": {
            "description": "Field values keyed by CustomFieldDefinition.code."
          },
          "links": {
            "description": "Relations to other records, keyed by entity key → target id: {\"company\": 12, \"<slug>\": 5}. One id per related entity (allowed keys = this type's related_entities)."
          },
          "source_key": {
            "type": "string",
            "readOnly": true,
            "description": "Stable system provenance for automatically materialized records. Blank for user-created records."
          },
          "pipeline": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "stage": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "entity_type"
        ]
      },
      "CustomEntityType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "slug": {
            "type": "string",
            "maxLength": 32,
            "description": "Stable identifier. Used in API URLs (?entity=<slug>) and as the CustomFieldDefinition.entity_type key. Cannot change after creation."
          },
          "name": {
            "type": "string",
            "maxLength": 128,
            "description": "Singular human label, e.g. «Поставщик»."
          },
          "name_plural": {
            "type": "string",
            "maxLength": 128,
            "description": "Plural human label, e.g. «Поставщики»."
          },
          "icon": {
            "type": "string",
            "maxLength": 32,
            "description": "Optional sidebar icon (emoji or icon-name)."
          },
          "description": {
            "type": "string"
          },
          "related_entities": {
            "description": "Entity keys this type can be linked to — built-in (company/contact/lead/deal/invoice) or another custom-entity slug. Empty = not related to anything. A «related elements» tab appears on the target entity's card only for types listing it here (Дима 2026-06-24)."
          },
          "line_item_materialization": {
            "description": "Optional generic rule that materializes invoice/deal line items as records of this type. Stores source document kind, a product crm_ref trigger field and an explicit target-field mapping."
          },
          "card_summary": {
            "description": "Optional rule that shows a summary block of this type's records on the card of a linked entity: where to show it (host), what to sum and how to group. Empty = no block."
          },
          "card_hints": {
            "description": "Show this type's records as hints in a tab of the lead/deal/company card feed, filtered by the card's stage: {hosts: [...], stage_field: <field code>}. Empty = off (apps/custom_entities/card_hints.py)."
          },
          "title_field_code": {
            "type": "string",
            "maxLength": 64,
            "description": "CustomFieldDefinition.code that should populate CustomEntityRecord.title on every save. If empty, title is left blank and the UI falls back to «#<id>»."
          },
          "sidebar_order": {
            "type": "integer"
          },
          "show_in_menu": {
            "type": "boolean",
            "description": "Show this type as a link in the CRM sidebar menu. On by default; turn it off to keep the type usable (records, relations, settings) without cluttering the menu (Дима 2026-06-29)."
          },
          "kanban_enabled": {
            "type": "boolean",
            "description": "Show the kanban board for this type — the «Список / Канбан» toggle on its list page. Off by default; opt in per type (Дима 2026-06-28). Existing types were switched on at migration time so nothing regresses."
          },
          "is_archived": {
            "type": "boolean",
            "readOnly": true,
            "description": "Hide from sidebar; existing records become read-only through the API."
          },
          "archived_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "archived_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "is_builtin": {
            "readOnly": true
          },
          "record_count": {
            "readOnly": true
          }
        },
        "required": [
          "name"
        ]
      },
      "CustomFieldDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "entity_type": {
            "type": "string",
            "maxLength": 32
          },
          "code": {
            "type": "string",
            "maxLength": 64,
            "description": "Stable identifier used as the key in extra_fields. Lowercase, underscores."
          },
          "label": {
            "type": "string",
            "maxLength": 128,
            "description": "Human label shown in the UI."
          },
          "kind": {
            "enum": [
              "text",
              "textarea",
              "number",
              "select",
              "multiselect",
              "date",
              "datetime",
              "checkbox",
              "url",
              "email",
              "phone",
              "money",
              "user_ref",
              "crm_ref",
              "file"
            ]
          },
          "options": {
            "description": "For select/multiselect: list of {\"value\": \"...\", \"label\": \"...\"}."
          },
          "is_required": {
            "type": "boolean"
          },
          "is_multiple": {
            "type": "boolean",
            "description": "Value is a list — applies to any kind. (KIND_MULTISELECT is multiple by definition.)"
          },
          "show_in_list": {
            "type": "boolean",
            "description": "If True, the field appears as a column on the entity's list page by default."
          },
          "show_in_filter": {
            "type": "boolean",
            "description": "If True, the field is offered as a filter on list/kanban views."
          },
          "is_weight": {
            "type": "boolean",
            "description": "Числовое поле ТОВАРА — значение = вес позиции в кг. Тогда общий вес документа ({Items.WeightKg}/{Items.WeightT}) суммирует это поле по позициям (в дополнение к весу товаров, продаваемых на вес по единице)."
          },
          "crm_ref_entity": {
            "type": "string",
            "maxLength": 32,
            "description": "For kind=crm_ref: which entity type the value points to — a built-in (ENTITY_CHOICES) or a custom entity slug."
          },
          "ref_filter": {
            "description": "For kind=user_ref: {\"departments\": [id, …]} — pick only from these departments."
          },
          "section": {
            "type": "integer",
            "nullable": true,
            "description": "UI grouping — fields without a section render under «Основные»."
          },
          "order": {
            "type": "integer",
            "description": "Lower numbers appear first."
          },
          "default_value": {
            "nullable": true
          },
          "help_text": {
            "type": "string",
            "maxLength": 255
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "entity_type",
          "code",
          "label"
        ]
      },
      "CustomSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "entity_type": {
            "type": "string",
            "maxLength": 32
          },
          "name": {
            "type": "string",
            "maxLength": 128
          },
          "name_key": {
            "readOnly": true
          },
          "order": {
            "type": "integer"
          },
          "is_default": {
            "type": "boolean",
            "readOnly": true,
            "description": "One auto-bootstrapped section per entity (Основные). Cannot be deleted."
          },
          "is_app": {
            "readOnly": true
          },
          "app": {
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "entity_type",
          "name"
        ]
      },
      "Deal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "notes": {
            "type": "string"
          },
          "company": {
            "type": "integer",
            "nullable": true
          },
          "company_name": {
            "readOnly": true
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "first_contact": {
            "readOnly": true
          },
          "lead": {
            "type": "integer",
            "nullable": true
          },
          "pipeline": {
            "type": "integer"
          },
          "stage": {
            "type": "integer"
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "value": {
            "type": "string",
            "format": "decimal",
            "description": "Deal amount in `currency`."
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "purchase_total": {
            "type": "string",
            "format": "decimal"
          },
          "potential_sale_total": {
            "type": "string",
            "format": "decimal"
          },
          "profit": {
            "type": "string",
            "format": "decimal"
          },
          "expenses_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "costs_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "status": {
            "enum": [
              "open",
              "won",
              "lost"
            ],
            "readOnly": true,
            "description": "Cached from stage.kind for fast filtering."
          },
          "expected_close_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "closed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "closed_on": {
            "readOnly": true
          },
          "link_contact": {
            "type": "integer",
            "nullable": true,
            "writeOnly": true
          },
          "new_company": {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string",
                "maxLength": 64
              },
              "email": {
                "type": "string",
                "maxLength": 254
              },
              "notes": {
                "type": "string"
              },
              "extra_fields": {},
              "name": {
                "type": "string",
                "maxLength": 200
              },
              "legal_name": {
                "type": "string"
              },
              "tax_id": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "website": {
                "type": "string"
              },
              "client_group_root": {
                "type": "integer",
                "nullable": true
              }
            },
            "required": [
              "name"
            ],
            "writeOnly": true,
            "description": "Создать компанию вместе со сделкой: {name, phone, email, legal_name, tax_id, address, website, notes, extra_fields}."
          },
          "new_contact": {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string",
                "maxLength": 64
              },
              "email": {
                "type": "string",
                "maxLength": 254
              },
              "notes": {
                "type": "string"
              },
              "extra_fields": {},
              "full_name": {
                "type": "string",
                "maxLength": 200
              }
            },
            "required": [
              "full_name"
            ],
            "writeOnly": true,
            "description": "Создать контакт вместе со сделкой: {full_name, phone, email, notes, extra_fields}."
          },
          "feed_count": {
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "pipeline",
          "stage"
        ]
      },
      "Department": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "parent": {
            "type": "integer",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "head": {
            "type": "integer",
            "nullable": true
          },
          "order": {
            "type": "integer",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "name"
        ]
      },
      "DocumentTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "entity_type": {
            "enum": [
              "invoice"
            ],
            "description": "Тип сущности, из которой генерируется документ."
          },
          "country": {
            "enum": [
              "UZ",
              "KZ",
              "RO",
              "BY",
              "UA",
              "RU"
            ],
            "description": "Опционально — страна реквизитов; пусто = без привязки."
          },
          "kind": {
            "enum": [
              "docx",
              "html"
            ],
            "description": "docx — загруженный файл; html — визуальный шаблон."
          },
          "html": {
            "type": "string",
            "writeOnly": true
          },
          "variable_overrides": {
            "description": "Переопределения меток шаблона: [{token, text}]."
          },
          "file": {
            "type": "string",
            "format": "binary",
            "writeOnly": true
          },
          "file_name": {
            "type": "string",
            "readOnly": true,
            "description": "Исходное имя загруженного файла (для скачивания)."
          },
          "download_url": {
            "readOnly": true
          },
          "is_active": {
            "type": "boolean"
          },
          "restricted": {
            "type": "boolean",
            "description": "Ограничить доступ. Выкл — виден всем; вкл — только выбранным сотрудникам/отделам (и админам)."
          },
          "visible_users": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Сотрудники, которым выдан доступ (когда «ограничен»)."
          },
          "visible_departments": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Отделы, которым выдан доступ — включая подотделы (когда «ограничен»)."
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "name"
        ]
      },
      "Employee": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "user": {
            "type": "integer"
          },
          "username": {
            "type": "string",
            "readOnly": true
          },
          "email": {
            "type": "string",
            "format": "email",
            "readOnly": true
          },
          "full_name": {
            "type": "string",
            "maxLength": 200
          },
          "first_name": {
            "type": "string",
            "maxLength": 100
          },
          "last_name": {
            "type": "string",
            "maxLength": 100
          },
          "position": {
            "type": "string",
            "maxLength": 120
          },
          "phone": {
            "type": "string",
            "maxLength": 64
          },
          "internal_ext": {
            "type": "string",
            "maxLength": 16,
            "description": "Короткий внутренний номер (3–5 цифр), уникальный внутри клиента. Отдельно от sip_extension — имени эндпоинта PJSIP."
          },
          "invoice_prefix": {
            "type": "string",
            "maxLength": 16
          },
          "invoice_next_number": {
            "type": "integer"
          },
          "telegram": {
            "type": "string",
            "maxLength": 64
          },
          "whatsapp": {
            "type": "string",
            "maxLength": 64
          },
          "city": {
            "type": "string",
            "maxLength": 120
          },
          "birth_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Дата рождения сотрудника. Показывается в карточке (базовое поле, редактируется админом). Необязательное."
          },
          "preferred_language": {
            "enum": [
              "ru",
              "en",
              "uz",
              "kk",
              "ro",
              "uk",
              "de",
              "pt"
            ]
          },
          "preferred_theme": {
            "type": "string",
            "maxLength": 16
          },
          "preferred_emoji_set": {
            "enum": [
              "system",
              "emymoji"
            ]
          },
          "preferred_ui_style": {
            "enum": [
              "classic",
              "new",
              "glass"
            ]
          },
          "chat_prefs": {},
          "avatar_url": {
            "type": "string",
            "format": "uri",
            "description": "URL to the avatar in object storage (R2). The crop & resize happens client-side before upload, so the value always points to a 512x512 JPEG."
          },
          "avatar_data": {
            "type": "string"
          },
          "departments": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Departments this employee belongs to. M2M because one person can sit in several (e.g. «Продажи» + «Совет директоров»)."
          },
          "manager": {
            "type": "integer",
            "nullable": true,
            "description": "Direct manager. Used by the team-card visibility rules (activity sidebar is visible to admins + direct manager)."
          },
          "role": {
            "enum": [
              "admin",
              "manager",
              "employee"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Permission-bearing roles. The legacy `role` enum stays as a coarse label for backwards-compat, but actual access checks go through `roles`."
          },
          "is_admin": {
            "readOnly": true
          },
          "is_owner": {
            "type": "boolean",
            "readOnly": true
          },
          "substitutes": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "readOnly": true,
            "description": "Подменяющие сотрудники на время отсутствия. Что именно каждый подменяет и в каком он порядке — на связи (`EmployeeSubstitute`)."
          },
          "substitute_links": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "writeOnly": true
          },
          "substitution_policy": {
            "enum": [
              "all",
              "round_robin",
              "ordered"
            ]
          },
          "absence": {
            "readOnly": true
          },
          "last_login_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true,
            "description": "Most recent login time (stamped by /api/auth/token/). Surfaced in the team card header."
          },
          "is_active": {
            "type": "boolean",
            "readOnly": true
          },
          "is_service": {
            "type": "boolean",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "last_activity_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "is_guest": {
            "type": "boolean",
            "description": "Внешний участник: видит только свои проекты, места в тарифе не занимает."
          },
          "extra_fields": {},
          "pending_password_request": {
            "readOnly": true
          },
          "pending_email_change": {
            "readOnly": true
          }
        },
        "required": [
          "user",
          "full_name"
        ]
      },
      "EmployeeList": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "user": {
            "type": "integer"
          },
          "username": {
            "type": "string",
            "readOnly": true
          },
          "email": {
            "type": "string",
            "format": "email",
            "readOnly": true
          },
          "full_name": {
            "type": "string",
            "maxLength": 200
          },
          "first_name": {
            "type": "string",
            "maxLength": 100
          },
          "last_name": {
            "type": "string",
            "maxLength": 100
          },
          "position": {
            "type": "string",
            "maxLength": 120
          },
          "phone": {
            "type": "string",
            "maxLength": 64
          },
          "internal_ext": {
            "type": "string",
            "maxLength": 16,
            "description": "Короткий внутренний номер (3–5 цифр), уникальный внутри клиента. Отдельно от sip_extension — имени эндпоинта PJSIP."
          },
          "invoice_prefix": {
            "type": "string",
            "maxLength": 16
          },
          "invoice_next_number": {
            "type": "integer"
          },
          "telegram": {
            "type": "string",
            "maxLength": 64
          },
          "whatsapp": {
            "type": "string",
            "maxLength": 64
          },
          "city": {
            "type": "string",
            "maxLength": 120
          },
          "birth_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Дата рождения сотрудника. Показывается в карточке (базовое поле, редактируется админом). Необязательное."
          },
          "preferred_language": {
            "enum": [
              "ru",
              "en",
              "uz",
              "kk",
              "ro",
              "uk",
              "de",
              "pt"
            ]
          },
          "preferred_theme": {
            "type": "string",
            "maxLength": 16
          },
          "preferred_emoji_set": {
            "enum": [
              "system",
              "emymoji"
            ]
          },
          "preferred_ui_style": {
            "enum": [
              "classic",
              "new",
              "glass"
            ]
          },
          "chat_prefs": {},
          "avatar_url": {
            "readOnly": true
          },
          "departments": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Departments this employee belongs to. M2M because one person can sit in several (e.g. «Продажи» + «Совет директоров»)."
          },
          "manager": {
            "type": "integer",
            "nullable": true,
            "description": "Direct manager. Used by the team-card visibility rules (activity sidebar is visible to admins + direct manager)."
          },
          "role": {
            "enum": [
              "admin",
              "manager",
              "employee"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Permission-bearing roles. The legacy `role` enum stays as a coarse label for backwards-compat, but actual access checks go through `roles`."
          },
          "is_admin": {
            "readOnly": true
          },
          "is_owner": {
            "type": "boolean",
            "readOnly": true
          },
          "last_login_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true,
            "description": "Most recent login time (stamped by /api/auth/token/). Surfaced in the team card header."
          },
          "is_active": {
            "type": "boolean",
            "readOnly": true
          },
          "is_service": {
            "type": "boolean",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "last_activity_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "is_guest": {
            "type": "boolean",
            "description": "Внешний участник: видит только свои проекты, места в тарифе не занимает."
          },
          "extra_fields": {},
          "pending_email_change": {
            "readOnly": true
          }
        },
        "required": [
          "user",
          "full_name"
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string"
          },
          "start_at": {
            "type": "string",
            "format": "date-time"
          },
          "end_at": {
            "type": "string",
            "format": "date-time"
          },
          "all_day": {
            "type": "boolean"
          },
          "event_type": {
            "type": "string",
            "maxLength": 64
          },
          "location": {
            "type": "string",
            "maxLength": 255
          },
          "color": {
            "type": "string",
            "maxLength": 7
          },
          "room": {
            "type": "integer",
            "nullable": true
          },
          "room_name": {
            "type": "string",
            "readOnly": true
          },
          "parking": {
            "type": "integer",
            "nullable": true
          },
          "parking_name": {
            "type": "string",
            "readOnly": true
          },
          "organizer": {
            "type": "integer",
            "nullable": true
          },
          "organizer_name": {
            "type": "string",
            "readOnly": true
          },
          "guest_name": {
            "type": "string",
            "readOnly": true
          },
          "related_object_type": {
            "enum": [
              "company",
              "contact",
              "lead",
              "deal",
              "invoice",
              "project"
            ]
          },
          "related_object_id": {
            "type": "integer",
            "nullable": true
          },
          "related_object_label": {
            "readOnly": true
          },
          "status": {
            "enum": [
              "confirmed",
              "tentative",
              "cancelled"
            ]
          },
          "visibility": {
            "enum": [
              "default",
              "public",
              "private"
            ]
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "recurrence_rule": {
            "type": "string",
            "maxLength": 500
          },
          "origin_tz": {
            "type": "string",
            "maxLength": 64,
            "nullable": true
          },
          "external_provider": {
            "enum": [
              "google",
              "outlook"
            ]
          },
          "external_id": {
            "type": "string",
            "maxLength": 255
          },
          "external_etag": {
            "type": "string",
            "readOnly": true
          },
          "last_synced_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "attendees": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "event": {
                  "type": "integer"
                },
                "employee": {
                  "type": "integer",
                  "nullable": true
                },
                "employee_name": {
                  "type": "string",
                  "readOnly": true
                },
                "external_email": {
                  "type": "string"
                },
                "external_name": {
                  "type": "string"
                },
                "response": {
                  "enum": [
                    "needs_action",
                    "accepted",
                    "declined",
                    "tentative"
                  ]
                },
                "is_optional": {
                  "type": "boolean"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                }
              },
              "required": [
                "event"
              ]
            },
            "readOnly": true
          },
          "attendee_count": {
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "title",
          "start_at",
          "end_at"
        ]
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "maxLength": 64
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "status": {
            "enum": [
              "draft",
              "issued",
              "paid",
              "overdue",
              "cancelled"
            ]
          },
          "amount": {
            "type": "string",
            "format": "decimal"
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "purchase_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "potential_sale_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "profit": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "logistics_cost": {
            "type": "string",
            "format": "decimal"
          },
          "extra_cost": {
            "type": "string",
            "format": "decimal"
          },
          "costs_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "paid_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "shipped_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "balance": {
            "readOnly": true
          },
          "pipeline": {
            "type": "integer",
            "nullable": true
          },
          "stage": {
            "type": "integer",
            "nullable": true
          },
          "issued_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "due_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "paid_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "company": {
            "type": "integer",
            "nullable": true
          },
          "contact": {
            "type": "integer",
            "nullable": true
          },
          "lead": {
            "type": "integer",
            "nullable": true
          },
          "deal": {
            "type": "integer",
            "nullable": true
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "InvoiceCurrency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "code": {
            "type": "string",
            "maxLength": 16
          },
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "name_key": {
            "readOnly": true
          },
          "order": {
            "type": "integer"
          },
          "is_active": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ]
      },
      "Lead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "maxLength": 120,
            "description": "Where this lead came from: web form, referral, etc."
          },
          "contact_name": {
            "type": "string",
            "maxLength": 200
          },
          "contact_phone": {
            "type": "string",
            "maxLength": 64
          },
          "contact_email": {
            "type": "string",
            "format": "email"
          },
          "company_name": {
            "type": "string",
            "maxLength": 200
          },
          "company": {
            "type": "integer",
            "nullable": true
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "email"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "status": {
            "enum": [
              "new",
              "in_progress",
              "qualified",
              "disqualified",
              "converted"
            ]
          },
          "stage": {
            "type": "integer",
            "nullable": true
          },
          "value": {
            "type": "string",
            "format": "decimal"
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "converted_company": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "converted_contact": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "converted_deal": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "converted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "LineItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "uid": {
            "type": "string",
            "format": "uuid"
          },
          "entity_type": {
            "enum": [
              "deal",
              "invoice"
            ],
            "readOnly": true
          },
          "entity_id": {
            "type": "integer",
            "readOnly": true
          },
          "product": {
            "type": "integer",
            "nullable": true
          },
          "variant": {
            "type": "integer",
            "nullable": true
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "unit": {
            "type": "string",
            "maxLength": 32
          },
          "quantity": {
            "type": "string",
            "format": "decimal"
          },
          "price": {
            "type": "string",
            "format": "decimal"
          },
          "discount_percent": {
            "type": "string",
            "format": "decimal"
          },
          "vat_rate": {
            "type": "string",
            "format": "decimal",
            "nullable": true
          },
          "price_includes_vat": {
            "type": "boolean"
          },
          "is_discount": {
            "type": "boolean"
          },
          "field_values": {},
          "position": {
            "type": "integer"
          },
          "net": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "vat_amount": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "product_extra": {
            "readOnly": true
          },
          "product_discount_tiers": {
            "readOnly": true
          },
          "product_fields": {
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "name"
        ]
      },
      "PatchedCompany": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "legal_name": {
            "type": "string",
            "maxLength": 255
          },
          "tax_id": {
            "type": "string",
            "maxLength": 32
          },
          "address": {
            "type": "string",
            "maxLength": 500
          },
          "phone": {
            "type": "string",
            "maxLength": 64
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "website": {
            "type": "string",
            "format": "uri"
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "email"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "notes": {
            "type": "string"
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "contact_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "writeOnly": true
          },
          "new_contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "full_name": {
                  "type": "string",
                  "maxLength": 200
                },
                "phone": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "full_name"
              ]
            },
            "writeOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "is_favorite": {
            "readOnly": true
          },
          "last_activity_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "last_call_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "next_call": {
            "readOnly": true
          },
          "deals_summary": {
            "readOnly": true
          },
          "status": {
            "readOnly": true
          },
          "contacts": {
            "readOnly": true
          },
          "cabinets": {
            "readOnly": true
          },
          "wazzup_client": {
            "readOnly": true
          },
          "client_group_root": {
            "type": "integer",
            "nullable": true
          },
          "client_group": {
            "readOnly": true
          },
          "client_group_brief": {
            "readOnly": true
          },
          "dialer": {
            "readOnly": true
          },
          "clinic": {
            "readOnly": true
          }
        }
      },
      "PatchedContact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "full_name": {
            "type": "string",
            "maxLength": 200
          },
          "phone": {
            "type": "string",
            "maxLength": 64
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "email"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "notes": {
            "type": "string"
          },
          "birthday": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "company_links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "contact": {
                  "type": "integer"
                },
                "company": {
                  "type": "integer"
                },
                "company_name": {
                  "type": "string",
                  "readOnly": true
                },
                "position": {
                  "type": "string",
                  "maxLength": 120
                },
                "is_primary": {
                  "type": "boolean"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                }
              },
              "required": [
                "contact",
                "company"
              ]
            },
            "readOnly": true
          },
          "company": {
            "type": "integer",
            "nullable": true,
            "writeOnly": true
          },
          "extra_fields": {},
          "deals_count": {
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "is_favorite": {
            "readOnly": true
          }
        }
      },
      "PatchedCustomFieldDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "entity_type": {
            "type": "string",
            "maxLength": 32
          },
          "code": {
            "type": "string",
            "maxLength": 64,
            "description": "Stable identifier used as the key in extra_fields. Lowercase, underscores."
          },
          "label": {
            "type": "string",
            "maxLength": 128,
            "description": "Human label shown in the UI."
          },
          "kind": {
            "enum": [
              "text",
              "textarea",
              "number",
              "select",
              "multiselect",
              "date",
              "datetime",
              "checkbox",
              "url",
              "email",
              "phone",
              "money",
              "user_ref",
              "crm_ref",
              "file"
            ]
          },
          "options": {
            "description": "For select/multiselect: list of {\"value\": \"...\", \"label\": \"...\"}."
          },
          "is_required": {
            "type": "boolean"
          },
          "is_multiple": {
            "type": "boolean",
            "description": "Value is a list — applies to any kind. (KIND_MULTISELECT is multiple by definition.)"
          },
          "show_in_list": {
            "type": "boolean",
            "description": "If True, the field appears as a column on the entity's list page by default."
          },
          "show_in_filter": {
            "type": "boolean",
            "description": "If True, the field is offered as a filter on list/kanban views."
          },
          "is_weight": {
            "type": "boolean",
            "description": "Числовое поле ТОВАРА — значение = вес позиции в кг. Тогда общий вес документа ({Items.WeightKg}/{Items.WeightT}) суммирует это поле по позициям (в дополнение к весу товаров, продаваемых на вес по единице)."
          },
          "crm_ref_entity": {
            "type": "string",
            "maxLength": 32,
            "description": "For kind=crm_ref: which entity type the value points to — a built-in (ENTITY_CHOICES) or a custom entity slug."
          },
          "ref_filter": {
            "description": "For kind=user_ref: {\"departments\": [id, …]} — pick only from these departments."
          },
          "section": {
            "type": "integer",
            "nullable": true,
            "description": "UI grouping — fields without a section render under «Основные»."
          },
          "order": {
            "type": "integer",
            "description": "Lower numbers appear first."
          },
          "default_value": {
            "nullable": true
          },
          "help_text": {
            "type": "string",
            "maxLength": 255
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "PatchedDeal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "notes": {
            "type": "string"
          },
          "company": {
            "type": "integer",
            "nullable": true
          },
          "company_name": {
            "readOnly": true
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "first_contact": {
            "readOnly": true
          },
          "lead": {
            "type": "integer",
            "nullable": true
          },
          "pipeline": {
            "type": "integer"
          },
          "stage": {
            "type": "integer"
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "value": {
            "type": "string",
            "format": "decimal",
            "description": "Deal amount in `currency`."
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "purchase_total": {
            "type": "string",
            "format": "decimal"
          },
          "potential_sale_total": {
            "type": "string",
            "format": "decimal"
          },
          "profit": {
            "type": "string",
            "format": "decimal"
          },
          "expenses_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "costs_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "status": {
            "enum": [
              "open",
              "won",
              "lost"
            ],
            "readOnly": true,
            "description": "Cached from stage.kind for fast filtering."
          },
          "expected_close_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "closed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "closed_on": {
            "readOnly": true
          },
          "link_contact": {
            "type": "integer",
            "nullable": true,
            "writeOnly": true
          },
          "new_company": {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string",
                "maxLength": 64
              },
              "email": {
                "type": "string",
                "maxLength": 254
              },
              "notes": {
                "type": "string"
              },
              "extra_fields": {},
              "name": {
                "type": "string",
                "maxLength": 200
              },
              "legal_name": {
                "type": "string"
              },
              "tax_id": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "website": {
                "type": "string"
              },
              "client_group_root": {
                "type": "integer",
                "nullable": true
              }
            },
            "required": [
              "name"
            ],
            "writeOnly": true,
            "description": "Создать компанию вместе со сделкой: {name, phone, email, legal_name, tax_id, address, website, notes, extra_fields}."
          },
          "new_contact": {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string",
                "maxLength": 64
              },
              "email": {
                "type": "string",
                "maxLength": 254
              },
              "notes": {
                "type": "string"
              },
              "extra_fields": {},
              "full_name": {
                "type": "string",
                "maxLength": 200
              }
            },
            "required": [
              "full_name"
            ],
            "writeOnly": true,
            "description": "Создать контакт вместе со сделкой: {full_name, phone, email, notes, extra_fields}."
          },
          "feed_count": {
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "PatchedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string"
          },
          "start_at": {
            "type": "string",
            "format": "date-time"
          },
          "end_at": {
            "type": "string",
            "format": "date-time"
          },
          "all_day": {
            "type": "boolean"
          },
          "event_type": {
            "type": "string",
            "maxLength": 64
          },
          "location": {
            "type": "string",
            "maxLength": 255
          },
          "color": {
            "type": "string",
            "maxLength": 7
          },
          "room": {
            "type": "integer",
            "nullable": true
          },
          "room_name": {
            "type": "string",
            "readOnly": true
          },
          "parking": {
            "type": "integer",
            "nullable": true
          },
          "parking_name": {
            "type": "string",
            "readOnly": true
          },
          "organizer": {
            "type": "integer",
            "nullable": true
          },
          "organizer_name": {
            "type": "string",
            "readOnly": true
          },
          "guest_name": {
            "type": "string",
            "readOnly": true
          },
          "related_object_type": {
            "enum": [
              "company",
              "contact",
              "lead",
              "deal",
              "invoice",
              "project"
            ]
          },
          "related_object_id": {
            "type": "integer",
            "nullable": true
          },
          "related_object_label": {
            "readOnly": true
          },
          "status": {
            "enum": [
              "confirmed",
              "tentative",
              "cancelled"
            ]
          },
          "visibility": {
            "enum": [
              "default",
              "public",
              "private"
            ]
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "recurrence_rule": {
            "type": "string",
            "maxLength": 500
          },
          "origin_tz": {
            "type": "string",
            "maxLength": 64,
            "nullable": true
          },
          "external_provider": {
            "enum": [
              "google",
              "outlook"
            ]
          },
          "external_id": {
            "type": "string",
            "maxLength": 255
          },
          "external_etag": {
            "type": "string",
            "readOnly": true
          },
          "last_synced_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "attendees": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "event": {
                  "type": "integer"
                },
                "employee": {
                  "type": "integer",
                  "nullable": true
                },
                "employee_name": {
                  "type": "string",
                  "readOnly": true
                },
                "external_email": {
                  "type": "string"
                },
                "external_name": {
                  "type": "string"
                },
                "response": {
                  "enum": [
                    "needs_action",
                    "accepted",
                    "declined",
                    "tentative"
                  ]
                },
                "is_optional": {
                  "type": "boolean"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                }
              },
              "required": [
                "event"
              ]
            },
            "readOnly": true
          },
          "attendee_count": {
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "PatchedInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "maxLength": 64
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "status": {
            "enum": [
              "draft",
              "issued",
              "paid",
              "overdue",
              "cancelled"
            ]
          },
          "amount": {
            "type": "string",
            "format": "decimal"
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "purchase_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "potential_sale_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "profit": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "logistics_cost": {
            "type": "string",
            "format": "decimal"
          },
          "extra_cost": {
            "type": "string",
            "format": "decimal"
          },
          "costs_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "paid_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "shipped_total": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "balance": {
            "readOnly": true
          },
          "pipeline": {
            "type": "integer",
            "nullable": true
          },
          "stage": {
            "type": "integer",
            "nullable": true
          },
          "issued_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "due_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "paid_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "company": {
            "type": "integer",
            "nullable": true
          },
          "contact": {
            "type": "integer",
            "nullable": true
          },
          "lead": {
            "type": "integer",
            "nullable": true
          },
          "deal": {
            "type": "integer",
            "nullable": true
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "PatchedInvoiceCurrency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "code": {
            "type": "string",
            "maxLength": 16
          },
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "name_key": {
            "readOnly": true
          },
          "order": {
            "type": "integer"
          },
          "is_active": {
            "type": "boolean"
          }
        }
      },
      "PatchedLead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "maxLength": 120,
            "description": "Where this lead came from: web form, referral, etc."
          },
          "contact_name": {
            "type": "string",
            "maxLength": 200
          },
          "contact_phone": {
            "type": "string",
            "maxLength": 64
          },
          "contact_email": {
            "type": "string",
            "format": "email"
          },
          "company_name": {
            "type": "string",
            "maxLength": 200
          },
          "company": {
            "type": "integer",
            "nullable": true
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "email"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "websites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "label": {
                  "type": "string",
                  "maxLength": 16
                },
                "value": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "value"
              ]
            },
            "description": "Writing replaces the whole list. In responses every item also has order (and is_primary — companies and contacts)."
          },
          "status": {
            "enum": [
              "new",
              "in_progress",
              "qualified",
              "disqualified",
              "converted"
            ]
          },
          "stage": {
            "type": "integer",
            "nullable": true
          },
          "value": {
            "type": "string",
            "format": "decimal"
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "owner": {
            "type": "integer",
            "nullable": true
          },
          "previous_owner": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "owner_changed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "converted_company": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "converted_contact": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "converted_deal": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "converted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "PatchedProduct": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "sku": {
            "type": "string",
            "maxLength": 100,
            "description": "Артикул / код позиции. Необязательный, не уникальный."
          },
          "kind": {
            "enum": [
              "product",
              "service",
              "discount"
            ]
          },
          "section": {
            "type": "integer",
            "nullable": true
          },
          "section_name": {
            "type": "string",
            "readOnly": true
          },
          "description": {
            "type": "string"
          },
          "image_url": {
            "readOnly": true
          },
          "price": {
            "type": "string",
            "format": "decimal"
          },
          "purchase_price": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Закупочная цена (себестоимость). Пусто = не задана."
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "purchase_currency": {
            "type": "string",
            "maxLength": 16,
            "description": "Валюта закупки. Значения — из справочника ProductPurchaseCurrency, хранится строкой (снимок)."
          },
          "purchase_rate": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Курс валюты закупки. Пусто = не задан."
          },
          "purchase_vat_rate": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Курс закупки для НДС закупки. Пусто = не считается."
          },
          "unit": {
            "type": "string",
            "maxLength": 32,
            "description": "Единица измерения (шт, кг, м, ч…). Значения берутся из справочника ProductUnit, но хранится строкой (снимок)."
          },
          "vat_rate": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Ставка НДС в процентах. Пусто = без НДС."
          },
          "price_includes_vat": {
            "type": "boolean",
            "description": "В цену продажи уже включён НДС?"
          },
          "variant_attributes": {},
          "discount_tiers": {},
          "stock": {
            "readOnly": true
          },
          "variants_count": {
            "type": "integer",
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "Pipeline": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "description": {
            "type": "string"
          },
          "entity_type": {
            "type": "string",
            "maxLength": 32,
            "description": "Owning entity: built-in «deal»/«lead»/«invoice» or a custom-entity slug. Immutable after creation."
          },
          "is_default": {
            "type": "boolean",
            "description": "The pipeline the UI selects by default for this entity."
          },
          "board_by_stages": {
            "type": "boolean"
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "readOnly": true
                },
                "pipeline": {
                  "type": "integer"
                },
                "name": {
                  "type": "string",
                  "maxLength": 120
                },
                "code": {
                  "type": "string",
                  "nullable": true,
                  "readOnly": true,
                  "description": "Stable identifier, namespaced by pipeline scope — built-in stages «<scope>_{new,in_progress,success,fail}» (e.g. deal_success, deal15_success, entity13_17_success), client-added ones get counter codes «<scope>_<N>». Immutable; lets automations/tokens target a stage independent of its numeric id. NULL on legacy/direct-ORM rows."
                },
                "order": {
                  "type": "integer",
                  "description": "Lower numbers appear first."
                },
                "probability": {
                  "type": "integer",
                  "description": "Forecast probability of winning at this stage, 0-100."
                },
                "kind": {
                  "enum": [
                    "open",
                    "won",
                    "lost"
                  ]
                },
                "color": {
                  "type": "string",
                  "maxLength": 16,
                  "description": "Optional hex color for the UI column."
                },
                "required_field_codes": {
                  "description": "List of CustomFieldDefinition.code (entity_type = the pipeline's entity_type) that must be filled before a record can ENTER this stage."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "readOnly": true
                }
              },
              "required": [
                "pipeline",
                "name"
              ]
            },
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "name"
        ]
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "sku": {
            "type": "string",
            "maxLength": 100,
            "description": "Артикул / код позиции. Необязательный, не уникальный."
          },
          "kind": {
            "enum": [
              "product",
              "service",
              "discount"
            ]
          },
          "section": {
            "type": "integer",
            "nullable": true
          },
          "section_name": {
            "type": "string",
            "readOnly": true
          },
          "description": {
            "type": "string"
          },
          "image_url": {
            "readOnly": true
          },
          "price": {
            "type": "string",
            "format": "decimal"
          },
          "purchase_price": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Закупочная цена (себестоимость). Пусто = не задана."
          },
          "currency": {
            "type": "string",
            "maxLength": 8
          },
          "purchase_currency": {
            "type": "string",
            "maxLength": 16,
            "description": "Валюта закупки. Значения — из справочника ProductPurchaseCurrency, хранится строкой (снимок)."
          },
          "purchase_rate": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Курс валюты закупки. Пусто = не задан."
          },
          "purchase_vat_rate": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Курс закупки для НДС закупки. Пусто = не считается."
          },
          "unit": {
            "type": "string",
            "maxLength": 32,
            "description": "Единица измерения (шт, кг, м, ч…). Значения берутся из справочника ProductUnit, но хранится строкой (снимок)."
          },
          "vat_rate": {
            "type": "string",
            "format": "decimal",
            "nullable": true,
            "description": "Ставка НДС в процентах. Пусто = без НДС."
          },
          "price_includes_vat": {
            "type": "boolean",
            "description": "В цену продажи уже включён НДС?"
          },
          "variant_attributes": {},
          "discount_tiers": {},
          "stock": {
            "readOnly": true
          },
          "variants_count": {
            "type": "integer",
            "readOnly": true
          },
          "created_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        }
      },
      "ProductVariant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "product": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "sku": {
            "type": "string",
            "maxLength": 100,
            "description": "Артикул вариации. Необязательный, не уникальный."
          },
          "price": {
            "type": "string",
            "format": "decimal",
            "nullable": true
          },
          "purchase_price": {
            "type": "string",
            "format": "decimal",
            "nullable": true
          },
          "effective_price": {
            "type": "string",
            "format": "decimal",
            "readOnly": true
          },
          "attributes": {},
          "position": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "product",
          "name"
        ]
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string"
          },
          "parent_task": {
            "type": "integer",
            "nullable": true
          },
          "subtask_progress": {
            "readOnly": true
          },
          "related_tasks": {
            "readOnly": true
          },
          "assignee": {
            "type": "integer",
            "nullable": true
          },
          "assignee_name": {
            "type": "string",
            "readOnly": true
          },
          "assignee_is_active": {
            "readOnly": true
          },
          "assignee_avatar_url": {
            "readOnly": true
          },
          "reporter": {
            "type": "integer",
            "nullable": true
          },
          "reporter_name": {
            "type": "string",
            "readOnly": true
          },
          "reporter_is_active": {
            "readOnly": true
          },
          "reporter_avatar_url": {
            "readOnly": true
          },
          "client_first": {
            "readOnly": true
          },
          "chat_unread": {
            "readOnly": true
          },
          "chat_mentions": {
            "readOnly": true
          },
          "co_assignees": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Дополнительные исполнители. Видят задачу в списке и могут её редактировать, но primary owner — `assignee`."
          },
          "co_assignee_names": {
            "readOnly": true
          },
          "inactive_co_assignee_ids": {
            "readOnly": true
          },
          "watchers": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Наблюдатели — получают уведомления о смене статуса / комментариях, но не могут редактировать."
          },
          "watcher_names": {
            "readOnly": true
          },
          "inactive_watcher_ids": {
            "readOnly": true
          },
          "entity_type": {
            "type": "string",
            "maxLength": 16
          },
          "entity_id": {
            "type": "integer",
            "nullable": true
          },
          "entity_label": {
            "readOnly": true
          },
          "extra_links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entity_type": {
                  "type": "string",
                  "maxLength": 32
                },
                "entity_id": {
                  "type": "integer"
                },
                "label": {
                  "readOnly": true
                }
              },
              "required": [
                "entity_type",
                "entity_id"
              ]
            }
          },
          "related_company": {
            "type": "integer",
            "nullable": true
          },
          "related_company_name": {
            "type": "string",
            "readOnly": true
          },
          "related_contact": {
            "type": "integer",
            "nullable": true
          },
          "project": {
            "type": "integer",
            "nullable": true
          },
          "project_name": {
            "type": "string",
            "readOnly": true
          },
          "flow": {
            "type": "integer",
            "nullable": true
          },
          "flow_name": {
            "type": "string",
            "readOnly": true
          },
          "flow_unclaimed": {
            "type": "boolean",
            "readOnly": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "status": {
            "enum": [
              "new",
              "in_progress",
              "waiting_review",
              "snoozed",
              "done",
              "cancelled"
            ]
          },
          "priority": {
            "enum": [
              "low",
              "normal",
              "high",
              "urgent"
            ]
          },
          "task_type": {
            "type": "string",
            "maxLength": 64
          },
          "requires_review": {
            "type": "boolean"
          },
          "can_require_review": {
            "readOnly": true
          },
          "allow_assignee_change_due": {
            "type": "boolean"
          },
          "can_change_due": {
            "readOnly": true
          },
          "can_set_due_rule": {
            "readOnly": true
          },
          "due_request_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "due_request_to": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "due_request_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "due_request_by_name": {
            "type": "string",
            "readOnly": true
          },
          "due_request_comment": {
            "type": "string",
            "readOnly": true
          },
          "is_favorite": {
            "readOnly": true
          },
          "is_pinned": {
            "readOnly": true
          },
          "start_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "result": {
            "type": "string"
          },
          "result_submitted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "rating": {
            "enum": [
              1,
              2,
              3,
              4,
              5
            ],
            "nullable": true
          },
          "rating_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "rating_comment": {
            "type": "string"
          },
          "can_rate": {
            "readOnly": true
          },
          "planned_minutes": {
            "type": "integer",
            "nullable": true,
            "description": "Плановые трудозатраты в минутах. Пусто — не оценивали."
          },
          "spent_minutes": {
            "readOnly": true
          },
          "timer_running": {
            "readOnly": true
          },
          "original_due_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "is_overdue": {
            "type": "boolean",
            "readOnly": true
          },
          "comments_count": {
            "readOnly": true
          },
          "attachments_count": {
            "readOnly": true
          },
          "checklist_progress": {
            "readOnly": true
          },
          "available_transitions": {
            "readOnly": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "deleted_by": {
            "type": "integer",
            "nullable": true,
            "readOnly": true,
            "description": "Кто удалил. Нужен корзине: «кто убрал задачу» — первый вопрос того, кто её ищет."
          },
          "deleted_by_name": {
            "type": "string",
            "readOnly": true
          },
          "can_delete": {
            "readOnly": true
          },
          "can_edit": {
            "readOnly": true
          },
          "is_muted": {
            "readOnly": true
          },
          "extra_fields": {},
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "title"
        ]
      }
    }
  },
  "paths": {
    "/api/v1/activities/": {
      "get": {
        "tags": [
          "activities"
        ],
        "summary": "list — /activities/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Activity"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "activities"
        ],
        "summary": "create — /activities/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Activity"
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/attachments/": {
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "post — /chat/attachments/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/conversations/": {
      "get": {
        "tags": [
          "chat"
        ],
        "summary": "list — /chat/conversations/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Conversation"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "create — /chat/conversations/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Conversation"
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/send/": {
      "post": {
        "tags": [
          "chat"
        ],
        "summary": "post — /chat/send/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chat_id": {
                    "type": "integer"
                  },
                  "user_id": {
                    "type": "integer",
                    "description": "Employee id; send chat_id OR user_id."
                  },
                  "body": {
                    "type": "string"
                  },
                  "attachment_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/companies/": {
      "get": {
        "tags": [
          "companies"
        ],
        "summary": "list — /companies/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Company"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "companies"
        ],
        "summary": "create — /companies/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Company"
              }
            }
          }
        }
      }
    },
    "/api/v1/companies/filter-ids/": {
      "get": {
        "tags": [
          "companies"
        ],
        "summary": "filter ids — /companies/filter-ids/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/companies/schema/": {
      "get": {
        "tags": [
          "companies"
        ],
        "summary": "schema — /companies/schema/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/companies/{pk}/": {
      "get": {
        "tags": [
          "companies"
        ],
        "summary": "retrieve — /companies/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "companies"
        ],
        "summary": "partial update — /companies/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Company"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedCompany"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "companies"
        ],
        "summary": "destroy — /companies/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/contacts/": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "list — /contacts/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "contacts"
        ],
        "summary": "create — /contacts/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Contact"
              }
            }
          }
        }
      }
    },
    "/api/v1/contacts/schema/": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "schema — /contacts/schema/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/contacts/{pk}/": {
      "get": {
        "tags": [
          "contacts"
        ],
        "summary": "retrieve — /contacts/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "contacts"
        ],
        "summary": "partial update — /contacts/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedContact"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "contacts"
        ],
        "summary": "destroy — /contacts/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/custom-entities/records/": {
      "get": {
        "tags": [
          "custom-entities"
        ],
        "summary": "list — /custom-entities/records/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomEntityRecord"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          }
        ]
      },
      "post": {
        "tags": [
          "custom-entities"
        ],
        "summary": "create — /custom-entities/records/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomEntityRecord"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomEntityRecord"
              }
            }
          }
        }
      }
    },
    "/api/v1/custom-entities/types/": {
      "get": {
        "tags": [
          "custom-entities"
        ],
        "summary": "list — /custom-entities/types/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomEntityType"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "custom-entities"
        ],
        "summary": "create — /custom-entities/types/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomEntityType"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomEntityType"
              }
            }
          }
        }
      }
    },
    "/api/v1/customfields/definitions/": {
      "get": {
        "tags": [
          "customfields"
        ],
        "summary": "list — /customfields/definitions/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomFieldDefinition"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "customfields"
        ],
        "summary": "create — /customfields/definitions/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFieldDefinition"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldDefinition"
              }
            }
          }
        }
      }
    },
    "/api/v1/customfields/definitions/next-code/": {
      "post": {
        "tags": [
          "customfields"
        ],
        "summary": "next code — /customfields/definitions/next-code/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity": {
                    "type": "string"
                  }
                },
                "required": [
                  "entity"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/customfields/definitions/{pk}/": {
      "get": {
        "tags": [
          "customfields"
        ],
        "summary": "retrieve — /customfields/definitions/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFieldDefinition"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "customfields"
        ],
        "summary": "partial update — /customfields/definitions/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFieldDefinition"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedCustomFieldDefinition"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "customfields"
        ],
        "summary": "destroy — /customfields/definitions/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/customfields/file/": {
      "get": {
        "tags": [
          "customfields"
        ],
        "summary": "get — /customfields/file/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/customfields/sections/": {
      "get": {
        "tags": [
          "customfields"
        ],
        "summary": "list — /customfields/sections/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomSection"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "customfields"
        ],
        "summary": "create — /customfields/sections/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomSection"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomSection"
              }
            }
          }
        }
      }
    },
    "/api/v1/customfields/upload/": {
      "post": {
        "tags": [
          "customfields"
        ],
        "summary": "post — /customfields/upload/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/deals/": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "list — /deals/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Deal"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "create — /deals/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deal"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Deal"
              }
            }
          }
        }
      }
    },
    "/api/v1/deals/schema/": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "schema — /deals/schema/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/deals/{pk}/": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "retrieve — /deals/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deal"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "deals"
        ],
        "summary": "partial update — /deals/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deal"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedDeal"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "deals"
        ],
        "summary": "destroy — /deals/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/deals/{pk}/move/": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "move — /deals/{pk}/move/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage": {
                    "type": "integer"
                  }
                },
                "required": [
                  "stage"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/templates/": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "list — /documents/templates/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocumentTemplate"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "documents"
        ],
        "summary": "create — /documents/templates/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentTemplate"
              }
            }
          }
        }
      }
    },
    "/api/v1/documents/templates/{pk}/generate/": {
      "post": {
        "tags": [
          "documents"
        ],
        "summary": "generate — /documents/templates/{pk}/generate/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "invoice": {
                    "type": "integer"
                  },
                  "format": {
                    "enum": [
                      "pdf",
                      "docx"
                    ]
                  },
                  "vat_clause": {
                    "enum": [
                      "incl",
                      "excl"
                    ]
                  }
                },
                "required": [
                  "invoice"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/duplicates/phones/": {
      "post": {
        "tags": [
          "duplicates"
        ],
        "summary": "post — /duplicates/phones/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phones": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "entities": {
                    "type": "array",
                    "items": {
                      "enum": [
                        "company",
                        "contact"
                      ]
                    }
                  },
                  "match": {
                    "enum": [
                      "exact",
                      "tail"
                    ]
                  }
                },
                "required": [
                  "phones"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/events/": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "list — /events/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          }
        ]
      },
      "post": {
        "tags": [
          "events"
        ],
        "summary": "create — /events/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        }
      }
    },
    "/api/v1/events/{pk}/": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "retrieve — /events/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "events"
        ],
        "summary": "partial update — /events/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedEvent"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "events"
        ],
        "summary": "destroy — /events/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/invoice-currencies/": {
      "get": {
        "tags": [
          "invoice-currencies"
        ],
        "summary": "list — /invoice-currencies/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvoiceCurrency"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      },
      "post": {
        "tags": [
          "invoice-currencies"
        ],
        "summary": "create — /invoice-currencies/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCurrency"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCurrency"
              }
            }
          }
        }
      }
    },
    "/api/v1/invoice-currencies/{pk}/": {
      "get": {
        "tags": [
          "invoice-currencies"
        ],
        "summary": "retrieve — /invoice-currencies/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCurrency"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "invoice-currencies"
        ],
        "summary": "partial update — /invoice-currencies/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCurrency"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedInvoiceCurrency"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "invoice-currencies"
        ],
        "summary": "destroy — /invoice-currencies/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/invoices/": {
      "get": {
        "tags": [
          "invoices"
        ],
        "summary": "list — /invoices/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Invoice"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "invoices"
        ],
        "summary": "create — /invoices/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Invoice"
              }
            }
          }
        }
      }
    },
    "/api/v1/invoices/schema/": {
      "get": {
        "tags": [
          "invoices"
        ],
        "summary": "schema — /invoices/schema/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/invoices/{pk}/": {
      "get": {
        "tags": [
          "invoices"
        ],
        "summary": "retrieve — /invoices/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "invoices"
        ],
        "summary": "partial update — /invoices/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedInvoice"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "invoices"
        ],
        "summary": "destroy — /invoices/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/leads/": {
      "get": {
        "tags": [
          "leads"
        ],
        "summary": "list — /leads/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Lead"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "leads"
        ],
        "summary": "create — /leads/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lead"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Lead"
              }
            }
          }
        }
      }
    },
    "/api/v1/leads/schema/": {
      "get": {
        "tags": [
          "leads"
        ],
        "summary": "schema — /leads/schema/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/leads/{pk}/": {
      "get": {
        "tags": [
          "leads"
        ],
        "summary": "retrieve — /leads/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lead"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "leads"
        ],
        "summary": "partial update — /leads/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lead"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedLead"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "leads"
        ],
        "summary": "destroy — /leads/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/leads/{pk}/convert/": {
      "post": {
        "tags": [
          "leads"
        ],
        "summary": "convert — /leads/{pk}/convert/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "create_deal": {
                    "type": "boolean"
                  },
                  "pipeline": {
                    "type": "integer"
                  },
                  "stage": {
                    "type": "integer"
                  },
                  "deal_title": {
                    "type": "string"
                  },
                  "company": {
                    "type": "integer"
                  },
                  "company_name": {
                    "type": "string"
                  },
                  "create_company": {
                    "type": "boolean"
                  },
                  "contact": {
                    "type": "integer"
                  },
                  "create_contact": {
                    "type": "boolean"
                  },
                  "adopt_company_owner": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/line-items/": {
      "get": {
        "tags": [
          "line-items"
        ],
        "summary": "list — /line-items/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LineItem"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          }
        ]
      }
    },
    "/api/v1/line-items/bulk/": {
      "post": {
        "tags": [
          "line-items"
        ],
        "summary": "bulk — /line-items/bulk/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity_type": {
                    "enum": [
                      "invoice",
                      "deal"
                    ]
                  },
                  "entity_id": {
                    "type": "integer"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product": {
                          "type": "integer"
                        },
                        "variant": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "unit": {
                          "type": "string"
                        },
                        "quantity": {
                          "type": "string",
                          "format": "decimal"
                        },
                        "price": {
                          "type": "string",
                          "format": "decimal"
                        },
                        "vat_rate": {
                          "type": "string",
                          "format": "decimal"
                        }
                      },
                      "required": [
                        "name"
                      ]
                    }
                  }
                },
                "required": [
                  "entity_type",
                  "entity_id",
                  "items"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/objects/schema/": {
      "get": {
        "tags": [
          "objects"
        ],
        "summary": "schema — /objects/schema/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/people/employees/": {
      "get": {
        "tags": [
          "people"
        ],
        "summary": "list — /people/employees/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmployeeList"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "people"
        ],
        "summary": "create — /people/employees/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Employee"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Employee"
              }
            }
          }
        }
      }
    },
    "/api/v1/product-variants/": {
      "get": {
        "tags": [
          "product-variants"
        ],
        "summary": "list — /product-variants/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductVariant"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      },
      "post": {
        "tags": [
          "product-variants"
        ],
        "summary": "create — /product-variants/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductVariant"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductVariant"
              }
            }
          }
        }
      }
    },
    "/api/v1/products/": {
      "get": {
        "tags": [
          "products"
        ],
        "summary": "list — /products/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "products"
        ],
        "summary": "create — /products/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Product"
              }
            }
          }
        }
      }
    },
    "/api/v1/products/schema/": {
      "get": {
        "tags": [
          "products"
        ],
        "summary": "schema — /products/schema/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/products/{pk}/": {
      "get": {
        "tags": [
          "products"
        ],
        "summary": "retrieve — /products/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "products"
        ],
        "summary": "partial update — /products/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedProduct"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "products"
        ],
        "summary": "destroy — /products/{pk}/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/products/{pk}/image/": {
      "post": {
        "tags": [
          "products"
        ],
        "summary": "image — /products/{pk}/image/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "products"
        ],
        "summary": "image — /products/{pk}/image/",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/sales/pipelines/": {
      "get": {
        "tags": [
          "sales"
        ],
        "summary": "list — /sales/pipelines/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Pipeline"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "sales"
        ],
        "summary": "create — /sales/pipelines/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pipeline"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pipeline"
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/departments/": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "list — /settings/departments/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Department"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "create — /settings/departments/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Department"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Department"
              }
            }
          }
        }
      }
    },
    "/api/v1/site-connector/order/": {
      "post": {
        "tags": [
          "site-connector"
        ],
        "summary": "post — /site-connector/order/",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "sku": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "quantity": {
                          "type": "number"
                        },
                        "price": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "201": {
            "description": "Created."
          }
        }
      }
    },
    "/api/v1/site-connector/submit/": {
      "post": {
        "tags": [
          "site-connector"
        ],
        "summary": "post — /site-connector/submit/",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "company": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "201": {
            "description": "Created."
          }
        }
      }
    },
    "/api/v1/tasks/": {
      "get": {
        "tags": [
          "tasks"
        ],
        "summary": "list — /tasks/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Task"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "base64url of a JSON array of {field, op, value} conditions — see the docs."
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated keys to return."
          }
        ]
      },
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "create — /tasks/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Task"
              }
            }
          }
        }
      }
    },
    "/api/v1/telephony/calls/": {
      "get": {
        "tags": [
          "telephony"
        ],
        "summary": "list — /telephony/calls/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Call"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page number, from 1."
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Records per page."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Text search."
          },
          {
            "name": "ordering",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort field, `-` for descending."
          }
        ]
      },
      "post": {
        "tags": [
          "telephony"
        ],
        "summary": "create — /telephony/calls/",
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Call"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Call"
              }
            }
          }
        }
      }
    },
    "/api/v1/telephony/calls/{pk}/": {
      "get": {
        "tags": [
          "telephony"
        ],
        "summary": "retrieve — /telephony/calls/{pk}/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Call"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/telephony/calls/{pk}/recording-url/": {
      "get": {
        "tags": [
          "telephony"
        ],
        "summary": "recording url — /telephony/calls/{pk}/recording-url/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "parameters": [
          {
            "name": "pk",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/telephony/lookup/": {
      "get": {
        "tags": [
          "telephony"
        ],
        "summary": "list — /telephony/lookup/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        }
      }
    },
    "/api/v1/timeline/comment/": {
      "post": {
        "tags": [
          "timeline"
        ],
        "summary": "post — /timeline/comment/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation error."
          },
          "401": {
            "description": "No or invalid token."
          },
          "403": {
            "description": "No permission."
          },
          "429": {
            "description": "Rate limit — see Retry-After."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity_type": {
                    "type": "string"
                  },
                  "entity_id": {
                    "type": "integer"
                  },
                  "body": {
                    "type": "string"
                  },
                  "payload": {
                    "type": "object",
                    "properties": {
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "key"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": [
                  "entity_type",
                  "entity_id",
                  "body"
                ]
              }
            }
          }
        }
      }
    }
  }
}
